mkosi vm hangs where the host has no systemd, such as in a dev container. The Containerfile runs systemd as init with mkosi and qemu, so mkosi -f vm works through podman exec. Tested: builds and boots to the login in about 105 seconds, of which booting takes about 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
540 B
Docker
12 lines
540 B
Docker
# mkosi container
|
|
#
|
|
# Builds and boots a test VM where the host has no systemd, such as a dev
|
|
# container (README.md). mkosi vm needs systemd to run qemu in a scope, so
|
|
# systemd runs as init here and mkosi runs through podman exec.
|
|
FROM registry.fedoraproject.org/fedora:45
|
|
RUN dnf install -y --setopt=install_weak_deps=False mkosi dbus-broker \
|
|
qemu-kvm-core edk2-ovmf /usr/bin/systemd-repart openssh-clients && \
|
|
dnf install -y --setopt=install_weak_deps=False $(mkosi dependencies) && \
|
|
dnf clean all
|
|
CMD ["/sbin/init"]
|