How to run a Windows virtual machine on LXD on Linux

This tutorial is a summary of the instructions to run Windows in a LXD VM, as found at Running virtual machines with LXD 4.0

In a nutshell, the instructions are:

sudo snap install distrobuilder --classic --edge
sudo distrobuilder repack-windows Win10_1809Oct_English_x64.iso Win10_1809Oct_English_x64-distrobuilder.iso
lxc init win10 --empty --vm -c security.secureboot=false
lxc config device override win10 root size=30GiB
lxc config device add win10 iso disk source=/home/myusername/Downloads/Win10_1809Oct_English_x64-distrobuilder.iso boot.priority=10
lxc start win10 --console=vga
lxc console win10 --type=vga
2 Likes