You are not logged in.

#1 2014-01-03 18:43:24

chiwou
Member
Registered: 2012-04-29
Posts: 11

Xen or QEMU and VGA passthrough

Hello big_smile
currently I run Windows on my desktop and Arch on my notebook, the desktop is just for gaming and to work with Photoshop.
But I read about Xen and the VGA passthrough and really intrigued, since it would mean I can run Windows under Linux and just boot it up if needed.
And this way I could use Arch on my desktop too, I started experimenting with android and my notebook is too slow to compile and work with git.

So far I've all the necessary and compatible hardware,
- Intel with VT and VT activated in BIOS
- AMD Graphics
but one thing is still bugging me and couldn't find a definitive answer.

Do I really need two graphic cards?

If I would install a minimal setup as base and once booted to Windows or Linux guest; I would just need a remote connection to the host; right?
This way a second card wouldn't be necessary, but I wanted to make sure, before I change my whole system.

Thanks and take care
-Chris

Offline

#2 2014-01-03 21:07:53

dvdkon
Member
Registered: 2014-01-03
Posts: 6

Re: Xen or QEMU and VGA passthrough

The official Xen wiki page (http://wiki.xen.org/wiki/Xen_VGA_Passthrough) doesn't mention anything about two video cards. Even if it was true a remote connection back to host would surely work, You'd just have to set up the networking right.

Offline

#3 2014-01-03 21:12:46

chiwou
Member
Registered: 2012-04-29
Posts: 11

Re: Xen or QEMU and VGA passthrough

Right that Wiki document got me started, but then all the How-Tos and tutorials

https://bbs.archlinux.org/viewtopic.php?id=162768
or
http://forums.linuxmint.com/viewtopic.php?f=42&t=112013

they all use a second graphics card, even some multiple monitors and kvm switches to switch between, host, guest, monitor and usb (mouse and keyboard)
The more I read, the more I got confused tongue

Offline

#4 2014-01-03 22:58:12

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,967

Re: Xen or QEMU and VGA passthrough

 Can I share the graphics card between multiple VMs with Xen VGA passthru?

In short, no. Xen VGA graphics passthru is a special form of PCI passthru, and PCI passthru dedicates the PCI device (graphics card) to exactly one single VM.
Why is VGA passthrough different from normal PCI passthrough?

VGA adapters are not simple PCI devices like NICs or disk controllers. VGA adapters need to support many legacy x86 features like VGA BIOS, text mode, legacy IO ports, legacy memory ranges, VESA video modes, etc for correct and expected operation. This means VGA passthrough requires more code than normal Xen VT-d PCI passthrough.

Qemu-dm emulator used in the Xen HVM guest needs to disable the internal (emulated) graphics adapter, copy and map the real graphics adapter VGA BIOS to the virtual machine memory, emulate and execute it there to reset and initialize the graphics card properly, map and passthru the VGA adapter real memory to the HVM guest, passthru all the legacy IO-port and legacy memory ranges from the HVM guest to the real graphics adapter etc.

For more information about normal Xen PCI passthrough see XenPCIpassthrough wiki page. 

These lines from the xen wiki page make me think that on a system with 1 videocard you'd have the following limitations :
The videocard will be exclusively usable by ONE xen VM
the host wil NOT have any videocard

Can a linux system be installed on a box without a physical videocard present ?
If the answer is yes, then it should be possible to use vga_passthrough with 1 card, although i don't really see benefits of this approach.

Maybe OP should investigate hypervisor solutions like vmware esxi instead of host/ VM setups ?

Last edited by Lone_Wolf (2014-01-03 23:00:13)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#5 2014-01-05 11:02:33

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Xen or QEMU and VGA passthrough

What Lone_Wolf said. You don't need two graphics cards if you don't do anything graphics intensive on Arch anyways, but you can't use the card you passed through to Windows as long as your Windows VM is up. I'm not sure as I've never run such a setup, but I'd imagine it might lead to some problems when handing over control from dom0 to domU (and back):

Fajar A. Nugraha wrote:
Chris Angelico wrote:

I assume I can switch it to a different VM on the fly? That is, boot with the graphics card dedicated to dom0 Linux, then fire up domU Windows and hand control over.

Nope.

AFAIK the PCI device has to be hidden from dom0 to make it assignable to domU, and once dom0 uses it (e.g. for console output) there is no way to hide it.

This is from this mailing list post, which is from 2011. I've been using XenServer with two GPUs for the last three months and the card that has been passed through was still visible on the hypervisor IIRC (don't have a machine here to test that now, sorry). I'd try to run your hypervisor without a dedicated graphics card, boot up the Windows VM and pass the GPU through, and see if you can still see the card on the hypervisor. If it works, you can try out hand-over as the next step.

Offline

#6 2014-01-05 18:30:40

chiwou
Member
Registered: 2012-04-29
Posts: 11

Re: Xen or QEMU and VGA passthrough

Thanks that would be awesome

I also got in contact with powerhouse on the linux mint forum
http://forums.linuxmint.com/viewtopic.p … &start=320

And powerhouse posted some scripts, but I didn't have the time to test it yet

Offline

Board footer

Powered by FluxBB