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