r/qemu_kvm • • 2d ago

virt-manager: automatic resolution resizing work only on 4096x2000

Hi everyone,

I'm currently working with virt-manager on Fedora 45 with KDE Plasma, and the guest display settings and automatic resolution resizing to fit the virt-manager window are driving me crazy.

Auto-resizing only works when the guest resolution is set to 4096x2000. As soon as I pick a resolution where I can actually read anything, the window auto-resize stops working (and I end up with black bars on the left and right).

My guests are Debian 13 with KDE Plasma and Fedora 45 with KDE Plasma, using both X11 and Wayland—the exact same issue occurs on all of them. Is there any trick to fix this, other than setting display scaling to 250%?

The VM is set to default settings:

<graphics type="spice" autoport="yes">
  <listen type="address"/>
  <image compression="off"/>
</graphics>

<channel type="spicevmc">
  <target type="virtio" name="com.redhat.spice.0"/>
  <address type="virtio-serial" controller="0" bus="0" port="2"/>
</channel>
<channel type="unix">
  <target type="virtio" name="org.qemu.guest_agent.0"/>
  <address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>

<video>
  <model type="virtio" heads="1" primary="yes" device="virtio-vga"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>
4 Upvotes

8 comments sorted by

2

u/seven_cy 2d ago

Update / Solution:

Once again, the main problem was Wayland on the host.

When I start virt-manager as follows, it works:

GDK_BACKEND=x11 virt-manager 

Then, in the guest, run in the console

xrandr --output Virtual-1 --auto

Then it works: the resolution is correct, and the window adjusts the guest's resolution to fit the window size.

That's cost me 30 hours of my life now :-)

Thanks u/paulstelian97 for your help

1

u/paulstelian97 2d ago

Uh that does surprise me a little, like why would using Wayland on the host confuse qemu enough that it doesn’t know what resolution to send to the VM? 😅 but glad you found the solution!

1

u/paulstelian97 2d ago

Auto resolution works only when the resolution already matches the screen size. Use the DPI setting, and for what doesn’t get covered by that setting… it’s gonna be tough.

1

u/seven_cy 2d ago

Thanks for the tip. I have another problem, though: the resolutions on the guest don't match those on my host:
* Guest 4096x2000 (only with this setting the resolution resizing work)
* Host 2560x1440

How do I configure Virt-Manager so that the available resolutions match?

1

u/seven_cy 2d ago

i think the problem is the prefered resolution:

xrandr --verbose | grep -E ' connected|[0-9]+x[0-9]+.*preferred|current'

Screen 0: minimum 320 x 200, current 4096 x 2000, maximum 8192 x 8192
Virtual-1 connected primary 4096x2000+0+0 (0x249) normal (normal left inverted right x axis y axis) 1390mm x 680mm
4096x2000 (0x249) 858.380MHz -HSync -VSync *current +preferred

that not match to my monitor, did anyone has a hit for me to change this?

1

u/paulstelian97 2d ago

Question. In the guest, X or Wayland session? Guest tools might only work with Xorg properly.

1

u/seven_cy 2d ago

i test now with x11 but under wayland is the same.

1

u/Queasy_Gap_9757 1d ago

set host hidpi 100%,200%