[CentOS-virt] Attach USB drive (Re: Where is my qemu command?)

Wed Apr 27 09:12:14 UTC 2011
Jussi Hirvi <listmember at greenspot.fi>

Haha, I found a way to attach the USB drive to my kvm guest. It is a 
little cumbersome (involves editing the xml conf), but it works!! 
Victories seem to be far between, so better enjoy. :-)

http://david.wragg.org/blog/2009/03/using-usb-pass-through-under-libvirt.html

Limitations: you have to restart the guest, and the USB device must be 
attached at that time.

After mounting the usb drive on the guest, it took at least 10 seconds 
for it to appear at the mount point. First I thought the mount failed. 
When I came back to check, the contents was there.

- Jussi

On 27.4.2011 11.39, Jussi Hirvi wrote:
> KVM virtualization is full of wonders. :-/
>
> I would need to attach an USB disk to a vm, but how?
>
> The command "qemu" would provide a way:
>
> [root at a134-224 yum.repos.d]# man qemu-kvm
>
>> QEMU(1)
>> NAME
>>         qemu-doc - QEMU Emulator User Documentation
>>
>> SYNOPSIS
>>         usage: qemu [options] [disk_image]
> (...)
>>         -usbdevice devname
>>             Add the USB device devname.
>
> But when I try it:
>
> [root at a134-224 yum.repos.d]# qemu start -usbdevice host:059f:1018 mail
> -bash: qemu: command not found
>
> That command syntax is probably ot right yet, but the main question is,
> where is qemu?
>
> I was tempted to yum-install qemu from rpmforge, but I would rather not.
> Besides the rpmforge version has a conflict with another manual page.
>
> - Jussi
>
>


-- 
Jussi Hirvi * Green Spot
Suvilahdenkatu 1 B 78 * 00500 Helsinki * Finland
Tel. +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
jussi.hirvi at greenspot.fi * http://www.greenspot.fi