无法使用virsh连接usb设备

时间:2015-03-07 10:38:13

标签: qemu kvm

我正在尝试使用virsh从主机ubuntu 12.10到OpenSuse 13附加ipad2 usb设备,它返回成功,但我无法在vm上找到它,有什么建议吗?

主持人:ubuntu 12.10
VM:OpenSuse 13

===HOST===

root@o-ubuntu-103:/image# more usb_ipad2.xml 
 <hostdev mode='subsystem' type='usb' managed='yes'>
  <source>
    <vendor id='0x05ac'/>
    <product id='0x129f'/>
  </source>
</hostdev>
root@o-ubuntu-103:/image# virsh attach-device suse13-001 usb_ipad2.xml 
Device attached successfully

root@o-ubuntu-103:/image# lsusb
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 003 Device 036: ID 05ac:129f Apple, Inc. iPad 2
Bus 003 Device 040: ID 04e8:6866 Samsung Electronics Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

===VM===

v-suse-33:/home/aaron # lsusb
Bus 001 Device 003: ID 0409:55aa NEC Corp. Hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd 
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

1 个答案:

答案 0 :(得分:0)

您可能想直接将USB设备与VM相连,或者使用virt-manager GUI(有一个图形界面来添加USB设备),或者添加看起来像这样的行

<hostdev mode='subsystem' type='usb' managed='yes'>
   <source startupPolicy='optional'>
     <vendor id='0x03f0'/>
     <product id='0x4217'/>
   </source>
 </hostdev>
 <!--- TIMBER !!! this depend upon your USB device and machine would fail
                  to start if you miss, use the GUI instead! --->

我读了这篇文章:https://askubuntu.com/questions/828823/virtual-machine-manager-error-did-not-find-usb-device