[Spice-devel] How do I redirect a USB stick with KVM?

ToddAndMargo ToddAndMargo at zoho.com
Wed May 13 23:25:44 PDT 2015


On 05/13/2015 01:35 PM, ToddAndMargo wrote:
> Hi All,
>
> I have KVM running Scientific Linux 6.6.
>
> I am following this guide:
> http://www.linux-kvm.org/page/USB_Host_Device_Assigned_to_Guest
>
> Server side:
> $ rpm -qa \*kvm\*
> qemu-kvm-0.12.1.2-2.448.el6_6.2.x86_64
>
> $ rpm -qa \*spice\*
> spice-client-0.8.2-15.el6.x86_64
> spice-gtk-python-0.22-7.el6.x86_64
> spice-vdagent-0.14.0-4.el6.x86_64
> spice-gtk-0.22-7.el6.x86_64
> spice-protocol-0.12.6-1.el6.noarch
> spice-glib-0.22-7.el6.x86_64
> spice-server-0.12.4-11.el6.x86_64
>
> I have a (Kingston) 16 GB USB 3flash drive inserted.
>
> $ lsusb | grep Kings
> Bus 010 Device 006: ID 0951:16a2 Kingston Technology
>
> I have a number of Fedora Core 21 Virtual Machines (VM)
> set up for various things.  I am trying to redirect this
> stick to one of them.
>
> In virt-manager, I have "Redircted USB" and/or "USB Host Device"
> set up. (Tried one, the other, and both.)
>
> Inside Fedora, lsusb and File Manager do not show the flash
> drive.
>
> Spice client is running:
> $ rpm -qa \*spice\*
> spice-vdagent-0.15.0-3.fc21.x86_64
>
> $ ps ax | grep spice
>    778 ?        Ss     0:00 /usr/sbin/spice-vdagentd
>   1463 ?        Ss     0:00 /usr/bin/spice-vdagent
>   1793 pts/0    S+     0:00 grep --color=auto spice
>
> What am, I doing wrong?
>
> Many thanks,
> -T
>
> Here is my VM's run string:
>
> $ ps ax | grep -i KVM-FC21
> 22045 ?        Sl     0:00 /usr/libexec/qemu-kvm -name KVM-FC21-LiveCD
> -S -M rhel6.3.0 -enable-kvm -m 2048 -realtime mlock=off -smp
> 4,sockets=4,cores=1,threads=1 -uuid 2e8f8714-9a52-34d2-4362-677bcb086747
> -nodefconfig -nodefaults -chardev
> socket,id=charmonitor,path=/var/lib/libvirt/qemu/KVM-FC21-LiveCD.monitor,server,nowait
> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
> -no-shutdown -boot order=c,menu=on -device
> piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device
> virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 -drive
> file=/home/kvm/Fedora-Live-Xfce-x86_64-21-5.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
> -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
> -drive
> file=/home/kvm/KVM-FC21-LiveCD.img,if=none,id=drive-virtio-disk0,format=raw,cache=none
> -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0
> -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:cb:e6:9e,bus=pci.0,addr=0x3
> -chardev pty,id=charserial0 -device
> isa-serial,chardev=charserial0,id=serial0 -chardev
> spicevmc,id=charchannel0,name=vdagent -device
> virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
> -device usb-tablet,id=input0 -spice
> port=5905,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga
> qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864
> -chardev spicevmc,id=charredir0,name=usbredir -device
> usb-redir,chardev=charredir0,id=redir0 -device
> usb-host,hostbus=10,hostaddr=6,id=hostdev0 -device
> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
>
>
>
>


Figured it out.  There is no support for my USB 3 controller:

$ lspci | grep -i usb
...
09:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host 
Controller (rev 02)


Moving the stick to my USB 2 controller and removing and re-adding the
stick in virt-manager makes the stick show up in the guest.




-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Spice-devel mailing list