high performance with xen, vmware or virtualbox

Solution 1:

Xen hypervisor allows you to run a Windows VM with direct access to your graphics card (hardware). This is called VGA passthrough. You can also directly access other PC hardware using PCI passthrough, for example USB host controllers, SATA controllers, etc., all of which will then be available under Windows, with Windows-native drivers.

BUT, as mentioned before, you need to carefully select your hardware. Here some basic guidelines to check if your hardware is compatible:

  1. Your CPU must support VT-d (Intel) or AMD-Vi / IOMMU (AMD) !!! Don't confuse it with VT-x - these are two different things. For Intel, see ark.intel.com. Note: The 3930K with C2 stepping also supports VT-d, but it's not listed when using the VT-d filter.

  2. Your motherboard (and motherboard BIOS) must have an option to enable VT-d (sometimes called IOMMU). Some BIOS implementations have been reported buggy, though. Still, if the option shows up, chances are good.

  3. A VGA-passthrough compatible graphics adapter. Many (most?) AMD graphics cards are supported, and some Nvidia cards, namely the professional "multi-OS" Quadro series (starting from the Quadro 2000 upwards). The Intel onboard graphics is supposedly also compatible. Search for "Xen VGA passthrough tested adapters". Note: It's best to have a another GPU (Intel onboard or separate graphics card) for your Linux, and pass-through the secondary GPU (the one NOT used by Linux).

If you got compatible hardware, it's definitely worth the effort. Search for "VGA passthrough" or "virtual gaming" to find tutorials, or try this here HOW-TO make dual-boot obsolete which is based on Linux Mint 13 (should be similar for Ubuntu).

Solution 2:

With PCI/VGA Passthrough on Xen (and afaik kvm, too), people is playing on vm with direct hardware access passed to vm. With little to none decrese in performance. Vmware and Virtualbox are tools to toy.

Solution 3:

Windows can be installed as a HVM guest with Xen, but your hardware needs to support virtualization technologies for this to be useful for your intended purposes.

Using Xen with a Windows HVM domU, you can use VGA and PCI pass-through in order to give the Windows virtual machine direct access to a GPU. However, the catch is that your Processor, Motherboard, and potentially GPU need to support Intel VT-d or AMD's equivalent.

Tracking down the proper hardware will probably be the largest prohibiting factor. I say this because, while the technology has existed for quite some time, it's not a feature that many consumer users are interested in and therefore has not been supported well among manufacturers, specifically speaking motherboard manufacturers. You can find hardware that the Xen community has found to work, but technology moves so quickly, it may be difficult to find parts that have been verified to work, available to purchase. Many parts may have been discontinued. Also, just because the chipset and cpu support vt-d, that doesn't mean that the BIOS for the motherboard supports vt-d, which makes tracking down the proper hardware all the more difficult.

Assuming you obtain the proper hardware, it is then simply a matter of installing a linux distribution to act as the dom0 or host that you will then install the Xen hypervisor on. You will need to fiddle around a bit to get the GRUB loader to load the Xen bootstrap, since by default the standard bootstrap will load first, thus trumping the Xen bootstrap.

The documentation is varied and contradictory as this process is fairly niche and as of 4.2+ some significant changes have been made as to how certain tools and systems operate, namely network bridging, routing, NAT translation, etc. There is current documentation in existence, but there is also plenty of old and outdated information available.

Once you get the network configuration setup, you will need to ensure that you have at least two GPUs. This ties in with the proper hardware I spoke of earlier. The ideal way to go is to have an Intel CPU with integrated graphics to support your Xen dom0, while having a nice gaming GPU to VGA and PCI passthrough to your Windows domU. However, as I stated before vt-d is necessary in order to perform the VGA and PCI passthrough.

I currently have an HP dv7-3085dx from 2009 that I have Ubuntu as the dom0 with Xen and Windows 8 as an HVM. While this HP laptop supports vt-d and I can pass hardware through to the Windows HVM, I cannot pass-through a GPU to the Windows HVM without crippling my dom0, as this laptop only has one VGA supportable GPU. This leaves me with a Windows HVM that works well other than choppy graphical performance, which unfortunately makes the Windows HVM rather useless.

With the proper hardware you can have a Windows HVM that can play brand new games on Ultra with 60+ FPS. I unfortunately do not currently possess the proper hardware to take advantage of the vt-d technologies, but there are plenty of YouTube videos of people that do. You can search for their benchmark tests to get an idea of how well this technology works when you have proper hardware.

--EDIT--

To follow up with this, it may be technically possible to use a single graphics processor for the dom0 and domU. However, you would need to setup the dom0 to allow you to SSH from a separate machine in order to launch the domU, since you would have to blacklist the GPU in the dom0 boot sequence in order to make it available to the domU. This would mean that you need to use two machines in order to make the single machine usable.

So, you would SSH into the dom0, launch the domU. Assuming that you have the VGA pass-through setup properly, once you have the domU running, you will VNC into it from the second machine. Then you ensure that your passed through GPU shows up and has drivers installed. Then you select that GPU as the default display adapter and hope that you get video output to the monitor physically attached to the machine the domU is running on.

Solution 4:

  • Xen HVM is...exactly the same virtualization as VMware and Virtualbox; there's no difference. It's only called that because there's another kind called Xen PVM (para-virtualized), which can only run Linux VMs and is more efficient in some cases.

  • To be honest, while both VMWare and Vbox have rudimentary 3D support (Xen HVM has none -- it's mostly meant for servers), it will 99.9% be insufficient to run modern 3D games, no matter how powerful your CPU or GPU. You will have to dual-boot, unless your favorite games are Wolfenstein, Doom and Quake 1 :p