Fix: "missing object type 'virtio-gpu-gl-device' ''
I came across this error last week, when trying to create a BlissOS VM with VirtIO graphics acceleration on my server. The fix for it was dead simple but not straightforward to find, so here's how to solve it.
Error starting domain: internal error: qemu unexpectedly closed the
monitor: 2025-01-19T16:19:03.113947Z qemu-system-x86_64: -device
{"driver":"virtio-vga-gl","id":"video0","max_outputs":1,"bus":"pcie.0",
"addr":"0x1"}: missing object type 'virtio-gpu-gl-device'
The error message
tl;dr: Install qemu-system-gui
if you're running Debian on your VM server.
If you're interested in the details, keep reading.
But first a little detour...
I don't like Meta/Facebook. In fact, I like it even less now after recent events. It's been years since I removed all Meta-owned services from my life, with one unfortunate exception: WhatsApp.
In Brazil (where I'm from), WhatsApp has a strong chokehold on the communications market, and is the de-facto comms channel for everything: from talking shit with your friends to doing business with local and large companies, and even accessing governmental services. This makes it VERY inconvenient to quit, but there's no way in hell I'm installing Zuckerborg's spyware on my phone.
The workaround I use is to run it on a locked-down environment and bridge it to Matrix using mautrix-whatsapp. This works well, with the extra perk of not being able to receive voice and video calls.
Up until now, I had been using an old OnePlus One running LineageOS as my sacrificial lamb. It sat on my desk, connected to the guest WiFi, always plugged in to the charger, its only miserable task to periodically report back to the Meta Mothership so the Matrix bridge won't be logged out. As you can imagine this is less than ideal: the battery is starting to bulge, Android bugs out sometimes and requires a reboot, and the phone still has a physical microphone and I don't trust Meta to not try to bypass OS permissions to access it.
A VM running Android seems like a much better solution in terms of security and privacy in my opinion, so I set to install BlissOS 15 on my server and move WhatsApp there.
Getting GPU acceleration in the VM
Android needs GPU acceleration to not work like shit, and it's trivial to get it working with Libvirt/Spice when the VM is running on your local machine: just set you graphics adapter to virtio
, tick the checkbox for 3D acceleration, then on the Spice display change the "Listen Type" to None
and enable OpenGL. Done!
When running the VM on a remote server, however, the setup requires an extra component, an egl-headless
display to handle the 3D shenanigans directly on the server (which obviously needs to have a GPU).
<graphics type="egl-headless">
<gl rendernode="/dev/dri/renderD128"/>
</graphics>
The XML definition for the egl-headless display
Note that when doing this, you should keep the Spice display with its default settings.
The problem and solution
After following the method above I was hitting the error at the top of this post, preventing the VM from starting, and I had no idea why. Information on this error is a little scarce (I guess not a lot of people have this particular setup), and I ended up spending more time than I would like to admit trying to find a solution, when I came across this Google Groups discussion where I saw this:
This suggests that the qemu error is being caused by the decision to move hw-display-virtio-gpu-gl out of qemu-system-common and into qemu-system-gui.
Bingo! Installing qemu-system-gui
on the server immediately fixed the problem and the machine started with no issues.
This was a bit of a weird post, perhaps too much rambling, but hopefully it will help someone in the future.