LXD (V3) Snap - Fresh Install - "LXD socket not found; is LXD installed and running?"

System

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
lxd --version
3.0.0

Init Parameters

$ sudo lxd init
Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]: dir 
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: auto
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like LXD to be available over the network? (yes/no) [default=no]: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] 
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: 

Behaviour

None of my LXD/LXC commands will run. They result in:

lxc list
LXD socket not found; is LXD installed and running?

Double checking Config

cat /etc/group | grep lxd
lxd:x:110:dustin

Running processes

dustin@lxd:~$ ps aux | grep lxd
root      1166  0.2  0.0   4504  1604 ?        Ss   12:27   0:00 /bin/sh /snap/lxd/6862/commands/daemon.start
root      1448  0.0  0.0  95384  1396 ?        Sl   12:27   0:00 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/lxcfs.pid
root      1456  0.8  0.7 787164 30280 ?        Sl   12:27   0:01 lxd --logfile /var/snap/lxd/common/lxd/logs/lxd.log --group lxd
dustin    1702  0.0  0.0  14224  1084 pts/0    S+   12:29   0:00 grep --color=auto lxd

The daemon.start script looks odd to me. I would imagine that would go away once it started

Services

$ journalctl -u snap.lxd.daemon
-- Logs begin at Mon 2018-04-30 12:27:12 PDT, end at Mon 2018-04-30 12:36:15 PDT. --
Apr 30 12:27:19 lxd systemd[1]: Started Service for snap application lxd.daemon.
Apr 30 12:27:20 lxd lxd.daemon[1166]: => Preparing the system
Apr 30 12:27:20 lxd lxd.daemon[1166]: ==> Loading snap configuration
Apr 30 12:27:20 lxd lxd.daemon[1166]: ==> Setting up mntns symlink
Apr 30 12:27:20 lxd lxd.daemon[1166]: ==> Setting up kmod wrapper
Apr 30 12:27:20 lxd lxd.daemon[1166]: ==> Preparing /boot
Apr 30 12:27:20 lxd lxd.daemon[1166]: ==> Preparing a clean copy of /run
Apr 30 12:27:20 lxd lxd.daemon[1166]: ==> Preparing a clean copy of /etc
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Setting up ceph configuration
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Setting up LVM configuration
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Rotating logs
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Setting up ZFS (0.6)
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Escaping the systemd cgroups
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Escaping the systemd process resource limit
Apr 30 12:27:22 lxd lxd.daemon[1166]: ==> Increasing the number of inotify user insta
Apr 30 12:27:22 lxd lxd.daemon[1166]: => Starting LXCFS
Apr 30 12:27:22 lxd lxd.daemon[1166]: => Starting LXD
Apr 30 12:27:23 lxd lxd.daemon[1166]: mount namespace: 5
Apr 30 12:27:23 lxd lxd.daemon[1166]: hierarchies:
Apr 30 12:27:23 lxd lxd.daemon[1166]:   0: fd:   6: freezer
Apr 30 12:27:23 lxd lxd.daemon[1166]:   1: fd:   7: pids
Apr 30 12:27:23 lxd lxd.daemon[1166]:   2: fd:   8: perf_event
Apr 30 12:27:23 lxd lxd.daemon[1166]:   3: fd:   9: net_cls,net_prio
Apr 30 12:27:23 lxd lxd.daemon[1166]:   4: fd:  10: devices
Apr 30 12:27:23 lxd lxd.daemon[1166]:   5: fd:  11: memory
Apr 30 12:27:23 lxd lxd.daemon[1166]:   6: fd:  12: cpuset
Apr 30 12:27:23 lxd lxd.daemon[1166]:   7: fd:  13: blkio
Apr 30 12:27:23 lxd lxd.daemon[1166]:   8: fd:  14: cpu,cpuacct
Apr 30 12:27:23 lxd lxd.daemon[1166]:   9: fd:  15: hugetlb
Apr 30 12:27:23 lxd lxd.daemon[1166]:  10: fd:  16: name=systemd
Apr 30 12:27:24 lxd lxd.daemon[1166]: lvl=warn msg="CGroup memory swap accounting is 
Apr 30 12:27:24 lxd lxd.daemon[1166]: => LXD is ready

looks ok…

