分页: 1 / 1
kvm usb passthrough的问题
发表于 : 2014-08-23 11:30
由 hugebrush
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又正常了。
Re: kvm usb passthrough的问题
发表于 : 2014-08-23 21:43
由 hugebrush
问题解决了。
在virt-manger中创建的虚拟机,默认machine为pc-i440fx-trusty,改成q35就正常了。不过过程好麻烦:
virsh edit <虚拟机名>,修改machine参数,把所有pci设备给删除了,保存。再在virt-manager中打开虚拟机,手工添加缺失的设备,再用virsh edit <虚拟机名> 增加usb 控制器信息。然后,重装系统

Re: kvm usb passthrough的问题
发表于 : 2014-08-24 7:10
由 hugebrush
装完所有windows 7补丁,装个搜狗输入法和usb key驱动,发现usb 1.0 passthrough又有问题了
等有空在折腾了。
Re: kvm usb passthrough的问题
发表于 : 2014-08-24 17:51
由 langyxxl
可以试试passthrough显卡,玩游戏太爽了
Re: kvm usb passthrough的问题
发表于 : 2014-08-24 18:01
由 dongping_xie
usb支持貌似是有不少问题。我用的也是q35,
我懒得弄这个了,因为直接把usb控制器用vfio来passthrough到windows可以确保任何usb设备都可以被支持。
Re: kvm usb passthrough的问题
发表于 : 2014-08-26 13:17
由 hugebrush
暂时搞定:
给虚拟机配置三个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>