Introduction

Here's a How To on creating a VGA passthrough for a Windows 7 guest. I spent a lot of time trying to get it to work. First with XEN: I couldn't get a straight forward HVM going even without a passthrough, and starting a guest would sometimes reboot my host machine! Then I tried KVM on Debian Squeeze: at least I could install Windows 7 and access it with a VNC session. I could not get the passthrough to work.

Eventually I tried Wheezy: and it almost works out of the box. I'll give you the steps to point you in the right direction, so you don't have to repeat my mistakes. I can't garentee that this will work for your particular setup, but I hope that if it doesn't, you'll be far enough along that it won't take to much more effort to get it going.

My understanding is that some graphics card will not work. Drivers may be written, and hardware designed, with assumptions in mind that aren't the case under virtualization and passthrough. You must also have support for hardware virtualization on your cpu and your *motherboard*.

I've sometimes found it difficult to find useful information on the internet to solve my VGA passthrough related problems. To help change this, I'll post the steps that I've found to be successful.

My Hardware

Not that you need to have my exact hardware, but it may be helpful to know that this worked if you have similiar hardware or decide to run out and buy new hardware.

Hardware Setup

Restart your machine and enter the BIOS. Make sure virtualization support is enabled (this is for the CPU). Also, make sure that VT-d (intel) or IOMMU (AMD) is enabled.

If you can, verify that your CPU supports virtualization. If you already have Linux installed or a Live CD, check support as follows.

For AMD processors and motherboards:

cat /proc/cpuinfo | grep "smc"

For intel processors and motherboards:

cat /proc/cpuinfo | grep "vmx"

Host OS Installation

Install Debian Wheezy. Make sure the desktop environment is installed. After the installation is complete and you've rebooted, install KVM and libvirt.

aptitude install qemu-kvm libvirt-bin

Then install virt-manager, a user interface for creating, starting and amanaging virtual machines.

aptitude install virt-manager