From debian-user Thu Jan 28 22:16:46 2021 From: Rainer Dorsch Date: Thu, 28 Jan 2021 22:16:46 +0000 To: debian-user Subject: Re: Screen scaling and 4k support in libvirt with qemu/kvm Message-Id: <2055630.IFJ5aJyRuY () h370> X-MARC-Message: https://marc.info/?l=debian-user&m=161187222908634 Am Mittwoch, 27. Januar 2021, 10:55:53 CET schrieb Linux-Fan: > Linux-Fan writes: > > Rainer Dorsch writes: > >> Hi, > >>=20 > >> with virtualbox, it is possible that the guest system rescales its scr= een > >> if I change the window for the guest (and virtualbox guest tools are > >> installed at > >> least). Does anybody know if that is possible with > >> virt-manager/libvirt/qemu/ kvm? > >=20 > > It is certainly possible to set the guest resolution to exactly match t= he > > window size. I am not sure if it can be configured to _automatically_ > > adjust the guest resolution upon window size change though. > >=20 > > The protocol must support it, because I know that for Windows guest > > systems, the Windows resolution adjusts to the window size. Unlike with > > Linux guests, it does this in fixed steps of "common" monitor resolutio= ns > > and thus does not usually match the exact window size but something > > smaller. > >=20 > > If you find out how to apply the sizes automatically on Linux, I'd be > > interested to learn how that works :) If no =E2=80=9Esolution=E2=80=9D = exists yet, it > > might > > be easy to script (although I have not bothered to do that so far). >=20 > Update: I found out how to enable automatic resizing: >=20 > * Install `qemu-guest-agent` in the VM in addition to running > `spice-vdagent` > * Set Video model to VGA >=20 > This enables automatic resizing here although from "feeling" the graphics > performance is worse than with QXL or virtio. Many thanks for the quick response again. I did not have spice-vdagent installed in the guest system. Installing spic= e- vdagent and switching from QXL to virtio was sufficient here. Interesting side effect: On the host system, I get rd@h370:~$ xrandr Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 8192 x 8192 HDMI-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y= =20 axis) 609mm x 349mm 3840x2160 30.00* 25.00 24.00 29.97 23.98 =20 2560x1440 59.95 =20 2048x1280 59.99 =20 2048x1080 24.00 =20 1920x1080 60.00 60.00 50.00 59.94 30.00 25.00 24.0= 0 =20 29.97 23.98 =20 1920x1080i 60.00 50.00 59.94 50.00 =20 1600x1200 60.00 =20 1600x900 60.00 =20 1280x1024 75.02 60.02 =20 1152x864 75.00 =20 1280x720 60.00 50.00 59.94 =20 1024x768 75.03 60.00 =20 800x600 75.00 60.32 =20 720x576 50.00 =20 720x576i 50.00 =20 720x480 60.00 59.94 =20 720x480i 60.00 59.94 =20 640x480 75.00 60.00 59.94 =20 720x400 70.08 =20 HDMI-2 disconnected (normal left inverted right x axis y axis) DP-1 disconnected (normal left inverted right x axis y axis) rd@h370:~$=20 After installing spice-vdagent on the guest, I get there rd@debianVM:~$ xrandr=20 Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192 Virtual-0 connected primary 1920x1080+0+0 0mm x 0mm 3840x2160 60.00 + 1920x1200 59.95 =20 1920x1080 60.00*=20 1600x1200 59.95 =20 1680x1050 60.00 =20 1400x1050 60.00 =20 1280x1024 59.95 =20 1440x900 59.99 =20 1280x960 59.99 =20 1280x854 59.95 =20 1280x800 59.96 =20 1280x720 59.97 =20 1152x768 59.95 =20 1024x768 59.95 =20 800x600 59.96 =20 848x480 59.94 =20 720x480 59.94 =20 640x480 59.94 =20 Virtual-1 disconnected Virtual-2 disconnected Virtual-3 disconnected rd@debianVM:~$ Note, the repetition rate (at least virtually) doubles in the guest at 4K. Pretty cool! Thanks again Rainer =2D-=20 Rainer Dorsch http://bokomoko.de/