Is it possible to set up multiple versions of lxd at once?

If I have lxd setup using snapd can I install lxd from source packages without creating one big mess? Or how can I migrate from lxd on snap to lxd from packages?

You can run both on your system but you have to be careful with what binaries you run.
/snap/bin/lxc will talk to the snap version of LXD, /usr/bin/lxc will talk to the packaged version of LXD.

I’d strongly recommend using the full paths for both commands until you’re back to having just one version of LXD installed.

As for moving containers from the snap to the deb, your best bet would be to configure both LXD instances to listen to the network on different port, then use lxc move to transfer containers as you would between two separate machines.

Do however note that starting with Ubuntu 18.10, the LXD deb is going away. So if you stick to LTS releases, you’ll be good until Ubuntu 20.04 LTS but if you upgrade to non-LTS releases, you’ll find yourself back with the snap in Ubuntu 18.10.

That last part is assuming that you’re an Ubuntu user, ignore it if you’re on another distro.

1 Like