USB physical port mapping

From Proxmox VE
Revision as of 23:13, 27 April 2013 by MathieuMD (talk | contribs) (reformat)
Jump to navigation Jump to search

The main reason to use physical USB port mapping is to be able to connect several usb devices which have the same IDs to different virtual machines (device-1 to VM1, device-2 to VM2, etc).

Map hardware USB port

Find out physical port parameters (bus and port)

 qm monitor <VM_ID>
qm> info usbhost
 Bus 3, Addr 2, Port 1, Speed 1.5 Mb/s
   Vendor Specific: USB device 0529:0001, HASP 2.17
 Bus 5, Addr 3, Port 2, Speed 12 Mb/s
   Class 00: USB device 0624:0248, USB Composite Device-0

Add the device to the VM

Edit the VM's configuration file /etc/pve/qemu-server/<VM_ID>.conf and add this line:

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

Or this line (as Proxmox 2.x supports usbN in vm.conf):

 usb0: host=3-1

Reboot the VM

Check that the USB device is seen by the VM:

 qm monitor <VM_ID>
qm> info usb
 Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
 Device 0.3, Port 2, Speed 12 Mb/s, Product QEMU USB Hub
 Device 0.4, Port 2.1, Speed 1.5 Mb/s, Product HASP 2.17