Friday, April 09, 2010

Passthrough PCI Device in VM

Linux KVM/Xen support passthrough PCI device. It allows direct assign a PCI device to a virtual machine.

To do this, you need

1. check whether your hardware support VT-d. Here is the list of system that support VT-d.

2. You need to configure and comple the kernel to enable IOMMU support. Here is the procedure to enable VT-d in KVM.

3. Then you should create VM, and assign an PCI device to the VM.

I assigned intel 82571 nic to a VM and find the throughput reaches 930Mb/s easily with very little CPU consumed.

However, I am not quite familiar with the KVM or Xen management. Not quite familiar with bridging mode.

However, you cannot assign PCI device to the VM using libvirt.

Other references:

1. How To Compile A Kernel – The Ubuntu Way.

2. Hot Add PCI devices

3. Libvirt: Qemu/KVM hypervisor driver

4. Using Libvirt under Ubuntu