Gonéri's blog Light modeDark mode


Run Virt-Lightning on CoreOS

Virt-Lightning is my pet-project to quickly start Cloud VMs on a Libvirt Hypervisor and these are some notes I took to run it on Fedora CoreOS.

First, you need to install libvirt and uv:

sudo bootc usr-overlay
sudo dnf install -y uv libvirt-devel gcc python3-devel qemu-kvm qemu-img libvirt mkisofs
sudo systemctl restart polkit.service
sudo systemctl enable --now libvirtd
sudo usermod --append --groups libvirt core

By default, CoreOS is an immutable Operating System. bootc usr-overlay enables write operations, but they will be lost after the next reboot.

Then, create the image directory:

sudo mkdir -p /var/lib/virt-lightning/pool/upstream
sudo chown -R qemu:qemu /var/lib/virt-lightning/pool
sudo chown -R core /var/lib/virt-lightning/pool/upstream
sudo chmod 775 /var/lib/virt-lightning
sudo chmod 775 /var/lib/virt-lightning/pool /var/lib/virt-lightning/pool/upstream

And you're good to go, you can deploy a VM with just one command:

uvx virt-lightning start fedora-43 --memory 2048

Or if you're adventurous, you can try the Git version:

uvx --from git+https://github.com/virt-lightning/virt-lightning vl start fedora-43 --memory 2048