]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: enable qemu guest agent with --console=gui
authorLuca Boccassi <luca.boccassi@gmail.com>
Sat, 27 Sep 2025 15:46:12 +0000 (16:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 29 Sep 2025 08:53:14 +0000 (10:53 +0200)
For auto resolution scaling, etc

src/vmspawn/vmspawn.c

index 6ea203752ec8cb86e7b45816059be4a9bf509a68..f471e1bde52ab2bd58338970a1a5a7f42902a188 100644 (file)
@@ -2020,10 +2020,14 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
         }
 
         case CONSOLE_GUI:
+                /* Enable support for the qemu guest agent for clipboard sharing, resolution scaling, etc. */
                 r = strv_extend_many(
                                 &cmdline,
                                 "-vga",
-                                "virtio");
+                                "virtio",
+                                "-device", "virtio-serial",
+                                "-chardev", "spicevmc,id=vdagent,debug=0,name=vdagent",
+                                "-device", "virtserialport,chardev=vdagent,name=org.qemu.guest_agent.0");
                 break;
 
         case CONSOLE_NATIVE: