VNC console with 4K resolutions is cut off on the right side and mouse coordinates are offset (or horizontal res greater than 2600-3000 pixels)
Host environment
- Operating system: Fedora 37
- OS/kernel version: Linux fedora 6.2.9-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:31:57 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
- Architecture: x86_64
- QEMU flavor: qemu-system-x86_64
- QEMU version: QEMU emulator version 7.0.0 (qemu-7.0.0-15.fc37)
- QEMU command line:
#!/bin/bash args=( -name "test-vm-107",debug-threads=on -pidfile /run/test-vm-107.pid -smbios type=1,uuid="43e2782d-6506-4b9a-908a-7f9864902190" -no-hpet -enable-kvm -overcommit mem-lock=off -serial none -parallel none -k en-us -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/ovmf/OVMF_CODE.fd -netdev tap,id=netdev0,vhost=on,script=ifup.sh,downscript=ifdown.sh -device virtio-net-pci,netdev=netdev0,id=nic0,mac=AA:BB:CC:DD:EE:FF -vnc :7 -vga none -display egl-headless -device virtio-vga-gl -device usb-ehci,id=ehci -device qemu-xhci,id=xhci -device usb-tablet,bus=ehci.0 -device usb-kbd,bus=ehci.0 -drive id=drive0,file=107.qcow2,if=none,format=qcow2,cache=writeback,discard=unmap,detect-zeroes=unmap -device nvme,drive=drive0,serial=AABBCCDDEE -machine q35,smm=on,vmport=off,dump-guest-core=off,kernel_irqchip=on,mem-merge=off -rtc base=localtime,clock=host,driftfix=slew -cpu host,kvm=off,-hypervisor,hv_passthrough -smp 8 -m 16G -global nec-usb-xhci.msi=off -global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot menu=on,strict=on,splash-time=5000,reboot-timeout=5000 -no-user-config -nodefaults -spice port=7007,disable-ticketing=on,streaming-video=all ) /usr/bin/qemu-system-x86_64 "${args[@]}"
Emulated/Virtualized environment
- Operating system: Fedora 37
- OS/kernel version: Linux fedora 6.2.9-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:31:57 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
- Architecture: x86_64
Description of problem
For some reason when connecting to the VNC console of a QEMU VM, when you use a resolution that has its horizontal size of about 3000 pixels or more, it gets cut off by about 1/4 of the screen from the right, and the mouse position is offset by that value towards the left. See image for explanation:
Steps to reproduce
- Create a Fedora 37 VM
- Use
virtio-vga-gl
andegl-headless
- Set the resolution to 4K (3840x2160) or anything with the horizontal resolution greater than 3000 pixels
- Use Windows to connect to the VNC console. Issue happens with TightVNC Viewer and RealVNC Viewer
Additional information
I also tried -device virtio-vga-gl,edid=off,xres=3840,yres=2160
. Same result, but edid=off
helps to make 2560x1600 appear, making it bearable.
This also happens with Wayland and Xorg.
Please note that while it's possible to use Gnome's Screen Sharing (RDP/VNC) options, as well as NoMachine or other options, this is an undesirable behavior in QEMU's VNC server/console that should be fixed (and can, the VNC protocol perfectly supports 4K without issues)
Not to mention that, at least in my use case, the VNC console is faster than the alternatives, even SPICE (connecting from Windows is barely unusable at 4K res - it's a bliss from Linux. Both cases from a remote machine in the same LAN, but that is unrelated to this bug).
I would happily try different use cases to try to help nail down this bug