30.4.2013 - warning re xen hypervisor release 4.1.3-3ubuntu1.5 upgrade
29.4.2013 - added note on alternative method to load xen-pciback using the initramfs
18.4.2013 - added enable VT-d / IOMMU in BIOS step - renumbered steps
16.4.2013 - removed summary of steps, added info on AMD graphics cards
15.4.2013 - changed to consecutive numbering; commented out pae=1 option; added pci power management option and explanation; added additional references
7.04.2013 - Note on keyboard/mouse control using Xen with link to post, blacklisting radeon or nouveau driver
2.04.2013 - Appeal to open "virtualization" forum on LM; AMD CPUs; Intel VT-d; Nvidia modding
17.02.2013 - link to latest GPLPV drivers and new instructions on using them; comment out "auto eth0" entry in /etc/network/interfaces
01.02.2013 - fixed ark.intel.com link to list VT-d enabled CPUs and added a link re VT-d M/B, added glossary
21.01.2013 - additional notes / corrections for Linux Mint 14 Mate
18.01.2013 - additional references and links, cleaning up the text
13.01.2013 - enabled STP in network config; added localtime=1 to domU config file
10.01.2013 - added note on LM 14, added usb-devices command for USB PCI ID identification.
10.12.2012 - note about bridging and the network-manager package.
12.11.2012 - minor changes/additions in part 4, particularly the Windows installation part.
23.10.2012 - changed the title to make it more clear what it's all about: not having to dual-boot anymore and yet getting full graphics performance using a Windows VM (actually, performance is approximately the same or sometimes even better than installing Windows onto bare-metal). At the same time Linux is running and you can switch to it with the press of a button.
18.09.2012 - additions in Part 2 and Part 3 (step 10)
Warning: I updated my Xen hypervisor to the latest version 4.1.3-3ubuntu1.5 [quantal-upgrade] and it gave me an error when trying to load the Windows guest. Don't upgrade to the latest hypervisor and accessory packages. I downgraded the packages and all is fine now. Here the packages that need to be downgraded:
- Code: Select all
libvirt-bin libvirt0 libxen-4.1 libxenstore3.0 python-libvirt xen-docs-4.1 xen-hypervisor-4.1-amd64 xen-system-amd64 xen-utils-4.1 xen-utils-common xenstore-utils
Appeal: If you share my opinion that the Linux Mint forum would benefit from a dedicated "Virtualization" forum, please support the following suggestion by leaving your comment: http://forums.linuxmint.com/viewtopic.php?f=29&t=112951
Abstract: This how-to is about running Windows 7 (or other Windows versions) concurrently with Linux Mint on a Xen hypervisor, with FULL graphics acceleration for the Windows guest system.
There are special hardware requirements for this to work. Please make sure your hardware meets these requirements.
Running Windows as a guest in Linux is nothing new. But how about native graphics and near-native CPU performance? Here a little teaser - this is my Windows Experience Index when running Windows on top of Linux / Xen hypervisor, while Linux is fully functional at the same time:
This is with the GPLPV block device driver installed (for disk access) and full VGA graphics passthrough!
Introduction
I've been hoping for a long time to get rid of dual-booting Linux and Windows. But doing photo editing with all the bells and whistles requires Windows and a bunch of software and hardware tools to get it going. So I started to look into virtualization. I needed true graphics acceleration from within Windows, as well as direct access to some USB ports, something VirtualBox cannot provide as of this writing!
Reading reports from users who had installed Windows as a virtual machine (VM) on top of a Xen hypervisor, with full graphics acceleration under Windows, I decided to go for it. After months of planning, hardware purchases and replacements, and many hours installing Linux, Xen hypervisor, and finally Windows, I made it work !
The following is for people who want to run Linux and Windows at the same time - without the need for dual-boot - with both Linux and Windows having native or near native graphics acceleration and performance. With minor modifications these instructions can also be used to run two or more Linux virtual machines on one and the same PC, each having direct access to a graphics card or integrated graphics chip. Gamers rejoice!
Xen employs two related concepts that make it work: PCI passthrough and VGA passthrough.
Glossary
Here a few terms used in the how-to:
domU: This is a Virtual Machine or VM in Xen terminology. In our case it will be Windows.
dom0: This is a special Virtual Machine with administrative privileges. In our case this will be Linux Mint. All other VMs (or domUs in Xen talk) are started and controlled from the dom0.
PCI passthrough (or passthru): This is a technique which allows the dom0 to pass through a PCI device to the guest domU. The guest OS - in our case Windows - then uses its own hardware driver to access the device directly.
VGA passthrough: This is a specialized form of PCI passthrough for graphics cards / GPU. These devices are more complex and so is the interaction with them. Fortunately, using the right hardware together with Xen should take care of that. There are two forms of VGA passthrough:
VGA passthrough to GPU as primary adapter: The guest system (domU) boots and uses the passed through graphics card as its primary or only graphics adapter.
VGA passthrough to GPU as secondary adapter: The guest system first boots using the Qemu-dm virtual Cirrus adapter as the primary graphics adapter (this is where you see the BIOS screen and the Windows boot logo). After installation of the graphics driver under Windows and subsequent reboot of the domU, the system will switch to the secondary graphics adapter at some stage of it's boot process. This is the technique described here in this How-To.
Preparation and hardware selection
First of all you need to check the hardware. This will ONLY work with specific hardware features, if they are not supported, forget this tutorial !!!
Here a short checklist:
- CPU with VT-d (IOMMU) support (Intel terminology) - see http://ark.intel.com/search/advanced/?s=t&VTD=true for supported Intel CPUs*. When using AMD CPUs, the following chipsets support IOMMU: SR5690/SR5670 server chipsets, AMD 890FX, 990FX, 990X and 970 desktop chipsets. See http://wiki.xen.org/wiki/VTdHowTo for more information.
- Motherboard and BIOS version with option to enable VT-d (beware, some vendors have buggy BIOS versions) - see http://wiki.xen.org/wiki/VTd_HowTo and http://www.overclock.net/t/1338063/vt-d-compatible-motherboards for more!
- Graphics card that supports Xen VGA passthrough - see http://wiki.xen.org/wiki/Xen_VGA_Passthrough_Tested_Adapters and http://www.overclock.net/t/1307834/xen-vga-passthrough-compatible-graphics-adapters for more! In most cases, AMD will be a better choice than Nvidia, unless you like patching and compiling kernel and Xen.
- Enough RAM - the more the better, though 8GB should do in most cases
- Linux Mint 13 or later (or Ubuntu 12.04 or later), 64bit version
- Windows 7 (I haven't tested any other Windows version, though Windows XP and even Windows 8 might be a little easier)
- Enough disk space and good cooling if you plan to really make use of it
* Intel corrected the VTD=true search and the previously unlisted i7 3930K and 3960X are now listed. Both CPUs support VT-d in their newer "C2 stepping" release (spec code = SR0KY), see below.
Here is my hardware list for reference (EDIT: see note re motherboard):
- i7 3930K CPU with C2 stepping! (If you buy new, it should be with C2 stepping, but check!)
- Asus Sabertooth X79 motherboard with BIOS version 1203 - Important note: Don't use the newer BIOS releases 2002 or 2104 - they have broken VT-d support, according to here: http://vip.asus.com/forum/view.aspx?id= ... uage=en-us
- AMD 6450 graphics card as primary graphics adapter for Linux dom0
- Nvidia Quadro 2000 graphics card with "Multi-OS" feature (Nvidia terminology) as secondary graphics adapter for Windows domU - see below for more on that!
- USB KVM switch to connect keyboard/mouse to two different USB hosts and easily switch between them
- A graphics display with two DVI ports (or DVI and HDMI, though I haven't tested HDMI) and the ability to switch between the ports (screen button)
- Enough RAM (I have 32GB) and disk space (I use 1 120GB SSD and several 2TB hard drives, less will do)
EDIT: The Asus Sabertooth X79 has left a mixed impression on me. The Marvell SATA controller doesn't work under Xen dom0. The latest BIOS versions reportedly have broken VT-d support. Last not least, Asus does not support Linux on this board. I therefore can't recommend the product.
Most Nvidia graphics cards are tricky to pass through to the guest OS (Windows domU), only the "Multi-OS" versions are designed to work out of the box. You could try to patch and rebuild the Linux kernel and Xen, and there are some instructions on how to do it, but this is way more demanding than getting my above hardware to work. I have failed with a Nvidia Quadro 600 card, though it may be possible. Most AMD (ATI) graphics cards are easier to get working with VGA passthrough. See http://wiki.xen.org/wiki/Xen_VGA_Passthrough_Tested_Adapters and http://wiki.xen.org/wiki/Xen_VGA_Passthrough. If in doubt, get one of the tested AMD graphics adapters that are listed under the above mentioned links!
For the very adventurous, there is a way to modify Nvidia graphics adapters to register as professional Nvidia cards and thus enable VGA passthrough. See here: http://www.eevblog.com/forum/projects/hacking-nvidia-cards-into-their-professional-counterparts/ and http://www.eevblog.com/forum/projects/hacking-nvidia-cards-into-their-professional-counterparts/msg207550/#msg207550. Warning: If you do modify your hardware, you will loose all manufacturer warranty and take a big chance of turning your expensive VGA card into a brick! I won't take any responsibility for that. You have been warned.
If you are planning to build a new PC, this is the time to check for compatible hardware!
To be continued...





