2

I'm using KVM virtual machine on Debian 12 and I want to use the default virtual network.
First, the default network was missing

virsh net-list --all 

so I reloaded it:

virsh net-define /usr/share/libvirt/networks/default.xml virsh net-autostart default virsh net-list --all Name State Autostart Persistent ---------------------------------------------- default inactive yes yes 

It worked but it's inactive. Now when I try to start the default network:

virsh net-start default 

I get these errors:

error: Failed to start network default
error: internal error: Network is already in use by interface virbr0

How can I fix this ?

2
  • Can you update your question to show the output of virsh net-list --all? Commented Sep 4, 2024 at 18:18
  • @larsks I updated my question. Commented Sep 5, 2024 at 4:35

1 Answer 1

1

This issue stems from the fact that you defined a network that's using an interface that is already in use by another network (by copying the existing default network and essentially cloning it).

The default virtual network is "missing" because you're listing the session networks instead of the system networks.

You can verify which URI you're using by running

$ virsh uri qemu:///session 

If you specify that you want to see the system networks then you'll be able to see the default network:

$ virsh --connect qemu:///system net-list Name State Autostart Persistent -------------------------------------------- default active yes yes 

You can also use sudo which automatically connects to qemu:///system:

$ sudo virsh net-list --all Name State Autostart Persistent -------------------------------------------- default active yes yes 

If you want to use the system networks by default as a non-root user you can check out How do I list virsh networks without sudo?

If you want more information you can check out Red Hat's documentation on Connecting to the Hypervisor with virsh Connect. Even though this documentation is aimed at RHEL, it still applies to Debian.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.