How to enable KVM device passthrough in Linux

kvm-virtualizationpassthrough

I have an MSI-GD65 Gaming motherboard and an Intel i7 4790. VT-D is enabled in the CPU Features section of the bios.

I'm running Ubuntu 14.04.1 LTS and when I try and detach a device, I get the following message:

# virsh nodedev-detach pci_0000_00_1f_2

error: Failed to detach device pci_0000_00_1f_2
error: Operation not supported: neither VFIO nor KVM device assignment is currently supported on this system

Dmesg includes some information about IOMMU but I can't tell if this means that VT-D is enabled

$ dmesg | grep -i iommu

[ 0.027450] dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap c0000020660462 ecap f0101a
[ 0.027455] dmar: IOMMU 1: reg_base_addr fed91000 ver 1:0 cap d2008020660462 ecap f010da
[ 0.027521] IOAPIC id 8 under DRHD base 0xfed91000 IOMMU 1

Can anyone advise what I need to do to enable VT-D on this system and pass through PCI devices to KVM guests please ?

Best Answer

The solution to this issue is to enable IOMMU in your GRUB boot parameters.

You can do this by setting the following in /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on"

If you're using an AMD processor, you should append amd_iommu=on to the boot parameters instead

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on"

Then run update-grub and reboot

This link helped me quite a bit: https://www.centos.org/forums/viewtopic.php?f=47&t=48115

See also: https://pve.proxmox.com/wiki/Pci_passthrough

This eluded me somewhat as I believed that iommu was an AMD alternative to VT-D.

Related Topic