注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

從頭再來 Blog

一切將會如小生命的誕生一樣,從頭再來.....

 
 
 

日志

 
 

Proxmox 虚拟机使用实体机USB接口  

2013-06-26 16:46:17|  分类: Proxmox |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
以下内容与主题无关:
在Proxmox mount ntfs格式的移动硬盘
#apt-get install ntfs-3g
#mount -t ntfs /dev/sda1 /mnt/usb

---------------------------   以下才是主题的正文 ------------------

Map hardware USB port

Find out physical port parameters (bus and port)

Through Qemu/KVM tool (simpler)

qm monitor <VM_ID>
qm> info usbhost
 Bus 3, Addr 2, Port 1.2, 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
  • Example: Bus 3, Port 1.2 => 3-1.2

Or from the host

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/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 5, If 0, Class=comm., Driver=usbfs, 480M
        |__ Port 3: Dev 5, If 1, Class=data, Driver=usbfs, 480M
  • Example 1: Bus 3, Port 1 => 3-1
  • Example 2: Bus 1, Port 1, Port 3 => 1-1.3

Add the device to the VM

Proxmox 2.x and later

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

  • Example:
 usb0: host=3-1.2
  • Examples 1 & 2:
 usb0: host=3-1
 usb1: host=1-1.3

Proxmox 1.x

  • Example 1:
 args: -device usb-host,hostbus=3,hostport=1.2
  • Example 1:
 args: -device usb-host,hostbus=3,hostport=1
  • Example 2:
 args: -device usb-host,hostbus=1,hostport=1.3

Stop and restart the VM

Stop and start the VM (a reboot is not enought).

Check that the USB devices are 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 1.1, Port 1, Speed 1.5 Mb/s, Product HASP 2.17
 Device 1.0, Port 2, Speed 480 Mb/s, Product USB Host Device
  评论这张
 
阅读(588)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017