I've managed to get virgl 3D acceleration running in QEMU/KVM, and now I want to see if I can get it running with multiple displays. However when I add more heads to the Video Device Display 1 is mirrored onto the other displays rather than extended, no matter what I do with the settings. Does anyone know how to to get this working? I can't do GPU passthrough as my CPU doesn't have integrated graphics, and I don't have the space or the budget for another GPU.
Host Machine
| OS | Arch |
|---|---|
| Desktop | KDE |
| Display Server | x11 |
| CPU | AMD Ryzen 7 5800X3D |
| GPU | NVIDIA GeForce RTX 4090 |
| RAM | 64GB |
Guest Machine
| OS | BigLinux |
|---|---|
| Desktop | KDE |
| Display Server | x11 |
How I got virgl working with NVIDIA
- I set up the VM normally through virt-manager's wizard.
- I installed the ISO, then shut the VM down after loading the desktop on the installed system.
- In Details view, with XML editing enabled in virt-manager:
- Under
Video VirtioI enable 3D acceleration. - Under
Display SpiceI setListen typetoNoneand leaveOpenGLunchecked. (I have found leavingListen typeasAddressworks too, but both the tutorial I followed for this and the warning that comes up when you enable OpenGL tell me to leave it asNone, so I do) - Under
OverviewI switch to the XML tab- I delete
<gl/>from the existing<graphics/>device if it exists. - Below the existing
<graphics/>device I add the following:
- I delete
- Under
<graphics type="egl-headless">
<gl rendernode="/dev/dri/renderD128"/>
</graphics>
Now when I start the VM, I open Lutris and under Preferences I check Hardware Information, and it shows that virgl is working and lists my GPU.
What I did to add more displays to the VM
- After enabling virgl with the above steps, I shut down the VM.
- I go to Details, and under
Video Virtio's XML tab I change theheadsvalue to3, because I want 3 displays. - After booting the VM to desktop, I enter
virt-viewer -ain a terminal on the host to launch it in attach mode. (WithListen typeset toAddressI have the option to launch it normally or use remote-viewer instead) - To initialise the extra displays, from the first display window (which should be initialised) I check and uncheck one of the additional displays.
Weird details about the results of those steps
The displays are automatically arranged to be side, but what I see is an imperfect mirror of Display 1 on the other displays - the other displays only seem to update when something changes, and then not always. Despite showing Display 1, the other displays do at least act like I want them to behind what's displayed; I can test this by arranging the display windows next to each other on the host, dragging a window between the displays on the guest and then dragging where the titlebar should be on the extra display.