From 054e542c54743c2ed119f18a371858e79be22afe Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 27 Sep 2025 16:46:12 +0100 Subject: [PATCH] vmspawn: enable qemu guest agent with --console=gui For auto resolution scaling, etc --- src/vmspawn/vmspawn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 6ea203752e..f471e1bde5 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -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: