Hardware Passthrough with Proxmox

Hardware Passthrough with Proxmox

Introduction

Proxmox VE is a powerful, open-source platform. One of its incredible features is enabling IOMMU (Input-Output Memory Management Unit), which is crucial for tasks like passing through physical devices to virtual machines. This blog post will guide you through enabling IOMMU on Proxmox, enhancing your virtualization capabilities.

What is IOMMU and Why Enable It?

IOMMU is a system specific to the processor that allows virtual machines to interact directly with physical hardware devices. It plays a critical role in hardware virtualization, allowing for device pass-through. This means that specific hardware like GPUs, network cards, or storage controllers can be dedicated to a virtual machine, offering near-native performance.

This mainly benefits resource-intensive applications, gaming, or specialized hardware utilization. For me, this is important because I have virtualised my JellyFin server, and when I play videos on mobile devices, the VM can’t transcode the video streams fast enough, and I get buffering issues.

Prerequisites

Before proceeding, ensure you have:

  1. A Proxmox VE installed system.
  2. Hardware that supports IOMMU (most modern CPUs do).
  3. Backup of your Proxmox system (to prevent data loss in case of a misconfiguration).

Step-by-Step Guide to Enable IOMMU on Proxmox

  1. Check IOMMU Support: First, verify that your CPU supports IOMMU. You can access your system’s BIOS/UEFI and check for VT-d (Intel) or AMD-Vi (AMD) options.
  2. Enable IOMMU in BIOS/UEFI: Power up your server and enter the BIOS/UEFI setup. Enable settings named ‘Intel Virtualization Technology for Directed I/O (VT-d)’ or ‘AMD I/O Virtualization Technology (AMD-Vi)’.
  3. Configure Proxmox to Use IOMMU:
    • SSH into your Proxmox server or use the console.
    • Edit the GRUB configuration file by running: nano /etc/default/grub.
    • Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT.
    • Add intel_iommu=on or amd_iommu=on to this line (depending on your CPU).
    • Save and close the file.
  4. Update GRUB and Reboot:
    • Update GRUB with update-grub.
    • Reboot your Proxmox server for the changes to take effect.
  5. Verify IOMMU Activation:
    • After rebooting, SSH into your Proxmox server.
    • Run dmesg | grep -e DMAR -e IOMMU.
    • If IOMMU is enabled, you will see messages indicating its activation.
  6. Configure VMs for Device Pass-Through:
    • Access Proxmox’s web interface.
    • Select the VM you want to pass devices through.
    • Under ‘Hardware’, add the PCI device, ensuring the ‘All Functions’ checkbox is ticked if you’re passing through all components of a multi-function device.

Conclusion

Enabling IOMMU on Proxmox can significantly enhance your virtualization experience by allowing direct hardware access to VMs. This setup is ideal for high-performance tasks, specialized hardware applications, or gaming.

Remember, while enabling IOMMU is a powerful feature, it requires compatible hardware and careful configuration.

Another critical thing to note is that VMs that require the additional hardware you pass through to them will then be tied to that physical host, as it isn’t possible to move the hardware from one host to the other just by moving the VM.

Stephen

Hi, my name is Stephen Finchett. I have been a software engineer for over 30 years and worked on complex, business critical, multi-user systems for all of my career. For the last 15 years, I have been concentrating on web based solutions using the Microsoft Stack including ASP.Net, C#, TypeScript, SQL Server and running everything at scale within Kubernetes.