Failed Getting LXD Working Under WSL2 Under Ubuntu 20.04 systemd & snap
I tried to get LXD running on WSL2, but couldn't make it work. Now I'm trying two things to make it work: installing the kernel headers and ZFS, and loading the module. I'll need to reload the module after each restart. Read my blog post to find out how this journey went!
My Journey to Get LXD Working Under WSL2: A Failed Attempt
By Michael Levin
Tuesday, June 14, 2022
Trying to get LXD working under WSL2
The prize is big;
On turf I’m first.
To crack this nut
I have a thirst.
The itch I scratch
Make no mistake’s
The bug you catch:
—Mike Levin, 2022
First Attempt Failed Despite Heroic Rabbit-Chasing Efforts
Play pied piper showing the way to fullscreen Linux Terminal goodness.
Ugh! The last livestream attempting to
sudo lxd init
Failed on 2 fronts:
- It did not present zfs as an option
The it did not result in anything listed when trying:
sudo lxd list
There were error messages and it seemed network-related, so I have 2 things I’m going to try:
More information on making zfs available as an option: https://stanislas.blog/2018/02/lxc-zfs-pool-lxd/
It suggests that you first install the kernel headers to allow us to compile and install kernel modules:
apt install linux-headers-$(uname -r)
It them suggests we install ZFS AND DKMS modules (old instructions didn’t have DKMS):
apt install zfs-dkms zfsutils-linux
Next is says we need to load the module:
And it also says that after every restart it needs to be reloaded, which we can do with this:
echo "zfs" >> /etc/modules