LXD 4.0 installation broke newtorking (fixed via host reboot)

Hey Everybody-

When snap rolled lxd to 4.0 earlier today (stable), all of my containers lost their ip addresses. I couldn’t get any container to regain an ip, setting an ip didn’t work, rebooting the container, creating a new container- All of these failed. lxc list showed all containers just didnt have ips!

Rebooting the host restored my setup. Hoping this post will help another admin figure out the solution!

The usual culprit there is another DHCP/DNS server running on the host which races with LXD. On a normal boot, LXD starts first and everything works but upon a restart, it doesn’t work and LXD’s dnsmasq instance fails to start.

The logs in /var/snap/lxd/common/lxd/logs should have something about that and if that’s indeed the issue, look for something like bind9/named or dnsmasq on your host system, listening on port 53 or 67 (netstat -lnp).

It’s fine to have those services but they should be listening only to individual addresses/interfaces and not be listening on wildcard addresses as that breaks LXD’s own DHCP/DNS server.