USB Passthrough to VM not working

digitalgimpus

Member
Apr 14, 2017
3
0
21
81
If i do lsusb on the host I see the device:

Code:
root@pve:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 009: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

0bda:2838 is the one I care about here.

Code:
root@pve:~# qm config 104
agent: 1
balloon: 512
bootdisk: ide0
cores: 1
cpu: host
ide0: local-lvm:vm-104-disk-1,size=32G
ide2: none,media=cdrom
localtime: 1
memory: 1024
name: myvm
net0: e1000=4A:D1:62:96:87:4B,bridge=vmbr0
numa: 0
onboot: 1
ostype: l26
smbios1: uuid=970a7fbc-ad37-4824-a4c1-f49c01271009
sockets: 4
usb0: host=0658:0200
usb1: host=0a12:0001
usb2: host=0bda:2838,usb3=yes

Ok, it's assigned to usb2... usb0 and usb1 have existed before and work fine. I tried as both usb and usb3. No difference.

Lastly
Code:
root@pve:~# qm monitor 104

Entering Qemu Monitor for VM 104 - type 'help' for help

qm> info usbhost
  Bus 1, Addr 9, Port 5, Speed 480 Mb/
    Class 00: USB device 0bda:2838, RTL2838UHIDIR
  Bus 1, Addr 4, Port 9, Speed 12 Mb/s
    Class e0: USB device 0a12:0001, CSR8510 A10
  Bus 1, Addr 6, Port 4.4.1, Speed 1.5 Mb/s
    Class 00: USB device 05ac:0220, Apple Keyboard
  Bus 1, Addr 2, Port 3, Speed 12 Mb/s
    Class 02: USB device 0658:0200

So I'm really not sure what to try next to get this device to passthrough successfully.

Running
pve-manager/4.3-12/6894c9d9 (running kernel: 4.4.24-1-pve)

The VM is Ubuntu 16.04 4.4.0-72-generic
 
what happens when you start the vm? do you see it in the vm with lsusb and its not working? or it is absent in the vm altogether? does it not start with an error?
since the device seems to be a usb2 device (the 480Mb part), usb3 makes no sense to use

also you are running an outdated version, i would recommend that you upgrade your host
 
I have 4 USB ports assigned to a VM (Windows 10) as in the config file (1), Proxmox VE 5.1.
All of them are working. Tested with USB keyboard and USB mouse.

usb0 and usb1 are USB 2.0 ports.
usb2 and usb3 are USB 3.0 ports.


1. File: "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12
usb3: host=3-11


If i config the VM with the following settings (2), having usb2 and usb3 configured as USB 3 ports, all ports are not working (usb0, usb1, usb2, usb3).

2. File: "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12,usb3=yes
usb3: host=3-11,usb3=yes


Code:
# lspci | grep -i USB
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)

# lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 6: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M
    |__ Port 8: Dev 8, If 0, Class=Human Interface Device, Driver=, 1.5M
    |__ Port 8: Dev 8, If 1, Class=Human Interface Device, Driver=, 1.5M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
 
I have 4 USB ports assigned to a VM (Windows 10) as in the config file (1), Proxmox VE 5.1.
All of them are working. Tested with USB keyboard and USB mouse.

usb0 and usb1 are USB 2.0 ports.
usb2 and usb3 are USB 3.0 ports.


1. File: "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12
usb3: host=3-11


If i config the VM with the following settings (2), having usb2 and usb3 configured as USB 3 ports, all ports are not working (usb0, usb1, usb2, usb3).

2. File: "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12,usb3=yes
usb3: host=3-11,usb3=yes


Code:
# lspci | grep -i USB
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)

# lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 6: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M
    |__ Port 8: Dev 8, If 0, Class=Human Interface Device, Driver=, 1.5M
    |__ Port 8: Dev 8, If 1, Class=Human Interface Device, Driver=, 1.5M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M

I found that in "qm monitor", "info usbhost" reports different results for the same physical port, depending on the connected USB type device.

For example, at the same physical port:
-USB 2 device:
qm> info usbhost
Bus 3, Addr 9, Port 11, Speed 1.5 Mb/s
Class 00: USB device xxxx:xxxx, USB Keyboard

-USB 3 device:
qm> info usbhost
Bus 4, Addr 3, Port 1, Speed 5000 Mb/s
Class 00: USB device xxxx:xxxx, ADATA USB Flash Drive


In my case if i add "usb3=yes" parameter, all ports will not work.

All ports are not working, "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12
usb3: host=3-11
usb4: host=4-1,usb3=yes
usb5: host=4-2,usb3=yes


All ports are working, "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12
usb3: host=3-11
usb4: host=4-1
usb5: host=4-2

Code:
USB ports available:
Type / Port :   #1,   #2,   #3,   #4
USB 2       : usb0, usb1, usb2, usb3
USB 3       :  n/a,  n/a, usb5, usb4
 
I solved my usb problems and headache first with:
anywhereusb https://www.digi.com/products/usb-and-serial-connectivity/usb-over-ip-hubs
then with:
virtualhere https://www.virtualhere.com/ (cheaper and stable)

I never found usb dongle or peripherals not working on them.
If you choose those solutions, choose a good usb hub (industrial grade).
Actually i've a cluster (so I can't use usb connected directly to host cause of migrations) with 14 devices (two 7 port hubs on a nas) connected to different VM
 
I found that in "qm monitor", "info usbhost" reports different results for the same physical port, depending on the connected USB type device.

For example, at the same physical port:
-USB 2 device:
qm> info usbhost
Bus 3, Addr 9, Port 11, Speed 1.5 Mb/s
Class 00: USB device xxxx:xxxx, USB Keyboard

-USB 3 device:
qm> info usbhost
Bus 4, Addr 3, Port 1, Speed 5000 Mb/s
Class 00: USB device xxxx:xxxx, ADATA USB Flash Drive


In my case if i add "usb3=yes" parameter, all ports will not work.

All ports are not working, "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12
usb3: host=3-11
usb4: host=4-1,usb3=yes
usb5: host=4-2,usb3=yes


All ports are working, "/etc/pve/qemu-server/100.conf":
usb0: host=3-8
usb1: host=3-7
usb2: host=3-12
usb3: host=3-11
usb4: host=4-1
usb5: host=4-2

Code:
USB ports available:
Type / Port :   #1,   #2,   #3,   #4
USB 2       : usb0, usb1, usb2, usb3
USB 3       :  n/a,  n/a, usb5, usb4
I had some issues with the host and the vm has broken (i don't know why...).
I restored the vm with a snapshot, but now i can't use all USB ports as i did before, "usb5: host=4-2" is missing from config file.
I tried to add again the missing port in vm's config file, but it doesn't work...

@latosec , did you tried an alternate solution like this one: http://usbip.sourceforge.net/ ?
 
Once i had six working USB ports passed through the VM, but now i can't add more than five USB ports because "USB Device" from "Add" button is disabled.
I'm wonder if this is a bug or a limitation feature in PVE 5.1-43.
 

Attachments

  • usb_ports.png
    usb_ports.png
    28.2 KB · Views: 64
Last edited:

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!