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

Guest Machine

OS BigLinux
Desktop KDE
Display Server x11

How I got virgl working with NVIDIA

  1. I set up the VM normally through virt-manager's wizard.
  2. I installed the ISO, then shut the VM down after loading the desktop on the installed system.
  3. In Details view, with XML editing enabled in virt-manager:
    1. Under Video Virtio I enable 3D acceleration.
    2. Under Display Spice I set Listen type to None and leave OpenGL unchecked. (I have found leaving Listen type as Address works too, but both the tutorial I followed for this and the warning that comes up when you enable OpenGL tell me to leave it as None, so I do)
    3. Under Overview I switch to the XML tab
      1. I delete <gl/> from the existing <graphics/> device if it exists.
      2. Below the existing <graphics/> device I add the following:
    <graphics type="egl-headless">
      <gl rendernode="/dev/dri/renderD128"/>

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

  1. After enabling virgl with the above steps, I shut down the VM.
  2. I go to Details, and under Video Virtio's XML tab I change the heads value to 3, because I want 3 displays.
  3. After booting the VM to desktop, I enter virt-viewer -a in a terminal on the host to launch it in attach mode. (With Listen type set to Address I have the option to launch it normally or use remote-viewer instead)
  4. 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.


You must log in to answer this question.

Browse other questions tagged .