Skip to content

Instantly share code, notes, and snippets.

View COM8's full-sized avatar
🐛
Hunting bugs...

Fabian Sauter COM8

🐛
Hunting bugs...
View GitHub Profile
@COM8
COM8 / libvirt_in_podman.md
Created November 28, 2023 10:02
libvirt and qemu Inside a Podman Container

Creating and starting a VM from inside a container is really nice if for example you want to automatically test if you OS installs correctly inside a CI.

This example container image uses systemd inside podman to make this possible. It's based on the following tutorial: https://developers.redhat.com/blog/2019/04/24/how-to-run-systemd-in-a-container

Sadly this only works for podman and not for docker since podman auto-mounts all required paths if you set the container CMD to /sbin/init.

For this create the following two files:

.
├── Dockerfile