USB passthru for VM debian

Joined
Apr 14, 2021
Messages
5
Hello,

I installed a debian buster VM on my nas which is running in Truenas12 core version.
On this VM, I installed jeedom to manage my home automation.
To manage some devices, I want to use a conbee zigbee key.
Inspired by this example https://wiki.freebsd.org/bhyve/pci_passthru, I have, via the ihm truenas, add the variables vmm_load = "YES" and pptdevs = "0/20/0" in loader.conf.
I then added a passthru PCI device on my 0/20/0 pptdevs.
Then, when I connect a usb key (I tested different devices) the device is detected in my VM but I get these errors in dmesg
[ 8..214467] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[ 8.214726] usb 1-1: Device not responding to setup address.
[ 8.426653] usb 1-1: Device not responding to setup address.
[ 8.637994] usb 1-1: device not accepting address 5, error -71
[ 8.638074] usb usb1-port1: unable to enumerate USB device


Does anyone have the solution to make my USB ports work on my debian VM?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
add the variables vmm_load = "YES" and pptdevs = "0/20/0" in loader.conf.
If you want that to work after a reboot, you will need to set those as tunables... you may already find that they are gone.
 
Joined
Apr 14, 2021
Messages
5
If you want that to work after a reboot, you will need to set those as tunables... you may already find that they are gone.

Yes that's what i did but in my VM i have this error :
[ 8..214467] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[ 8.214726] usb 1-1: Device not responding to setup address.
[ 8.426653] usb 1-1: Device not responding to setup address.
[ 8.637994] usb 1-1: device not accepting address 5, error -71
[ 8.638074] usb usb1-port1: unable to enumerate USB device
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If I remember right, I think the current status is that you can't pass a single port through, you need to pass the entire USB controller (which implies that it can't be used for anything on the host).
 
Joined
Apr 14, 2021
Messages
5
I have pass the entire USB controller but it does not work.

ppt0@pci0:0:20:0: class=0x0c0330 card=0x7c081462 chip=0xa2af8086 rev=0x00 hdr=0x00
vendor = 'Intel Corporation'
device = '200 Series/Z370 Chipset Family USB 3.0 xHCI Controller'
class = serial bus
subclass = USB
 

mcmuller

Cadet
Joined
Sep 6, 2018
Messages
5
...same here with my Ubuntu-18 VM. Can see the controller inside the VM, but no devices attached to it.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Are you editing loader.conf for pptdevs? This won't work. You'll need to set a loader tunable, and then reboot.
 

boniek

Cadet
Joined
Feb 8, 2021
Messages
4
Yes, all is set in tunable and VM (Home Assistant Operating System) recognize device, but can't setup device. Tested on various usb devices.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Try another controller on the host. It's possible the host grabbed the XHCI controller earlier in the boot process than the loader entry.
 
Top