From ee2812da8fedb5d2d0205dd866fc7761202cd46d Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 7 Dec 2020 23:00:37 +0000 Subject: [PATCH] mkosi: Enable --qemu-headless option for all distros --qemu-headless configures the generated image and mkosi's qemu command to connect to the VM via the serial port. This allows spawning a qemu VM within the user's terminal instead of spawning a graphical GTK GUI. --qemu-headless sets TERM, COLUMNS and LINES in serial-getty@ttyS0.service in the container which makes the terminal in the VM behave almost equivalent to the one on the host. This change makes testing changes to systemd using mkosi + QEMU a lot easier compared to before as commands can be executed in the VM from the comfort of one's terminal compared to the Linux console available when running via the GTK GUI. --- .mkosi/mkosi.arch | 3 +++ .mkosi/mkosi.debian | 3 +++ .mkosi/mkosi.fedora | 3 +++ .mkosi/mkosi.opensuse | 3 +++ .mkosi/mkosi.ubuntu | 3 +++ 5 files changed, 15 insertions(+) diff --git a/.mkosi/mkosi.arch b/.mkosi/mkosi.arch index c50ee4923c..b99cf8bc9b 100644 --- a/.mkosi/mkosi.arch +++ b/.mkosi/mkosi.arch @@ -56,3 +56,6 @@ BuildPackages= Packages= libidn2 qrencode + +[Host] +QemuHeadless=yes diff --git a/.mkosi/mkosi.debian b/.mkosi/mkosi.debian index ba9077eaa2..da6a30a711 100644 --- a/.mkosi/mkosi.debian +++ b/.mkosi/mkosi.debian @@ -65,3 +65,6 @@ Packages= libqrencode4 locales libidn2-0 + +[Host] +QemuHeadless=yes diff --git a/.mkosi/mkosi.fedora b/.mkosi/mkosi.fedora index a3e68acdfa..f9750b994a 100644 --- a/.mkosi/mkosi.fedora +++ b/.mkosi/mkosi.fedora @@ -80,3 +80,6 @@ Packages= BuildDirectory=mkosi.builddir Cache=mkosi.cache + +[Host] +QemuHeadless=yes diff --git a/.mkosi/mkosi.opensuse b/.mkosi/mkosi.opensuse index 9f3abbc74b..96dbedead4 100644 --- a/.mkosi/mkosi.opensuse +++ b/.mkosi/mkosi.opensuse @@ -76,3 +76,6 @@ Packages= libseccomp2 pam util-linux + +[Host] +QemuHeadless=yes diff --git a/.mkosi/mkosi.ubuntu b/.mkosi/mkosi.ubuntu index ff81536956..08d0c49d90 100644 --- a/.mkosi/mkosi.ubuntu +++ b/.mkosi/mkosi.ubuntu @@ -69,3 +69,6 @@ Packages= libqrencode4 locales libidn2-0 + +[Host] +QemuHeadless=yes