From: Luca Boccassi Date: Mon, 1 Jun 2026 17:44:52 +0000 (+0100) Subject: vmspawn: enforce minimum uptime with --console=gui X-Git-Tag: v261-rc3~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b811fa5b325061bf492b11332a9ce512f9b8d0c5;p=thirdparty%2Fsystemd.git vmspawn: enforce minimum uptime with --console=gui When using --console=gui the QEMU window closes immediately when the VM has stopped, so any console output at shutdown is lost, which makes debugging difficult. Ensure the VM stays booted for a minimum of 15s. --- diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 015d35023f6..f7cbb9c72d0 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -3049,6 +3049,13 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { if (r < 0) return r; + /* When using --console=gui the QEMU window closes immediately when the VM has stopped, so + * any console output at shutdown is lost, which makes debugging difficult. Ensure the VM + * stays booted for a minimum of 15s. */ + r = strv_prepend(&arg_kernel_cmdline_extra, "systemd.minimum_uptime_sec=15"); + if (r < 0) + return log_oom(); + break; case CONSOLE_HEADLESS: