2

When I use lxd, it fails on lxd init .

$ snap install lxd
lxd 3.0.0 from 'canonical' installed
$ lxd init
Error: Failed to connect to local LXD: Get http://unix.socket/1.0: dial unix 
/var/snap/lxd/common/lxd/unix.socket: connect: no such file or directory

I have the following on my computer:

$ snapcraft --version
snapcraft, version 2.42.1
$ uname -a
4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I don't know if this is relevant, but my computer uses Intel i7-7500U and has Secure Boot UEFI.

Below is output of more commands:

$ snap services lxd
Service     Startup  Current
lxd.daemon  enabled  active
$ snap logs lxd.daemon
2018-05-28T22:22:42Z lxd.daemon[1404]:   5: fd:  11: pids
2018-05-28T22:22:42Z lxd.daemon[1404]:   6: fd:  12: perf_event
2018-05-28T22:22:42Z lxd.daemon[1404]:   7: fd:  13: hugetlb
2018-05-28T22:22:42Z lxd.daemon[1404]:   8: fd:  14: cpu,cpuacct
2018-05-28T22:22:42Z lxd.daemon[1404]:   9: fd:  15: freezer
2018-05-28T22:22:42Z lxd.daemon[1404]:  10: fd:  16: net_cls,net_prio
2018-05-28T22:22:42Z lxd.daemon[1404]:  11: fd:  17: name=systemd
2018-05-28T22:22:42Z lxd.daemon[1404]: lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2018-05-28T22:22:42+0000
2018-05-28T22:22:42Z lxd.daemon[1404]: lvl=warn msg="Failed to update instance types: Get https://images.linuxcontainers.org/meta/instance-types/.yaml: lookup images.linuxcontainers.org on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address" t=2018-05-28T22:22:42+0000
2018-05-28T22:22:43Z lxd.daemon[1404]: => LXD is ready
$ lxd init
Error: Failed to connect to local LXD: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied

Does lxd snap requires ipv6? Can I force ipv4? Is something else wrong?

Edit:

$ groups myusername 
 myusername : myusername adm cdrom sudo dip plugdev lpadmin sambashare lxd 

I am a member of lxd group. but

$ groups 
 myusername adm cdrom sudo dip plugdev lpadmin sambashare 

has no lxd. What does it mean?

1

When you run the command lxd init and there is an error, you get a reason,

$ lxd init
Error: Failed to connect to local LXD: Get http://unix.socket/1.0: dial unix 
/var/snap/lxd/common/lxd/unix.socket: connect: THE_REASON
  1. Reason no such file or directory means that the LXD service did not start yet (may need to wait a bit or just manually start it).

  2. Reason permission denied means that your current account does not below to the group lxd, therefore is not permitted to access the socket /var/snap/lxd/common/lxd/unix.socket.

In this case, run groups to see whether your account is member of the lxd group. If you are member of the lxd group, then you need to log out and then log it. If you are not member of the lxd group, then run

$ sudo usermod --append --groups lxd myusername

and then log out and login again.

| improve this answer | |
  • $ groups myusername \n \n myusername : myusername adm cdrom sudo dip plugdev lpadmin sambashare lxd \n \n I am a member of lxd group. but \n \n $ groups \n myusername adm cdrom sudo dip plugdev lpadmin sambashare \n \n has no lxd. What does it mean? – eri0o May 30 '18 at 3:09
  • If you run groups myusername and groups, they must have identical output. Unless you are not logged in as use myusername. – Simos Jun 11 '18 at 12:02
0

Your group additions haven't applied. Log out and log back in to do so. But yes, looks like a permissions issue - lxd init needs to be run as sudo IIRC anyway

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.