Repository navigation
Description
What happened?
Since upgrading from UTM 4.x to 5.x, my Kubuntu 24.04 VM experiences severe display lag under KDE Plasma/X11. Screen updates occur roughly once per second, despite glxgears reporting ~3700 FPS.
The lag begins after logging into KDE but is not apparent at the graphical login screen. Moving or resizing windows makes it particularly noticeable.
Configuration:
Host: Apple M4 Max, macOS 26.7.3, UTM 5.0.9
Guest: Kubuntu 24.04, X11, KWin 5.27.11
Mesa: 25.2.8
Display: virtio-gpu-gl-pci, VirGL acceleration
OpenGL: VirGL 2.1, GLX
Findings:
Suspending KWin compositing eliminates the lag.
Disabling KWin's blur and contrast effects makes no difference.
Setting KWIN_USE_BUFFER_AGE=0 completely resolves the lag while retaining accelerated OpenGL compositing.
This appears to be a regression introduced in UTM 5.x, potentially involving buffer-age reporting or damage tracking between KWin, VirGL and UTM.
UTM version
5.0.9
Mac and macOS version
MacBook M4 Max, OS 26.7.3
VM type
QEMU
Guest operating system
Ubuntu 24.04 AArch64
Did this work before?
Worked in 4.x
Where did you get UTM?
GitHub release or getutm.app
Logs
No response
Activity
UTMapp-bot commentedon Nov 17, 2026
Thanks for the detailed report. I tried to reproduce this here. The lag appears once the guest display is resized through dynamic resolution, and I found a guest-side bug that is part of it. The full chain is not pinned down yet, so some details from you would help.
What I tested
kde-plasma-desktop+kwin-x115.27.11, an X11 session, and Mesa 25.2.8. KWin reports OpenGL compositing on GLX with renderervirgl, OpenGL 2.1.virtio-gpu-gl-pci, dynamic resolution on, retina mode off, default renderer.xdotoolat about 60 Hz. I counted the distinct frames the UTM window showed. Each resize was triggered by switching the guest to a larger mode withxrandr; UTM's dynamic resolution then fitted the guest to the window.Results (release 5.0.9)
1280x800(kernel mode, 120 Hz)1920x957(kernel mode, 120 Hz)1920x957-0(created by spice-vdagent, 0.06 Hz)qdbus org.kde.KWin /Compositor suspend)1920x957-0xrandr --output Virtual-1 --mode 1920x957)1920x957(120 Hz)In the last state, windows moved normally inside X (
xdotoolround trips took 2 ms,glxgearsran at about 1100 fps), but the composited screen changed only once per second. That matches what you describe. With compositing suspended, updates were smooth.One guest-side bug found: spice-vdagent creates 0.06 Hz modes
When UTM resizes the display,
spice-vdagentin the guest applies the new size through XRandR. If no mode of that size exists yet, it creates one named<width>x<height>-<n>.set_reduced_cvt_mode()in itssrc/vdagent/x11-randr.ccomputes the pixel clock in kHz (the comment there says "kHz for xf86"), butXRRModeInfo.dotClockis in Hz. Every mode it creates therefore runs 1000 times too slowly (60 Hz becomes 0.06 Hz).xrandr --verboseshowed this here:1920x957-0 0.123MHz ... v: ... clock 0.06Hz.I checked this in spice-vdagent 0.22.1 (Ubuntu 24.04's
0.22.1-4ubuntu0.1), and current upstream master has the same code. Whether the agent's mode or the kernel's mode ends up current varies from one resize to the next.What does not match yet
KWIN_USE_BUFFER_AGE=0, did not bring updates back in my runs, and neither did restarting KWin. However, my runs after KWin restarts were not reliable (the screen sometimes stopped updating entirely), so I would not read much into that.What would help
While the lag is happening, please post:
xrandr --verbose | grep -A2 currentin the guest. Is the mode's name of the formWxH-0, and does itsv:line show about0.06Hz?dpkg -l spice-vdagent;rearnsha commentedon Nov 17, 2026
1: 1840x1010-0 (0x171) 0.124MHz *current
h: width 1840 start 1888 end 1920 total 2000 skew 0 clock 0.06KHz
v: height 1010 start 1013 end 1023 total 1039 clock 0.06Hz
2: $apt search spice-vdagent
Sorting... Done
Full Text Search... Done
spice-vdagent/noble-updates,noble-security,now 0.22.1-4ubuntu0.1 arm64 [installed]
Spice agent for Linux
$ dpkg -l spice-vdagent|catDesired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=================-============-=================================
ii spice-vdagent 0.22.1-4ubuntu0.1 arm64 Spice agent for Linux
3: disabling dynamic resolution solves the issue (no lag, but you can't then arbitrarily resize the display - trying to do so leads to scaling of the blurred graphics due to interpolation)
4: (github won't let me attach the debug file here, I'll see if I can attach it as a separate comment.)
rearnsha commentedon Nov 17, 2026
https://pastebin.com/15BMcpF1
I've had to remove the date from various lines to keep it under the patebin limit.
UTMapp-bot commentedon Nov 17, 2026
Thanks, that confirms it. Your current mode,
1840x1010-0at 0.124 MHz / 0.06 Hz, is the one spice-vdagent creates. Theset_reduced_cvt_mode()of 0.22.1 produces exactly those timings for 1840x1010 (1888/1920/2000, 1013/1023/1039). It also fits that turning off dynamic resolution makes the lag go away.Fix: utmapp/vd_agent#7 (the agent's source tree in this organization). It computes the mode's clock in Hz, as XRandR expects. It also replaces broken 0.06 Hz modes an older agent left in the running X server instead of reusing them, and caps the clock for very large modes on 32-bit guests.
Tested in the same Ubuntu 24.04 + KWin 5.27 X11 guest on UTM 5.0.9, with dynamic resolution on, counting the distinct frames the UTM window showed while a window moved:
3840x957-0, 0.06 Hz3840x961-0, 59.91 Hz (the old 0.06 Hz mode, replaced)Ubuntu's
spice-vdagentpackage comes from the distribution, not from UTM, so this reaches your guest only once the fix is in the package Ubuntu ships. Until then, either of these avoids it:-0, for examplexrandr --output Virtual-1 --mode 1840x1010if that mode is listed. This worked here once, before the guest had been on a 0.06 Hz mode. After it had been, KWin stayed at about 1 update per second even on the 120 Hz mode until the session was restarted, so you may need to log out and back in.There's no need to attach the debug log for this.
rearnsha commentedon Nov 17, 2026
Many thanks. I built a local version of the ubuntu .dev with that patch applied and it seems to have resolved the issue.
UTMapp-bot commentedon Nov 17, 2026
Thanks for testing it. Your result, from Ubuntu's 0.22.1 package rebuilt with the patch on your own setup, confirms the fix in utmapp/vd_agent#7 outside my test VM. This issue stays open until a maintainer has reviewed and merged that pull request.