LXD Failing to Start

LXD fails to start with the following error in syslog:-

May 3 08:15:02 sentauri systemd[1]: Starting LXD - network bridge…
May 3 08:15:02 sentauri systemd-udevd[8503]: Could not generate persistent MAC address for lxdbr1: No such file or directory
May 3 08:15:02 sentauri lxd-bridge.start[8495]: dnsmasq: failed to create listening socket for 10.54.165.1: Address already in use
May 3 08:15:02 sentauri dnsmasq[8541]: failed to create listening socket for 10.54.165.1: Address already in use
May 3 08:15:02 sentauri dnsmasq[8541]: FAILED to start up
May 3 08:15:02 sentauri lxd-bridge.start[8495]: Failed to setup lxd-bridge.
May 3 08:15:02 sentauri systemd[1]: lxd-bridge.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 3 08:15:02 sentauri systemd[1]: Failed to start LXD - network bridge.
May 3 08:15:02 sentauri systemd[1]: Dependency failed for LXD - main daemon.
May 3 08:15:02 sentauri systemd[1]: lxd.service: Job lxd.service/start failed with result ‘dependency’.
May 3 08:15:02 sentauri systemd[1]: lxd-bridge.service: Unit entered failed state.
May 3 08:15:02 sentauri systemd[1]: lxd-bridge.service: Failed with result ‘exit-code’.

I tried to purge the LXD package, re-install it and change the bridge name from the default with no luck.
I tried running lxd init, it completes the stage without any issues.
I also tried dpkg-reconfigure lxd and it also completes without any issues.

Not sure what more I can try?

I can see lxdbr1 (while the default is lxdbr0), “address already in use” and so on.
This means that there are remnants of the old LXD installation still running, and does not allow the new installation to work properly.

Have a look at my post,

I am looking forward to any feedback on what exactly was your specific issue (and perhaps update the post, if needed!)

Actually, this tends to be because you’re running another DNS server on the machine.

Check that you don’t have named/bind9 installed or a system-wide dnsmasq daemon running.

The error usually means that something else is binding port udp/53 on all interfaces, preventing LXD’s own dnsmasq instance to bind the LXD bridge’s address.

thanks simos, stgraber

i had dnsmasq running on the machine - probably from a previous test and I didn’t notice it. Removed/purged dnsmasq and ran dpkg-reconfigure lxd with success.

thanks again, gabriel

can anyone help me resolving this issue?
while creating LXD container i’m facing this error:

LXD doesn’t have a uid/gid allocation. In this mode, only privileged containeERROR failed to bootstrap model: cannot start bootstrap instance: LXD doesn’t have a uid/gid allocation. In this mode, only privileged containers are supported.

help me plz.
thank you

Hi Munir!

The error you get is different from the error at the original post.
Please start a new thread with a title similar to something like Error: LXD doesn’t have a uid/gid allocation.

In this thread, add

  1. the name/version of your Linux distribution
  2. whether you use the deb package of LXD or the snap package of LXD
  3. the output of the commands lxd --version and lxc --version.

and we will take it from there.

(I noticed that you also sent me a message through my blog. The error you got is rather unique, therefore it would be interesting to figure out here so others can benefit in the future).

LXD doesn't have a uid/gid allocation can usually be explained by one of:

  • You’re running a kernel without user namespace support
  • You’re not using the LXD snap and you haven’t configured /etc/subuid and /etc/subgid
  • The content of /etc/subuid and /etc/subgid is inconsistent

thank you simos for your response,
i’m beginner at this, would you please elaborate it, i’ve checked the version of my linux distribution.
i’m using snap package of LXD.
LXD and LXC versions are 3.0.1
i need to add these to the file subgid,subuid?? if not then kindly tell me what to do next?
i changed the files subgid,subuid using
$ sudo nano subgids
the contents are changed to root:100000:65535
this still didn’t resolve my issue.
loking forward to your positive response.

what should i do to update the content of /etc/subgid & /etc/subuid??
secondly kindly elaborate: kernel without user namespace support.

thank you for your response sir.

  1. What is the name and version of your Linux distribution? Is it, for example, Ubuntu 18.04?
  2. Currently, the snap package of LXD is at version 3.0.2. The deb package in Ubuntu 18.04 is at version 3.0.1. Give us the output of the following commands:
    lxd version
    lxc version
    which lxd
    which lxc
  3. What is the version of your Linux kernel? Run the command uname -a and post the result below.