$ sudo systemctl status snap.lxd.daemon
● snap.lxd.daemon.service - Service for snap application lxd.daemon
   Loaded: loaded (/etc/systemd/system/snap.lxd.daemon.service; enabled; vendor prese
   Active: active (running) since Mon 2018-04-30 12:27:19 PDT; 9min ago
 Main PID: 1166 (daemon.start)
    Tasks: 0
   Memory: 41.0M
      CPU: 1.411s
   CGroup: /system.slice/snap.lxd.daemon.service
           ‣ 1166 /bin/sh /snap/lxd/6862/commands/daemon.start

Apr 30 12:27:23 lxd lxd.daemon[1166]:   3: fd:   9: net_cls,net_prio
Apr 30 12:27:23 lxd lxd.daemon[1166]:   4: fd:  10: devices
Apr 30 12:27:23 lxd lxd.daemon[1166]:   5: fd:  11: memory
Apr 30 12:27:23 lxd lxd.daemon[1166]:   6: fd:  12: cpuset
Apr 30 12:27:23 lxd lxd.daemon[1166]:   7: fd:  13: blkio
Apr 30 12:27:23 lxd lxd.daemon[1166]:   8: fd:  14: cpu,cpuacct
Apr 30 12:27:23 lxd lxd.daemon[1166]:   9: fd:  15: hugetlb
Apr 30 12:27:23 lxd lxd.daemon[1166]:  10: fd:  16: name=systemd
Apr 30 12:27:24 lxd lxd.daemon[1166]: lvl=warn msg="CGroup memory swap accounting is 
Apr 30 12:27:24 lxd lxd.daemon[1166]: => LXD is ready

Looks like it is up…

$ sudo cat /var/snap/lxd/common/lxd/logs/lxd.log 
lvl=info msg="LXD 3.0.0 is starting in normal mode" path=/var/snap/lxd/common/lxd t=2018-04-30T19:27:24+0000
lvl=info msg="Kernel uid/gid map:" t=2018-04-30T19:27:24+0000
lvl=info msg=" - u 0 0 4294967295" t=2018-04-30T19:27:24+0000
lvl=info msg=" - g 0 0 4294967295" t=2018-04-30T19:27:24+0000
lvl=info msg="Configured LXD uid/gid map:" t=2018-04-30T19:27:24+0000
lvl=info msg=" - u 0 1000000 1000000000" t=2018-04-30T19:27:24+0000
lvl=info msg=" - g 0 1000000 1000000000" t=2018-04-30T19:27:24+0000
lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2018-04-30T19:27:24+0000
lvl=info msg="Initializing local database" t=2018-04-30T19:27:24+0000
lvl=info msg="Initializing database gateway" t=2018-04-30T19:27:24+0000
address= id=1 lvl=info msg="Start database node" t=2018-04-30T19:27:24+0000
lvl=info msg="Raft: Initial configuration (index=1): [{Suffrage:Voter ID:1 Address:0}]" t=2018-04-30T19:27:24+0000
lvl=info msg="Raft: Node at 0 [Leader] entering Leader state" t=2018-04-30T19:27:24+0000
lvl=info msg="LXD isn't socket activated" t=2018-04-30T19:27:24+0000
lvl=info msg="Starting /dev/lxd handler:" t=2018-04-30T19:27:24+0000
lvl=info msg=" - binding devlxd socket" socket=/var/snap/lxd/common/lxd/devlxd/sock t=2018-04-30T19:27:24+0000
lvl=info msg="REST API daemon:" t=2018-04-30T19:27:24+0000
lvl=info msg=" - binding Unix socket" socket=/var/snap/lxd/common/lxd/unix.socket t=2018-04-30T19:27:24+0000
lvl=info msg="Initializing global database" t=2018-04-30T19:27:24+0000
lvl=info msg="Initializing storage pools" t=2018-04-30T19:27:24+0000
lvl=info msg="Initializing networks" t=2018-04-30T19:27:24+0000
lvl=info msg="Loading configuration" t=2018-04-30T19:27:24+0000
lvl=info msg="Pruning expired images" t=2018-04-30T19:27:24+0000
lvl=info msg="Done pruning expired images" t=2018-04-30T19:27:24+0000
lvl=info msg="Updating instance types" t=2018-04-30T19:27:24+0000
lvl=info msg="Expiring log files" t=2018-04-30T19:27:24+0000
lvl=info msg="Updating images" t=2018-04-30T19:27:24+0000
lvl=info msg="Done updating images" t=2018-04-30T19:27:24+0000
lvl=info msg="Done expiring log files" t=2018-04-30T19:27:24+0000
lvl=info msg="Done updating instance types" t=2018-04-30T19:27:28+0000

Is the line with lvl=info msg="LXD isn't socket activated" t=2018-04-30T19:27:24+0000 anythign to worry about?

I must be missing something. :slight_smile:

what is the result of dpkg -l | grep -E 'lxd|lxc' ? You might be using the lxc binary from dpkg and not the one from the snap, you might want to remove those and try again.

1 Like

Sorry, should have mentioned… this is the snap, not the deb package.

$ which snap
/usr/bin/snap

But in case I am missing something, here is the output:


dpkg -l | grep -E 'lxd|lxc' 
ii  liblxc1                             2.0.8-0ubuntu1~16.04.2                     amd64        Linux Containers userspace tools (library)
ii  lxc-common                          2.0.8-0ubuntu1~16.04.2                     amd64        Linux Containers userspace tools (common tools)
ii  lxcfs                               2.0.8-0ubuntu1~16.04.2                     amd64        FUSE based filesystem for LXC
ii  lxd-client                          2.0.11-0ubuntu1~16.04.4                    amd64        Container hypervisor based on LXC - client

so indeed you still have the lxc and lxd packages installed, you can sudo apt remove liblxc1 lxc-common lxcfs lxd-client and you should be able to use lxd from snap with the lxc command

1 Like

gah! I thought I had cleaned up everything when I had done sudo apt remove --purge lxd.

Thank you so much for clearing that up!

I had removed the deb version to move over to the snap version and stay up to date in the 3.x series.