VM starting on host boot

I have a fresh install of EOS-Plasma on an Intel based 11th gen NUC. I create a network bridge using nmcli and that way I can create my VMs all on my home network subnet.

I created a VM of Ubuntu 20.04 server as a test and once it was working where I could ssh into it I checked the Virt-manager box under boot options for “Start virtual machine on host boot up”. However, it does not work. When EOS boots up Virt manager show it shutdown. Not sure how to fix it.

To collect more data I tested this on a Linux Mint 21.1 host and it works there. Also I tried it on a Debian 12 RC2 host and it behaves just like on EOS.

Any guesses on where to look?

Okay, making some progress. I found that using the command virsh autostart "vmName" has the same negative effect.

I check the logs and found this related to libvirtd.service

 den-pc libvirtd[580]: Cannot get interface MTU on 'br0': No such device
 den-pc libvirtd[580]: ethtool ioctl error on vnet0: No such device
 den-pc libvirtd[580]: internal error: Failed to autostart VM 'ubuntu20.04': Cannot get interface MTU on 'br0': No such device
 den-pc libvirtd[580]: ethtool ioctl error on vnet0: No such device

So it doesn’t connect with my br0 bridge that is setup. If I start the VM with virt-manager it works fine and using br0.

It looks like maybe you aren’t bringing up the network but are allowing virt-manager to start it on demand.

I was thinking that it could be a race condition. libvirtd.service is trying to start up the VM’s marked for autostart before NetworkManager has gotten the br0 setup?

Maybe need some systemd “wait for” statement in libvirtd to delay it until the network is up

Here are all the “Afters” in the systemd service.

After=network.target
After=firewalld.service
After=iptables.service
After=ip6tables.service
After=dbus.service
After=iscsid.service
After=apparmor.service
After=local-fs.target
After=remote-fs.target
After=systemd-logind.service
After=systemd-machined.service
After=xencommons.service

Maybe needs one related to NetworkManager

Not sure if this is the proper solution, but it works. I fear that I could just be on the lucky side a race condition.

If I reference this article: EOS KVM installation

It has a section that talked about setting the default network which I’ll not be using. I didn’t do this originally, but when I did the autostart VMs came up at host boot.

sudo virsh net-autostart default

Once I ran this command, the autostart VMs booted at host boot even though none of them use the default NAT NIC. All mine use br0