KVM usb passthrough Configuration
KVM usb passthrough is to directly use the usb interface of the host machine to the virtual machine, and the devices on the usb interface can be used directly on the virtual machine.
Test Environment
Host Machine 1 CentOS 6.6 64-bit kernel version 2.6.32-431.1.2.0.1.el6.x86 _ 64
Host Machine 2 Fedora 21 kernel version 3.17.2-300. fc21.x86 _ 64
Virtual Machine windows 7 64-bit
Configuration method
Step 1: Use lsub or virt-manager to check which USB ports are available.
Lsusb
Bus 001 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 03f0: 1027 Hewlett-Packard Virtual keyboard and mouse
Bus 001 Device 002: ID 058f: 6387 Alcor Micro Corp. Flash Drive
Tue Dec 16 12:45:21 CST 2014
Step 2: Pass the required usb interface to the VM
The xml configuration file is
<Hostdev mode = 'subsystem' type = 'usb 'managed = 'yes'>
<Source>
<Vendor id = '0x058f'/>
<Product id = '0x6387 '/>
<Address bus = '1' device = '2'/>
</Source>
<Alias name = 'hostdev0'/>
</Hostdev>
Step 3 Test
A strange phenomenon was found during the test. The USB flash disk cannot be identified on Windows 7 of centos6 host machine.
However, if it is a centos6 virtual machine, the USB flash drive can be used normally. At first, we thought it was a problem with the Windows 7 driver. However, after trying various drivers, the problem persists.
Later, I tried the Windows 7 Virtual Machine on fedora21. I can directly use it after I plug in the USB flash drive.
Do not even make any configuration, it should be related to the usb forwarder on fedora, it seems that the new version has made a lot of improvements.
-------------------------------------- Split line --------------------------------------
RHEL6 KVM virtualization creates a bridge NIC-Bridge
RedHat Linux KVM Virtual Machine bridging
Installation/bridging settings of KVM in CentOS 5.6/virtual machine creation and operation
The/bin/qemu-KVM problem cannot be found when the kvm virtual machine is installed with libvirt In Ubuntu.
Install and configure the KVM Virtual Machine in RedHat6.5
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: