kvm usb passthrough的问题

Kvm、VMware、Virtualbox、Xen、Qemu 等
回复
hugebrush
帖子: 94
注册时间: 2008-03-05 21:58

kvm usb passthrough的问题

#1

帖子 hugebrush » 2014-08-23 11:30

virt-manager建立的虚拟机默认不支持usb 2.0,我通过USB passthrough使用插在宿主机上的USB key(usb 1.0)正常。
为了让虚拟机支持usb 2.0,我用virsh edit编辑虚拟机配置文件,增加了如下控制:

代码: 全选

  <controller type='usb' index='1' model='ehci'>
         <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </controller>
usb 2.0的设备正常passthrough了,usb1.0、1.1的设备passthrough不报任何错误,但是在windows 7 guest中看不到。只要把上述增加USB 2.0支持的配置给删了,usb 1.0 1.1设备passthrough又正常了。
hugebrush
帖子: 94
注册时间: 2008-03-05 21:58

Re: kvm usb passthrough的问题

#2

帖子 hugebrush » 2014-08-23 21:43

问题解决了。
在virt-manger中创建的虚拟机,默认machine为pc-i440fx-trusty,改成q35就正常了。不过过程好麻烦:
virsh edit <虚拟机名>,修改machine参数,把所有pci设备给删除了,保存。再在virt-manager中打开虚拟机,手工添加缺失的设备,再用virsh edit <虚拟机名> 增加usb 控制器信息。然后,重装系统 :em20
hugebrush
帖子: 94
注册时间: 2008-03-05 21:58

Re: kvm usb passthrough的问题

#3

帖子 hugebrush » 2014-08-24 7:10

装完所有windows 7补丁,装个搜狗输入法和usb key驱动,发现usb 1.0 passthrough又有问题了 :em19
等有空在折腾了。
头像
langyxxl
帖子: 443
注册时间: 2012-01-17 22:17

Re: kvm usb passthrough的问题

#4

帖子 langyxxl » 2014-08-24 17:51

可以试试passthrough显卡,玩游戏太爽了
dongping_xie
帖子: 5
注册时间: 2014-08-03 5:44

Re: kvm usb passthrough的问题

#5

帖子 dongping_xie » 2014-08-24 18:01

usb支持貌似是有不少问题。我用的也是q35,

我懒得弄这个了,因为直接把usb控制器用vfio来passthrough到windows可以确保任何usb设备都可以被支持。
hugebrush
帖子: 94
注册时间: 2008-03-05 21:58

Re: kvm usb passthrough的问题

#6

帖子 hugebrush » 2014-08-26 13:17

暂时搞定:
给虚拟机配置三个usb 1.1的控制器,目前正常了。

我的虚拟机USB控制器配置如下:

代码: 全选

    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>

回复