[SOLVED] Proxmox usb controller passthrough to VM

popaul

New Member
Nov 22, 2024
3
1
3
Hello!
I am having trouble with usb controller passthrough to my vm.

Currently, I am trying to set up TrueNAS on my N100 mini PC. I have an HDD connected through a USB port.
Based on what I’ve read in tutorials and articles, it seems that using USB controller passthrough provides the best performance since it bypasses virtualization.

I searched the Proxmox wiki for information but couldn’t find clear instructions on USB controller passthrough. I’ve looked at the following pages: PCI Passthrough, USB_Physical_Port_Mapping, USB_Devices_in_Virtual_Machines but the latter two seem to cover individual USB devices or ports, which I believe still involve virtualization. And the first one doesn't specifically explain how to passthrough a USB controller and instead points to USB_Physical_Port_Mapping.

Even searching through the Internet I see lots of information on ports or each devices but couldn't find information on usb controller itself

Code:
...
IOMMU Group 3:
        00:0d.0 USB controller [0c03]: Intel Corporation Device [8086:464e]
IOMMU Group 4:
        00:14.0 USB controller [0c03]: Intel Corporation Alder Lake-N PCH USB 3.2 xHCI Host Controller [8086:54ed]
        00:14.2 RAM memory [0500]: Intel Corporation Alder Lake-N PCH Shared SRAM [8086:54ef]
...

It seems that I could pass through Group 3 to the VM since it only contains a USB controller. (I believe [8086:464e] corresponds to a Type-C controller, so I plan to switch my USB device to use this port.)

Could anyone explain how to set up USB controller passthrough? Or provide a link to a guide that I might have missed?

Thank you in advance!
 
Could anyone explain how to set up USB controller passthrough? Or provide a link to a guide that I might have missed?
There is also the manual (which you can also read from the Proxmox web GUI): https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_pci_passthrough
Maybe just try selecting the 00:0d.0 device as a Raw Device when clicking Add > PCI Device in the VM Hardware settings in the Proxmox web GUI (as most of the setup mentioned in the manual are not always needed).
 
  • Like
Reactions: popaul
There is also the manual (which you can also read from the Proxmox web GUI): https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_pci_passthrough
Maybe just try selecting the 00:0d.0 device as a Raw Device when clicking Add > PCI Device in the VM Hardware settings in the Proxmox web GUI (as most of the setup mentioned in the manual are not always needed).
Thank you for your answer. I have read the manual you have provided and your advise on adding the PCI Device before changing the code.

The passthrough worked flawlessly! I didn't know that just doing "PCI device -> raw device" would allow passthrough of the controller bypassing virtualization.

I have one question on the manual. It says "It is okay if the device is in an IOMMU group together with its functions (e.g. a GPU with the HDMI Audio device) or with its root port or PCI(e) bridge." But from How do I add an entire USB controller to a VM? The reply was if they are in same IOMMU group it is not possible. So I thought doing "raw device" that has sharing IOMMU group has possibility of crashing but it is not correct?
 
I have one question on the manual. It says "It is okay if the device is in an IOMMU group together with its functions (e.g. a GPU with the HDMI Audio device) or with its root port or PCI(e) bridge."
You can ignore the PCIe bridges and other infrastructure chips, as VFIO will take care of it automatically.

But from How do I add an entire USB controller to a VM? The reply was if they are in same IOMMU group it is not possible. So I thought doing "raw device" that has sharing IOMMU group has possibility of crashing but it is not correct?
If you passthrough any of the devices (or functions of a device) to a VM then all devices in the same group are disconnected from the Proxmox host (and cannot be passed to another VM). This is for security isolation as devices in the same group can communicate without IOMMU or the CPU knowing about.
It's fine to passthrough all (or some) devices in the same IOMMU group to the same VM (and you can simply ignore PCIe bridges). You can also passthrough devices from several IOMMU groups to one VM. You cannot share devices in the same group between different VMs and/or the Proxmox host.
There is lots more talk about IOMMU groups on this forum and other places that talk about VFIO.
 
  • Like
Reactions: popaul
You can ignore the PCIe bridges and other infrastructure chips, as VFIO will take care of it automatically.


If you passthrough any of the devices (or functions of a device) to a VM then all devices in the same group are disconnected from the Proxmox host (and cannot be passed to another VM). This is for security isolation as devices in the same group can communicate without IOMMU or the CPU knowing about.
It's fine to passthrough all (or some) devices in the same IOMMU group to the same VM (and you can simply ignore PCIe bridges). You can also passthrough devices from several IOMMU groups to one VM. You cannot share devices in the same group between different VMs and/or the Proxmox host.
There is lots more talk about IOMMU groups on this forum and other places that talk about VFIO.
Ah thank you for the clarification. Guess I'll have to stick with using Group 3 rather than changing to Group4
 
  • Like
Reactions: leesteken

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!