Proxmox VE USB Physical Port Mapping

Posted by admin on 26 五月, 2016 12:12

【作業環境】
Proxmox Virtual Environment 4.2


【USB 裝置列表】

~# lsusb

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 1398:ff04 Q-tec
Bus 001 Device 006: ID 0471:0999 Philips (or NXP)
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

如需查詢安裝埠別,則再加上參數「-t」…

~# lsusb -t

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 3: Dev 6, If 0, Class=Diagnostic, Driver=, 12M
        |__ Port 5: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
綜合上列查詢結果,顯示 USB 裝置連接至「Bus1,Port3」與「Bus1,Port5」,代號分別為 1-3 及 1-5。

~# vi /etc/pve/qemu-server/<VM_ID>.conf

設定內容可以 USB Port 作為裝置識別,如:
usb0: host=1-3
usb1: host=1-5

或以格式為 xxxx:xxxx 之「裝置 ID」加入設定項目:
usb0: host=1398:ff04
usb1: host=0471:0999

【連線狀態確認】

~# qm monitor <VM_ID>

qm> info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet, ID: tablet
  Device 1.0, Port 1, Speed 1.5 Mb/s, Product USB Host Device
  Device 1.0, Port 2, Speed 12 Mb/s, Product USB Host Device

其實,VM 作業系統啟動後,這些新加入的裝置能夠「即插即用」,應該比這個「qm monitor」查詢結果更重要吧。

【參考資料】
Proxmox VE Wiki - USB physical port mapping
Proxmox VE Wiki - USB Devices in Virtual Machines

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.