What are the goals for compatibility between LXD and incus? This will affect migrating from one to another.
I read here that incus is to have compatibility with LXD 5.16. But LXD is already at version 5.17.
Below I ask some compatibility questions and record what I’ve found by trying incus.
Images
I found that I can export images from LXD and import them to Incus, using commands like these:
- lxc image export
- incus image import .tar.gz
I assume it works in the other direction too, but I haven’t tried it. I hope images stay compatible for a long time.
Can we strive for a standard format for images that both LXD and Incus can be compatible with?
Image Servers
Can we add an LXD image server to an incus client configuration, or vice versa?
The default lxd and incus installations both include the simplestreams remote “images”,
and this server works with both LXD and Incus.
However, when I add add the “ubuntu” remote to incus, incus does not see any images in it.
API
Would I be able to build an executable with Go that works with both LXD and Incus?
I found that my existing programs that are compiled with the canonical LXD codebase mostly work with an incus server, and vice versa, provided I change the path for the UNIX socket to the correct one. I changed my code to try either the snap LXD socket or the incus socket, whichever exists.
But I encountered one operation that does not work properly, in either direction: When using InstanceServer.CreateInstanceFile(), InstanceFileArgs.Mode is ignored. Because of this one small problem, I cannot configure my incus containers with the same LXD-developed tools. I have to make changes and recompile incus-specific versions. From all the compatibility issues that I encountered, this is causing me the most trouble. Shall I report this as a bug?
command line
Can I run “lxc” commands with incus? It seems that the two clients have not diverged much yet, so I can add a link to incus called “lxc”:
sudo ln -s /usr/bin/incus /usr/local/bin/lxc
and my existing scripts will work with both LXD and incus.
miscellaneous
- LXD uses group “lxd”, incus uses groups “incus”, “incus-admin”
- LXD uses the default network lxdbr0, but incus uses incusbr0. This can be made compatible by naming the network bridge “lxdbr0” when running incus admin init.
- LXD uses .lxd domain suffix for containers, incus uses .incus by default. They can be made the same using the command: incus network set lxdbr0 dns.domain lxd
- LXD uses /var/snap/lxd/common/lxd/unix.socket. Incus uses /var/lib/incus/unix.socket.
- LXD client uses ~/snap/lxd/common/config/ Incus client uses ~/.config/incus/