[lxc-users] Workaround for "/var/lib/lxd/unix.socket: connect: permission denied" after installing lxd

Dan Kegel dank at kegel.com
Sat Apr 30 15:56:34 UTC 2016


On Ubuntu 16.04, if you see this:
$ sudo apt install lxd
$ lxc info    (or any lxc command)
error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket:
connect: permission denied

a workaround that works for me is
 $ sudo systemctl restart lxd.socket

I filed https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1577001 for
this just now.
It's some odd packaging / systemd problem.

The lxd maintainers could probably work around it by adding a chown
root:lxd after the call to deb-systemd-helper enable lxd.service in
postinst if they wanted to be hacky.

This may have been part of the reason I kept trying to run lxc as root.
(Besides old habits from, um, lxc days, when even 'lxc-ls -f' had to
be run as root.)


More information about the lxc-users mailing list