How do I enable KVM device passthrough in Linux?

Solution 1:

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


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:

See also:

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

Solution 2:

Adding to Anonymouslemming's answer: There seems to be a bug in Ubuntu (18.04 for me), which causes the setting for GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub to be ignored.

It can be fixed by commenting out the GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.d/50-curtin-settings.cfg