PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different VM.

JMoreno

Renowned Member
Oct 26, 2011
53
2
73
ProxMox 2.1-1

[ISSUE SOLVED -- Please read the following posts] --- [RE-OPEN on 12-11-06] Post #8

Hi there,

I have two USB keys (two different licenses of a program) which I am trying to forward to two different VM machines. The licenses (ie USB keys) need to be shared via the network to the final users. Only one USB key can be binded to a machine (let's say a Windows XP machine), this a restriction from the software provider.

Based on all above, I am creating two different XP VM machines. My intention is to bind a USB key to a XP machine, same approach for the second pair USB Key/XP machine.

I edited the conf file of one of the VM machines, adding:

PHP:
----> usb0: host=04b9:0300
---> Next line executed in the VM Monitor.
# info usbhost
  Bus 3, Addr 3, Port 1, Speed 1.5 Mb/s
    Vendor Specific: USB device 04b9:0300, USB UltraPro
  Auto filters:
    Bus *, Addr *, Port *, ID 04b9:0300

And it worked!! The problem came when I tried to forward the second USB key to the second VM. Both USB keys have the same vendor and product id (04b9:0300), as consecuence ProxMox can not differenciate them.

Well, I stopped one of the VM and I removed one of the USB keys. I modified the VM conf file adding:

PHP:
----> usb0: host=3-3.1
---> Next line executed in the VM Monitor.
# info usbhost
  Bus 3, Addr 3, Port 1, Speed 1.5 Mb/s
    Vendor Specific: USB device 04b9:0300, USB UltraPro
  Auto filters:
    Bus 3, Addr *, Port 3.1, ID *:*

But the USB keys is not found by the VM. I have tried different values replacing 3-3.1, but I can not make it work. Differences among the last line in both reports may give a tip.

I am providing you the results from the lsusb command run in the Proxmox server:

PHP:
----> lsusb in ProxMox server
# lsusb
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 003: ID 04b9:0300 Rainbow Technologies, Inc. SafeNet USB SuperPro/UltraPro
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

----> lsusb -t in ProxMox server
# lsusb -t
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 1: Dev 3, If 0, Class=vend., Driver=usbfs, 1.5M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M

May you please help me on this issues?

Many thanks in advance.
 
Last edited:
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

If vendor-IDs are the same, maybe use physical port addresses (..but you cannot swap the dongles in their physical ports anymore after that)
...haven't tried myself but have a look here: http://www.kraxel.org/cgit/qemu/tree/docs/usb2.txt
The interesting part in your case starts from line 112 "USB pass through hints"...
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Hi, thanks for your reply.

I can not understand why but, even after reading your link, I am unable to make it work.

Please, some help! Thanks.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

...you'll need to pass that kind of config with the "args:" argument inside the vm config file.
I did a short test with a USB stick in my test-system (which is a laptop, so don't get confused about the load of USB devices listed).

Code:
# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[B]Bus 002 Device 007: ID 05dc:a810 Lexar Media, Inc.[/B]
Bus 002 Device 005: ID 17ef:1003 Lenovo Integrated Smart Card Reader
Bus 002 Device 004: ID 05c6:9204 Qualcomm, Inc.
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 17ef:480f Lenovo Integrated Webcam [R5U877]
Bus 001 Device 004: ID 0a5c:217f Broadcom Corp. Bluetooth Controller
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
#

...the Stick I added is a Lexar Firefly...marked in BOLD above.

Code:
#lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M
[B]        |__ Port 2: Dev 7, If 0, Class=stor., Driver=usbfs, 480M[/B]
        |__ Port 4: Dev 4, If 1, Class=vend., Driver=qcserial, 480M
        |__ Port 5: Dev 5, If 0, Class=scard, Driver=, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M
        |__ Port 3: Dev 3, If 0, Class=vend., Driver=, 12M
        |__ Port 4: Dev 4, If 0, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M
        |__ Port 4: Dev 4, If 1, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M
        |__ Port 4: Dev 4, If 2, Class=vend., Driver=, 12M
        |__ Port 4: Dev 4, If 3, Class=app., Driver=, 12M
        |__ Port 6: Dev 5, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
        |__ Port 6: Dev 5, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
#

..as you can see..it is behind a hub...so hostbus = 2, hostport=1.2...and it is a USB2.0 device...so adding an ehci Device into the VM is in order.

The vm config would then look like this:
Code:
# cat 100.conf
bootdisk: virtio0
cores: 2
cpu: host
ide2: esxi-15:iso/debian-6.0.5-amd64-netinst.iso,media=cdrom
memory: 2048
name: debian-6
net0: virtio=3A:5C:16:DC:56:1A
ostype: l26
sockets: 1
virtio0: local:100/vm-100-disk-1.raw
[B]args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=2,hostport=1.2
[/B]
#

...and inside the VM, one can see the Lexar stick allright:



...based on what you've been given away in your lsusb -t listing, I'd gather that you don't need ehci, just usb.
So, maybe try:

Code:
args: -usb -device usb-host,bus=usb.0,hostbus=3,hostport=1
in the config file of the VM for that said stick.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Excellent!!

Following your detailed explanation, one of the VM has recognized the USB key. Tomorrow (CET), I am pluging the second USB key and try to bind it to the second VM. I am already at home, as consecuence I can not make this physical action ;-)

Thanks so much for your kind help and detailed explanation.

PS: I am reporting after my trials for other users interests.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

As promissed, here is my final report:

Finally, both USB keys are working in their independent VMs.

This is the my usb configuration (run from the PMox server):

# lsusb -t
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 5, If 0, Class=vend., Driver=usbfs, 1.5M
|__ Port 2: Dev 6, If 0, Class=vend., Driver=usbfs, 1.5M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M

Both USB keys are USB 1 type.

For WMID 101 I added the following line (in 101.conf) for accessing USB key listed in blue:

args: -usb -device usb-host,bus=usb.0,hostbus=3,hostport=1

For WMID 102 I added the following line (in 102.conf) for accessing USB key listed in cyan:

args: -usb -device usb-host,bus=usb.0,hostbus=3,hostport=2

Thanks so much to p3x-749 for his kind and usefull help.

Regards.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

...glad that it worked out for you and thanks for reporting back.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Hi, I am back again !! ;-)

After upgrading the PVE

# pveversion -v
pve-manager: 2.2-26 (pve-manager/2.2/c1614c8c)
running kernel: 2.6.32-12-pve
proxmox-ve-2.6.32: 2.2-80
pve-kernel-2.6.32-11-pve: 2.6.32-66
pve-kernel-2.6.32-16-pve: 2.6.32-80
lvm2: 2.02.95-1pve2
clvm: 2.02.95-1pve2
corosync-pve: 1.4.4-1
openais-pve: 1.1.4-2
libqb: 0.10.1-2
redhat-cluster-pve: 3.1.93-1
resource-agents-pve: 3.9.2-3
fence-agents-pve: 3.1.9-1
pve-cluster: 1.0-28
qemu-server: 2.0-64
pve-firmware: 1.0-21
libpve-common-perl: 1.0-37
libpve-access-control: 1.0-25
libpve-storage-perl: 2.0-34
vncterm: 1.0-3
vzctl: 4.0-1pve2
vzprocps: 2.0.11-2
vzquota: 3.1-1
pve-qemu-kvm: 1.2-7
ksm-control-daemon: 1.1-1

I get the following error message at booting the KVM:

# qm start 553
kvm: -device usb-host,bus=usb.0,hostbus=3,hostport=1: Bus 'usb.0' not found

This is the .conf file I had since August (which worked perfectly after serveral shutdowns of the KVM):

# cat /etc/pve/nodes/pmox5/qemu-server/553.conf
args: -usb -device usb-host,bus=usb.0,hostbus=3,hostport=1
bootdisk: ide0
cores: 1
cpu: qemu32
ide0: local:553/vm-553-disk-1.qcow2
ide2: none,media=cdrom
memory: 1024
name: cype1
net1: virtio=E6:08:C1:EE:34:28,bridge=vmbr0
onboot: 1
ostype: wxp
sockets: 1
startup: order=510

This is my USB configuration:

# lsusb -t
3-1:1.0: No such file or directory
3-2:1.0: No such file or directory
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 5, If 0, Class=vend., Driver=, 1.5M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M

It must be said that the output of runnig the above command before was (your attention to text in blue, which is missing now):

# lsusb -t
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 5, If 0, Class=vend., Driver=
usbfs, 1.5M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M

May you please help again?
Thanks.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Please, any advice?

Thanks.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Aplogizes for insisting, but I got no luck in my research. May you please...?

Thanks
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Code:
cat /etc/pve/qemu-server/501.conf bootdisk: ide0
cores: 1
ide2: none,media=cdrom
memory: 1024
name: Win2003
net0: virtio=2E:AF:B0:F7:0E:7C,bridge=vmbr0
ostype: wxp
sockets: 1
[COLOR=#ff0000][B]usb0: host=067b:2303[/B][/COLOR]
virtio0: local:501/vm-501-disk-1.raw,size=32G

This should work. Just replace id's.
 
Re: PROBLEM:Two USB keys (same brand/model) trying to be forwarded to two different V

Many thanks snowman66. Your help solved my problem.

Let me sumarized the solution:

# lsusb -t
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 4, If 0, Class=vend., Driver=usbfs, 1.5M
|__ Port 2: Dev 5, If 0, Class=vend., Driver=usbfs, 1.5M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M

In the first VM conf file I added:

PMox1.9 ==>> args: -usb -device usb-host,bus=usb.0,hostbus=3,hostport=1
PMox 2.x ==> usb0: host=3-1

In the second VM conf file I added:

PMox1.9 ==>> args: -usb -device usb-host,bus=usb.0,hostbus=3,hostport=2
PMox 2.x ==> usb0: host=3-2

My XP machines are perfectly working, each one with its corresponding USB key (same brand/model).

Thank you so much!!

PS: I apologizes for my late summary, I've been off for a while.
 

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!