Ubuntu 14 LTS KVM VT-d passthrough with Z97 and i5-4590

kvm

Ha, that title looks ridiculous!

There are tons of tutorials on how to get VT-d working with KVM/libvirt/Qemu/etc. It’s still a fairly new and unused feature, which means that it is getting updated pretty frequently. Unfortunately, the Internet doesn’t update as quickly, so most of the documentation out there is not accurate or the best approach. This post serves as a snapshot of how I set up my system on September 14th, 2014.  As I make progress I’ll try to update this post. I hope it helps other people save some time. Good luck!

Most of this was discovered through these posts:

Goals

  • Intel onboard ethernet passthrough
  • GPU passthrough (not complete)

Setup

General steps

Enable vt-d on the host system

Add the following to /etc/modules:

vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel

Edit /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on"

Some instructions mention that you may also need an extra parameter:

GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1"

Disable AppArmor for libvirtd

ln -s  /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper

Reload and reboot

update-grub
reboot now

Configuring VM

I’ve added the configuration I’m using for my Windows 8 VM. I’m using webvirtmgr to manage it.

  • changed cpu mode to host-passthrough
  • added <hostdev> for passthrough Intel ethernet device