[SOLVED] Help: VM not booting with USB controller passthrough

ckiddo74

Member
Feb 8, 2023
4
1
8
Hi,

I have been using Proxmox for a week now on my workstation machine, which is probably not what most people use it for, but the experience has been amazing. I wanted to have a playground for developing Kubernetes and cloud apps, as well as having a seamless experience between both Windows and Linux. I managed to get everything I wanted, including passing-through my nvidia GPU and USB host controller to pass a range of USB devices (4K webcam, microphone) specifically for a VM. Thank you so much for the Proxmox team for this platform, and also the community for support as this can be quite overwhelming for a newbie.

There is one issue I am unable to figure out. The first time I try to passthrough my USB host controller, the VM hangs. I need to stop the VM, but the next time I run it, it runs perfectly. Inspecting dmesg, there a message that appears in the first time which does not appear the second time, and may be explain the issue:


Code:
[  429.468772] vfio-pci 0000:0c:00.3: refused to change power state from D0 to D3hot

This is my GRUB cmd line:

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on vfio-pci.ids=10de:1b06,10de:10ef,1022:149c"

where:

Bash:
lspci -n | grep "0c:00.3"

gives:

Code:
0c:00.3 0c03: 1022:149c

Is there anything I can do to configure the passthrough correctly?
 
Last edited:
Alright. Got the USB controller (+ GPU + sound controller) to passthrough without a glitch.

The issue was that xhci_hcd driver took over the USB controller instead of vfio-pci. I am not really sure how to blacklist a driver for a particular PCI. But I managed to solve it by simply using the driverctl tool:

driverctl set-override 0000:0c:00.3 vfio-pci
driverctl set-override 0000:0c:00.4 vfio-pci

After a reboot, lspci -v gives me:

0c:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller (prog-if 30 [XHCI])
...
Kernel driver in use: vfio-pci
Kernel modules: xhci_pci

0c:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel

And no problems since!
 
  • Like
Reactions: leesteken
The issue was that xhci_hcd driver took over the USB controller instead of vfio-pci. I am not really sure how to blacklist a driver for a particular PCI. But I managed to solve it by simply using the driverctl tool:
Thank you for sharing this solution (which I did not know yet). Adding a softdep xhci_pci pre: vfio-pci to the early binding of the device to vfio-pci should also works,
 
  • Like
Reactions: ckiddo74