A bit of help with snap version

I am trying to switch from the packaged LXD version to the Snap version for the updates. Can someone point to a resource of give me a run down of what differences to expect.

So far, this is what I have run into…

  • have to manually create ‘lxd’ group and add user to it
  • have to manually set the ‘local’ remote as default
  • have to use a different unix socket (unix:/var/snap/lxd/common/lxd/unix.socket)

What other differences should I expect?

Which version of Ubuntu are you using?
Are you migrating from DEB to LXD (using sudo lxd.migrate to complete the migration) or are you installing the LXD snap package from scratch.

The first two items should not be an issue. You may have to re-login for the lxd group assignment to take place, or assign manually if you are using a non-standard non-root account.

If you have to set the local remote manually, then most likely you are still using the lxc client from the DEB package, not the SNAP package. You can identify which is which, by running which lxc.

The Unix socket is indeed different. There should be a way to get the new socket using an lxc command, if you need it in your scripts. In most cases, it should not be needed.

When you install a snap package, the system adds /snap/bin into your $PATH. If you use a non-standard shell or you have a hard-coded $PATH, then you do not get the updated $PATH. echo $PATH should show you the $PATH and you can see whether /snap/bin is in there.

I am trying this on a Mint 19 (Ubuntu 18.04) VM. It’s a brand new install, so no migration. The lxc client is from /snap/bin.

I have just tried again with a brand-new install. The $PATH does get updated by snap, and the lxd group is created, but other than that the first 2 points are still true for me. My sudo user is not added to the lxd group, the ~/.config/lxc/config.yml file is not created and while lxc remote list does show ‘local/ubuntu/ubuntu-daily’ (does not include ‘images’ like the root account, btw), local is not selected as default.

.config is in ~/snap/lxd/current/.config/
for example: ~/snap/lxd/current/.config/lxc/config.yml

The steps to install the snap LXD on ubuntu, if you are not already using LXD are:

apt-get remove lxd lxd-client
snap install lxd

I’m confused about this piece of information, I have to say.

Does that mean the snap package configuration is bound to some unprivileged - and potentially personal - system account? At least the processes appear to be running in the appropriate user context (lxd user on Ubuntu 18.04 with the snap package). But binding it to a personal account seems like a patently bad idea, given that this personal account may go away, while that’s not the intention for services originally created by it (like an LXD snap package installation).

~/snap/lxd/current/.config/ only has the per-user configuration.

The LXD installation files are in /snap/lxd/ and your LXD files are located under /var/snap/lxd/. The LXD configuration is here.