Trying to decide apt vs snap for installing lxd


(Phil Howard) #1

i have noted there are a few apt/deb packages with “lxd” in their names, so i have been trying to decide what to install. with snap, are there a bunch of packages to install? if so, is there a way to get a list of files that each snap installs (before installing them)?

i have looked over the apt/deb packages and separated the false-positives (such as lxde stuff) from true-positives. it looks like the packages i need to install are lxd, lxd-client, and lxd-tools. these names are links to a list of files to be installed by that package. there were 5 packages with “lxd” in their names that appear to be for Python (one for Python3). i would install the Python related packages later, when i am ready to do some development.

does anyone have a specific reason i should not install particular packages or specific reasons to install other packages?

how about snaps? how would those compare to apt/deb packages for lxd? do they only install in the snap directories, or do some files get installed in other places? it is the latter of these that i want to get a list of what is installed although i would prefer a totally completed list. i use these lists to categorize backups.

once i have containers running, i am tempted to put together something that can do before and after scans around package installation although they would include automatically installed dependencies (maybe a useful thing).


#2

As for apt/deb packages, I think you only need “lxd” and “lxd-client”. I haven’t had a need for the tools provided in “lxd-tools”.

That said, I would recommend to go with the snap, as AFAIU the currently available deb packages (for 3.0 LTS) are the last ones that will be provided (except for updates within the current LTS branch). So in the future LXD will be available only as snap, so better get used to it already. Also, the deb packages only work on Ubuntu, while the snap also works on Debian (and maybe others, haven’t tried). As for your questions regarding the snap, there’s only one snap package to install, and all its files go to /snap/lxd/<version>.

That said, the snap doesn’t integrate into the system as cleanly as the deb, e.g. if you use LVM for storing container images, the system lvm tools may not be aware of changes made by the lxd tools (as these use their own lvm stack). But that’s merely cosmetic (lvscan --cache fixes it).


#3

The deb package lxd-tools includes the tools

  1. /usr/bin/fuidshift, shifting user IDs, handy tool in very specific cases
  2. /usr/bin/lxc-to-lxd, converts a LXC container into a LXD container
  3. /usr/bin/lxd-benchmark, a benchmarking tool.

source: https://packages.ubuntu.com/bionic/amd64/lxd-tools/filelist

To install LXD from the Deb packages, you indeed need to install lxd and lxd-client. The rest of the requirements will be pulled in automatically.

Alternatively, if you want to try with the snap package, you install the lxd snap. All binaries for the lxd snap can be found in /snap/bin/ and it’s the lxd and lxc* executables.

If you install the LXD deb package and then install the snap package, you need to run lxd.migrate to migrate from the LXD deb package to the snap package of LXD. You can migrate from Deb towards Snap, but not the other way round (probably you can, but you have to do this on your own. But most importantly, the snap LXD is too far ahead in features that is not backwards compatible with the deb package.)

Do I recommend the Deb package or the Snap package for you? Both work fine, and the somewhat interesting difference is that the Snap package for LXD has much more features because it is updated every few months.

I would recommend that you try the Deb package first, and if you need, you can upgrade to the Snap package. You may find my LXD tutorials useful. There is a reference there for an online LXD course, which you can take for free (using the trial period). The learning material is there, it’s up to you to take the plunge and start using LXD.


(Phil Howard) #4

i’m going to try both installs first in manual (chroot, mostly, but apt tools have been OK with it) containers to compare what i get and learn more of snap. it has some ideas i like. then i will do a host install before actually using lxd. i did install lxd before, in chroot, using apt, but i have since torn down those chroots (they used a very large image).