Difference between revisions of "USB Physical Port Mapping"

From Proxmox VE
Jump to navigation Jump to search
(cosmetic changes)
m (reformat)
Line 1: Line 1:
*The main reason to use physical port mapping is to be able to connect several usb devices those have same IDs to different virtual machines (device-1 to VM1, device-2 to VM2, etc).
+
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).
*Currently (Stable version of Proxmox is 1.9) it's possible to map hardware usb port in a following way:
 
  
1. Find out physical port parameters (bus and port)
+
== Map hardware USB port ==
  
   qm monitor NNN
+
=== Find out physical port parameters (bus and port) ===
 +
 
 +
   qm monitor <VM_ID>
 
  qm&gt; info usbhost
 
  qm&gt; info usbhost
 
   '''Bus 3''', Addr 2, '''Port 1''', Speed 1.5 Mb/s
 
   '''Bus 3''', Addr 2, '''Port 1''', Speed 1.5 Mb/s
Line 11: Line 12:
 
     Class 00: USB device 0624:0248, USB Composite Device-0
 
     Class 00: USB device 0624:0248, USB Composite Device-0
  
2. Add the device to the particular VM (/etc/qemu-server/NNN.conf)
+
=== 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'''
 
   args: -device usb-host,hostbus='''3''',hostport='''1'''
  
or (as Proxmox 2.x supports usbN in vm.conf)  
+
Or this line (as Proxmox 2.x supports usbN in vm.conf):
  
 
   usb0: host='''3'''-'''1'''
 
   usb0: host='''3'''-'''1'''
  
3. Power off/power on VM and check
+
=== Reboot the VM ===
 +
 
 +
Check that the USB device is seen by the VM:
  
   qm monitor NNN
+
   qm monitor <VM_ID>
 
  qm&gt; info usb
 
  qm&gt; info usb
 
   Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
 
   Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
Line 27: Line 32:
 
   '''Device 0.4, Port 2.1, Speed 1.5 Mb/s, Product HASP 2.17'''
 
   '''Device 0.4, Port 2.1, Speed 1.5 Mb/s, Product HASP 2.17'''
  
More information:
+
== References ==
  
#[[Manual: vm.conf|man vm.conf]]  
+
*[[Manual: vm.conf|man vm.conf]]  
#http://www.kraxel.org/cgit/qemu/tree/docs/usb2.txt
+
*http://www.kraxel.org/cgit/qemu/tree/docs/usb2.txt

Revision as of 22:13, 27 April 2013

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

References