Running LXD/LXC on WSL2 with Ubuntu 20.04


Download Ubuntu 20.04 from the Microsoft Store

sudo apt-get update
sudo apt-get upgrade

cd ~
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
sudo apt-get install snap
(exit the shell and reopen it)
Source: https://github.com/damionGans/ubuntu-wsl2-systemd-script

To the IPv6 question I answer "none".

$ sudo lxd init

2020/08/01 15:55:13 usbid: failed to load: open /usr/share/misc/usb.ids: no such file or directory
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (ceph, btrfs, dir, lvm) [default=btrfs]:
Create a new BTRFS pool? (yes/no) [default=yes]:
Would you like to use an existing block device? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=50GB]:
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like LXD to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

To fix some potential errors
sudo usermod -aG lxd $USER
sudo chown -R lxd:lxd /var/snap/lxd/common/lxd/unix.socket

Start first container:
$ sudo lxc launch ubuntu:20.04

Comments

Popular posts from this blog

Installing pikvm on raspberry pi zero 2 w

Ruby weirdness