Linux - kvm - How to add multiple USB devices?
0) Close the Virtual Machine Manager or any instance of VM
1) Edit the xml config file from your VM
Example:
shell> vi /etc/libvirt/qemu/NAME_OF_YOUR_VIRTUAL_M ACHINE_HERE.xml
Add the following lines:
Example:
<devices> (do not include this line)
<emulator>/usr/bin/qemu-kvm</emulator> (do not include this line)
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0xeb1a'/>
<product id='0x2821'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x046d'/>
<product id='0x08d7'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x0ac8'/>
<product id='0x301b'/>
</source>
</hostdev>
3) Save and restart libvirt
shell> /etc/init.d/libvirtd restart
4) Now just start your VM and test if your usb was detectd:
shell from VM> lsusb
1) Edit the xml config file from your VM
Example:
shell> vi /etc/libvirt/qemu/NAME_OF_YOUR_VIRTUAL_M
Add the following lines:
Example:
<devices> (do not include this line)
<emulator>/usr/bin/qemu-kvm</emulator>
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0xeb1a'/>
<product id='0x2821'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x046d'/>
<product id='0x08d7'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x0ac8'/>
<product id='0x301b'/>
</source>
</hostdev>
3) Save and restart libvirt
shell> /etc/init.d/libvirtd restart
4) Now just start your VM and test if your usb was detectd:
shell from VM> lsusb

Comments