snappy and lxd on WSL 2

Just some quick notes on making these work:


If you are using genie to run WSL2-with-systemd and have recompiled your kernel with squashfs, apparmor, etc. support, as I’ve covered in the past, snappy will just work.

Note that you will need to be using the just-released-yesterday version 1.2-fix or higher of genie, since the egid bug in previous versions prevented snapd from installing snaps correctly.


Once you have snappy up and running, you can install the lxd snap with

sudo snap install lxd

as per normal. However, while you can go ahead and

lxd init

without difficulty, and indeed create a container, there is currently a problem with launching containers; sysfs will not mount automagically in the right spot. To get around this, you must create the mount point and mount sysfs on it yourself before launching the container.

Simos Xenitellis explains the way to do this on Ubuntu in this post (scroll down to near the bottom of “Configuring LXD on WSL 2”, and note that the other steps are not necessary since we have systemd and snappy running, and networking likewise); on Debian buster, I was able to do it thus:

sudo mkdir /var/snap/lxd/common/lxc//sys
sudo mount sysfs -t sysfs /var/snap/lxd/common/lxc//sys

Other distributions may vary. The correct path for the mount point can be found by attempting to start a container, then running

lxc info --show-log <containername>

and looking for the mount error.

Have fun with them!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s