Re: Screen scaling and 4k support in libvirt with qemu/kvm
Am Mittwoch, 27. Januar 2021, 10:55:53 CET schrieb Linux-Fan:
> Linux-Fan writes:
> > Rainer Dorsch writes:
> >> Hi,
> >> with virtualbox, it is possible that the guest system rescales its screen
> >> 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?
> > It is certainly possible to set the guest resolution to exactly match the
> > window size. I am not sure if it can be configured to _automatically_
> > adjust the guest resolution upon window size change though.
> > 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 resolutions
> > and thus does not usually match the exact window size but something
> > smaller.
> > If you find out how to apply the sizes automatically on Linux, I'd be
> > interested to learn how that works :) If no „solution” exists yet, it
> > might
> > be easy to script (although I have not bothered to do that so far).
> Update: I found out how to enable automatic resizing:
> * Install `qemu-guest-agent` in the VM in addition to running
> * Set Video model to VGA
> 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 spice-
vdagent and switching from QXL to virtio was sufficient here.
Interesting side effect:
On the host system, I get
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
axis) 609mm x 349mm
3840x2160 30.00* 25.00 24.00 29.97 23.98
1920x1080 60.00 60.00 50.00 59.94 30.00 25.00 24.00
1920x1080i 60.00 50.00 59.94 50.00
1280x1024 75.02 60.02
1280x720 60.00 50.00 59.94
1024x768 75.03 60.00
800x600 75.00 60.32
720x480 60.00 59.94
720x480i 60.00 59.94
640x480 75.00 60.00 59.94
HDMI-2 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
After installing spice-vdagent on the guest, I get there
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 +
Note, the repetition rate (at least virtually) doubles in the guest at 4K.