0

I've just got brand new Lenovo P1 gen7 with 16" with decent 3840x2400 resolution.

Fedora 42 handles it pretty well: it let me set up scaling to whatever suits me, and that's all. However KVM guest does not seem to read the screen size properly. Vm's icons and texts are extremely tiny. It's just annoyng to set it up internally for every VM I'm runnig and change it every time I start it on other display. Is it possible to make qemu/KVM/libvirt somehow report the accual size of the window/screen in DPI or mm, so VM could decide if it should run on 1:1 or in scaling mode in more-less automatic manner?

1 Answer 1

1

There's two ways your virt-manager might be exchanging what is displayed with your VMs:

  1. VNC
  2. SPICE

VNC has several incompatible extensions, of which (I think) tigerVNC's extensions support sending over DPI information (but nothing makes use of that). However, VNC as implemented by Qemu does not support any of that.

SPICE to the best of my knowledge (and according to a search in its protocol definition) has no provisions for transporting display pitch.

So, nope, not possible.

What you can do is set the display resolution in the guest lower and let set the view to be scaled (under "View" menu when running the VM), which will not be great for text.

Now, that's not set in stone. A reasonable course of action would be to

  1. Consult the SPICE protocol https://www.spice-space.org/spice-protocol.html
  2. understand the "Display Channel definition" section, especially SPICE_MSG_DISPLAY_MODE, and add another message like SPICE_MSG_DISPLAY_PROPERTIES, that would allow for transport of dpi (and eventually things like maybe color profiles, preferred refresh rates).
  3. implement that in the Spice guest agent and in the client library
  4. ????
  5. Profit!
1
  • Yep. Made sense. The view is not as crisp as OS scaling, but It helped on performance. too: Running 4k resolution VMs gives unresponsive GUI in guest. Funny observation - host display scalling is somehow applied to guest view: I set fixed resolution fo my guest running on scaled to 150% laptop screen. Looks OK. Then moved the window to unscalled external monitor (27" 4k) - the window frame seems ok, but the guest shrinked to 1/4th of the window, leaving remaing area black. VM is QXL/Spice. Commented May 11 at 14:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.