I haven't run any VMs for a while (~8 weeks), but I tried to create a new VM today (22.04 and 24.04, on Cockpit) and got this error message:
ERROR Requested operation is not valid: network 'default' is not active
Domain installation does not appear to have been successful.
I can run existing VMs; I just can't create new ones. The libvirt default network should autostart, but doesn't, and can't be started:
# virsh net-list --all
Name State Autostart Persistent
----------------------------------------------
default inactive yes yes
virsh net-start default
error: Failed to start network default
error: internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2:
dnsmasq: failed to create listening socket for 192.168.122.1: Address already in use
I can find various hits for this failure, but only if dnsmasq is also running. It's installed on this system, but there's no service for it, and it's not running (except when run by virsh):
# systemctl status dnsmasq
Unit dnsmasq.service could not be found.
# lsof | grep dnsmasq
#
systemd-resolved is running, but stopping the service makes no difference.
And:
netstat -tulpnshows nothing on 192.168.122lsof -i -P -nshows nothing on 192.168.122
Any ideas? I'm on 22.04.5. The are syslog entries showing the failure message on start-up going back to at least 2024-12-22, but there are no obvious entries in the dpkg logs showing anything that was installed or upgraded at about that time. Thanks.
EDIT
Weird. I normally install and control VMs from Cockpit. I just installed virt-manager to test VM creation 'manually'. Cockpit doesn't give you a choice of network interfaces, but virt-manager gives 3. If you select the default virtual network you get the problem above, and the install fails. If you instead select a bridge, and enter bridge0, installation succeeds.
With Cockpit, I end up with a VM which only has a network connection to the host (the 'virtual network'), and I then modify the network settings to select bridge0 to allow external access. IOW, virt-manager avoids the problem, because I need a bridge anyway, but it would still be nice to find out what's gone wrong here.