Question: When I am trying to start a guest VM on QEMU/KVM via virt-manager, it fails to start with the error:
When you install QEMU/KVM in Linux, the "Error starting domain: Requested operation is not valid: network 'default' is not active"How can I fix this error?
default
NAT network is created automatically by libvirtd
daemon. The properties of the default
network are defined in the libvirt
‘s default network template (located at /etc/libvirt/qemu/networks/default.xml
). This default
network is used to interconnect guest VMs’s virtual NICs in NAT mode.
If, for whatever reason, the default
network is deactivated, you won’t be able to start any guest VMs which are configured to use the network.
When you check the state of existing networks, you will see inactive
state for the default
network.
$ sudo virsh net-list --allHere we show how to solve the
default
network stuck in inactive
state.
Solution One
Your first attempt can be simply trying to start the network withvirsh
.
$ sudo virsh net-start defaultIf you encounter the following error, go to the next solution.
internal error: Network is already in use by interface virbr0
Solution Two
Identify the name of the bridge associated with thedefault
network. You can find out the bridge name in the default network template (/etc/libvirt/qemu/networks/default.xml
). In most cases, the bridge name is virbr0
.
Remove that bridge as follows.
$ sudo ifconfig virbr0 down $ sudo brctl delbr virbr0Now start the
default
network using virsh
command.
$ sudo virsh net-start defaultThis will automatically re-create the
virbr0
bridge.
Verify the state of the default network.
$ sudo virsh net-list --all