trying to usb passthru joystick

almiller

Member
Dec 1, 2020
21
0
21
58
I have ProxMox 7.2 on a Dell PowerEdge R710 and I'm trying to passthru
a USB1 device to my Debian 11 VM.

I was able to assign a USB2 camera but the joystick is not showing up on the VM.

On proxmox this is the device I want to assign to vm 104.

Bash:
root@pve ~ # usb-devices |less
T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  4 Spd=1.5 MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0079 ProdID=0006 Rev=01.07
S:  Manufacturer=DragonRise inc.
S:  Product=Generic   USB  Joystick
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#=0x0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

I tried both ways:
Bash:
root@pve ~ # qm set 104 -usb1 host=0079:0006
update VM 104: -usb1 host=0079:0006

AND
Bash:
root@pve ~ # qm monitor 104
Entering Qemu Monitor for VM 104 - type 'help' for help
qm> device_add usb-host,vendorid=0x0079,productid=0x006,id=usb1

and then rebooted my VM each time but I still don't see the joystick device.

Bash:
>cvm104 #  lsusb
Bus 002 Device 002: ID 32e4:4689 HD USB Camera HD USB Camera
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Sure.

Bash:
root@pve ~ # qm config 104
boot: order=scsi0;ide2;net0
cores: 6
cpu: kvm64
ide2: local:iso/debian-11.4.0-amd64-DVD-1.iso,media=cdrom
memory: 65536
name: debi11
net0: virtio=62:91:F6:25:A2:6F,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-104-disk-0,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=2eaa8e4e-9221-48d4-82b4-56f0535aa2d8
sockets: 2
usb0: host=32e4:4689
usb1: host=0079:0006
vmgenid: a55f0503-1296-42bf-97f4-4a3e3870ce34
 
Can you try only using pass-through for the keyboard without the webcam?
 
FYI: I added a different device and it's recognized along side the camera.

Bash:
root@pve ~ # qm set 104 -usb2 host=0909:0050
update VM 104: -usb2 host=0909:0050

root@pve ~ # qm config 104 |grep usb
usb0: host=32e4:4689
usb1: host=0079:0006
usb2: host=0909:0050

Bash:
❯ lsusb
Bus 002 Device 002: ID 32e4:4689 HD USB Camera HD USB Camera
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Oh, I see 0909:0050 was NOT recognized.

I removed them all, rebooted. Then did this:

the VM before assignments:
Code:
❯ lsusb
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

assigned the device from PVE
Code:
root@pve ~ # qm monitor 104
Entering Qemu Monitor for VM 104 - type 'help' for help
qm> device_add usb-host,vendorid=0x0079,productid=0x006,id=usb0

the VM after assignment:
Code:
❯ lsusb
Bus 001 Device 003: ID 0409:55aa NEC Corp. Hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Seems wierd, a different device shows up? What is 0409:55aa?

So I removed all usb devices again, rebooted.

After reboot
Code:
❯ lsusb
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Then added this one
Code:
root@pve ~ # qm monitor 104
Entering Qemu Monitor for VM 104 - type 'help' for help
qm> device_add usb-host,vendorid=0x0909,productid=0x0050,id=usb1

After assignment

Code:
❯ lsusb
Bus 001 Device 004: ID 0909:0050 Audio-Technica Corp. ATR4697-USB
Bus 001 Device 003: ID 0409:55aa NEC Corp. Hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

This time the correct device showed up BUT ALSO the NEC 0409:55aa device?
 
Another attempt. Removed all usb devices.

Assigned all 3 via the GUI via the port option
Screen Shot 2022-08-10 at 11.57.55 AM.png
After reboot 2 of the 3 are visible but not the joystick

Code:
❯ lsusb
Bus 002 Device 003: ID 32e4:4689 HD USB Camera HD USB Camera
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 0909:0050 Audio-Technica Corp. ATR4697-USB
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
What you could try if you have an USB hub, hand over the port that the USB Hub is connected to and see if this helps.

What I know of USB handover is that it is not that performant (aka more CPU intensive). Some recommend a PCIe passthrough of the USB controller to the VM.
 
Note that you cannot passthrough an entire USB hub. You can only passthrough a port on the USB hub, or each port separately. Sometimes adding a hub in between the host and the device can improve stability (especially then the hub has external power). I
have also noticeD that some (cheap) USB gamepads don't work with some type of USB controllers, or keep disconnecting and reconnecting. Using a hub can also help because it might have a different USB controller chip than the motherboard.
 
  • Like
Reactions: shrdlicka
I decided to toss the usb1.0 joystick into my cheap-hardware-junk-from-amazon pile.
After plugging the device into a "real" machine, I noticed it kept constantly connecting/disconnecting.

In the meantime I put a PCIe x4 USB3 card in my server and was able to passthrough the whole PCIe card to my VM.

Code:
root@pve ~ # dmesg | grep 'remapping'
[    1.219434] DMAR-IR: This system BIOS has enabled interrupt remapping
               interrupt remapping is being disabled.  Please
              
root@pve ~ # cat /etc/modprobe.d/iommu_unsafe_interrupts.conf
options vfio_iommu_type1 allow_unsafe_interrupts=1

root@pve ~ # lsmod |grep vfio
vfio_pci               16384  1
vfio_pci_core          73728  1 vfio_pci
vfio_virqfd            16384  1 vfio_pci_core
vfio_iommu_type1       40960  1
vfio                   45056  5 vfio_pci_core,vfio_iommu_type1
irqbypass              16384  50 vfio_pci_core,kvm

On the Proxmox server I don't see the usb devices at all but I've assigned the pci card to the VM

Code:
root@pve ~ # lsusb
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 002: ID 0624:0248 Avocent Corp. Virtual Hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

root@pve ~ # lspci |grep Renesas
04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

root@pve ~ # qm config 104
agent: 1
audio0: device=ich9-intel-hda,driver=spice
boot: order=scsi0;ide2;net0
cores: 6
cpu: kvm64
hostpci0: 0000:04:00.0
ide2: local:iso/debian-11.4.0-amd64-DVD-1.iso,media=cdrom
memory: 65536
name: debi11
net0: virtio=62:91:F6:25:A2:6F,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-104-disk-0,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=2eaa8e4e-9221-48d4-82b4-56f0535aa2d8
sockets: 2
vmgenid: a55f0503-1296-42bf-97f4-4a3e3870ce34

On the VM I see the PCI card and the 2 USB devices Camera and Microphone

Code:
❯ lspci |grep Renesas
00:10.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

❯ lsusb
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 0909:0050 Audio-Technica Corp. ATR4697-USB
Bus 002 Device 003: ID 32e4:4689 HD USB Camera HD USB Camera
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 

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!