libvirt/libxl VGA passthrough: Displaying gfx on laptop screen possible?

Greetings!

I’m attempting to set up a VM with VGA pass-through. So far, the device gets assigned to the VM, but I cannot get any video information on the main screen.
Since it is running on a laptop that isn’t hooked up to a secondary monitor, that option isn’t available for video output.

Is there any option that allows displaying the VM gfx on the main screen (i. e. switch between the dom0 and the domU gfx)?

FYI: I have dual graphics available (both Intel and AMD Radeon), with the Intel graphics in use by the dom0.

Have you

  1. Verified your graphics card is on the supported list?
    http://wiki.xen.org/wiki/Xen_VGA_Passthrough_Tested_Adapters

  2. Verified prerequisites and configured correctly?
    http://wiki.xenproject.org/wiki/Xen_VGA_Passthrough

TSU

It has been a long time, but finally further investigation turned up some results, although things still aren’t 100% perfect.

First of all, since the pciback module (I’m using a Xen-aware kernel in dom0, therefore it’s pciback insteadof xen-pciback) isn’t compiled into the kernel, I had to resort to tinkering with etc/modprobe.d/ to get the Radeon (the graphics card that I intend to pass through to Windoze) bound to the pciback module. Unfortunately the pciback kernel parameter cannot be used when pciback is compiled as a module.
For some reason late binding (i. e. unbinding the radeon device driver, then reassigning the PCI bus address to pciback) didn’t work, either merely failing with an error message or outright locking up the kernel, which leaves just the method of telling modprobe to load pciback instead of the radeon driver.

Now, having that done, I get the following result:

  • inside the Win7 VM:
    The Radeon shows up so I can install the appropriate driver. Afterwards the device shows up in the Device Manager.
    The virtual graphics card (Cirrus) isn’t disabled, although VGA pass-through actually takes place, and still shows up in the Device Manager as a standard VGA adapter. (excusez-moi?) The definition for the virtual graphics card is commented out in the VM definition.

  • in dom0 (openSuSE 13.2):
    The Radeon should disappear in the listing made by lspci, but it is still there.
    Awkwardly enough, for some reason editing a particular file in /etc/modprobe.d didn’t do as expected: For some reason the radeon module is nevertheless loaded and prevents loading pciback. Unloading radeon in boot.local resolves this issue (I thought I forced modprobe to load pciback instead of the radeon module when the graphics driver is supposed to be loaded…? boggle).
    When firing up the Win7 VM the monitor is still assigned to the Intel graphics.

This in turn brings up several new questions:

  • How do I make the Radeon disappear in the lspci listing?
  • How do I force the monitor to switch to the Radeon when the Win7 VM fires up?

As far as I take it the CPU in the box in question doesn’t have VT-d but still uses VT-x and so doesn’t seem to have an IOMMU available (I have passed the iommu parameter to Xen, but that doesn’t change anything, nor does passing it to the dom0 kernel). Is there still a way to get things going the way they should?

Any help is greatly appreciated.

Without actually doing, I suspect nothing can be done automatically unless you want to try writing code.

So,

  • You probably need to boot your Host into the “other” display adapter if you plan to pass your current main display.
  • I doubt you would want to “remove” something from your lspci listing although you could probably blacklist it.

Without actually doing any of this, I suspect you might be able to re-assign default priority if you can switch the slots each vga adapter is inserted (assuming both are inserted in the same type of slot). You might also take a look at your OEM software to see if there is a way to assign priority or at least a way to re-assign “primary” on a permanent basis.

TSU