Jun
22
2012
Posted by ebal at
14:01:34
in planet_ellak, planet_Sysadmin
You need to attach a usb device to a libvirt domain without rebooting the virtual machine.
Lets figure this together:
- Locate the usb device:
# lsusb -v
idVendor 0x0781 SanDisk Corp.
idProduct 0x5567 Cruzer Blade
- Build the below XML:
usb_device.xml
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x0781'/>
<product id='0x5567'/>
</source>
</hostdev>
- Attach device
# virsh attach-device VIRTUAL_MACHINE usb_device.xml
and if you want to de-attach:
- De-attache device
# virsh detach-device VIRTUAL_MACHINE usb_device.xml
Tag(s):
libvirt