I only have one graphics card; I'd like to do VGA passthrough to Windows, and then run an X server on windows and connect back to dom0.
It's a little ass-backwards, but I don't see why it shouldn't work. Problem is, I have no idea how to do it. (I know it can be done, as it's mentioned here: http://www.overclock.net/t/1205216/guid ... al-machine
but without very detailed directions).
(If anyone is curious, I found a guide here: http://linux-bsd-sharing.blogspot.com/2 ... 0(rev%20a1
) but I never got it past giving me a black screen)
I am a little confused as to what you are trying to achieve? From what I understand (mainly from the link to the guide on overclock.net which I've also tried to get it working), you are trying to boot into a Windows domU and connect to the Linux dom0 via VNC?
If you have a desktop computer and the possibility to install a second graphics card - do it!!! It's a lot easier. I was banging my head against the wall when I tried getting VGA passthrough working with only one graphics card. It seems simple, but there are some tricky parts to watch out for.
If you heed my advise and install a second graphics adapter, make sure you got the following:
1. Primary graphics adapter for Linux dom0: ATI card (usually a cheap but newer card will do, unless you need better graphics support - the 6450 I have is VERY baseline and I recommend a little stronger card.
2. Secondary graphics adapter for Windows domU: ATI card - many cards are supported. If you need it for gaming, get one of the more powerful ones. Check the Xen wiki and the overclock.net thread you posted. If you want Nvidia: only the "Multi-OS" cards are good. They are professional graphics workstation cards and cost a little fortune, and they are NOT specifically designed to be good for gaming (though they might do OK). Anyway, if gaming is what you are after, the Nvidia Multi-OS cards are too much $$$ for the performance they offer. I do have the Nvidia PNY Quadro 2000 and it works perfect under Xen with VGA passthrough, but I don't use it for gaming!
OK, after my suggestion to just install a cheapo ATI graphics card as primary graphics adapter for Linux dom0 and another (gaming) ATI card for Windows domU, here the challenges/caveats for single graphics adapter passthrough:
1. If you have only one graphics adapter, it must be detached from (or never attached to) the Linux dom0 graphics driver and attached to the Windows domU.
2. In the boot process, the xen-pciback module must take control of the graphics adapter and assign it to Windows domU. In Fedora 16/17 (the tutorial you referred to on overclock.net), pciback is compiled into the kernel (not a loadable module). In Linux Mint (and Ubuntu) xen-pciback is loaded as a module.
3. If you do want to use Linux Mint (I for example do prefer Linux Mint over Fedora and other distributions), you need to make sure that the Linux graphics driver doesn't get in the way with assigning the graphics card to Windows. One way to go is to load xen-pciback via /etc/modules (see my tutorial, part 3, point 6).
4. Read step 6a of the overclock.net tutorial: http://www.overclock.net/t/1205216/guide-create-a-gaming-virtual-machine
. You must make sure you have a way to access your computer. I used my laptop and ssh -X firstname.lastname@example.org
(like ssh -X email@example.com
) to connect to my desktop where I installed Xen. Make sure it works BEFORE trying to passthrough the graphics adapter.
5. Once you have edited the /etc/modules file and rebooted the PC (after all the other adjustments etc. listed in the tutorial), the screen should be black (that is detached from the dom0). Using a second PC/laptop, connect to your PC and check with xm "pci-list-assignable-devices" to confirm that your graphics card can be assigned to the Windows domU.
6. Run sudo virt-manager (from the terminal window of the remote laptop/PC).
7. Switch to the VNC screen of virt-manager and start/run Windows. You should see the Windows ISO booting and the Windows installation sequence in the X-window on your remote PC.
8. You'll be asked to reboot at some point. Do so (I mean the Windows domU needs to reboot, NOT the PC). You'll probably need to reconnect the virt-manager VNC screen. If I remember correctly, you may have to exit virt-manager and run virt-manager again.
9. Once your back into Windows (on your virt-manager VnC window), open the device manager and check the graphics adapter (or whatever its called) option. You should see the Cirrus driver and hopefully a second option showing your graphics card. Download and install your graphics card driver. In my case, I went to the Nvidia website (remember I have the Quadro2000 card) and had the website check for the appropriate driver. The card was detected and I installed the latest driver for Windows. I don't know what ATI offers, but hopefully they have similar support.
10. After the driver installation, reboot your PC and see if it boots into Windows and you get a screen.
11. Get a VNC viewer for Windows and connect to your Linux dom0.
I believe the critical part is point 3. It may not be enough to have xen-pciback as a module. The overclock.net guide is based on Fedora 16 which has pciback compiled into the kernel. I haven't tried it, or to be precise, I've tried it with the wrong Nvidia card (a Nvidia Quadro 600 which is NOT Multi-OS) and, of course, it didn't work. If in point 5 xm pci-list-assignable-devices doesn't show the graphics card, you may have to compile your kernel and include pciback. Before doing so you could try to put the module on the initial RAM disk (initrd). See also http://wiki.xen.org/wiki/Xen_PCI_Passthrough
Hope it helps. If not, let me know and I'll try it on my system.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Sapphire 7770 GPU, PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB SSD + various HD, Corsair 500R case, SeaSonic 660W Gold X PS