Bug 838993 - USBredir rejects USB thumb drive in SPICE guest using remote-viewer
USBredir rejects USB thumb drive in SPICE guest using remote-viewer
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: usbredir (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Hans de Goede
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-10 11:09 EDT by Bill Sanford
Modified: 2012-07-12 16:02 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-12 16:02:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshot of error message (531.99 KB, image/png)
2012-07-10 11:09 EDT, Bill Sanford
no flags Details
rhel7 qemu log file (35.64 KB, text/x-log)
2012-07-11 14:22 EDT, Bill Sanford
no flags Details

  None (edit)
Description Bill Sanford 2012-07-10 11:09:50 EDT
Created attachment 597373 [details]
Screenshot of error message

Description of problem:
USBredir rejects USB thumb drive in SPICE guest when using SPICE GTK and using remote-viewer.

The http://pastebin.test.redhat.com/96330 has the ps -ax | grep qemu output. 

Version-Release number of selected component (if applicable):
RHEL-7.0-20120709.0

How reproducible:
100%

Steps to Reproduce:
1. Start Virt-manager and add "Redirected USB" to the VM along with "Display Spice" and "Video" of QXL.
2. Start remote-viewer from terminal window (remote-viewer spice://<HOST_IP>?port=<PORT_IP>
3.
  
Actual results:
USB gets rejected by host

Expected results:
USB doesn't get rejected by host

Additional info:
Comment 1 Bill Sanford 2012-07-11 14:22:26 EDT
Created attachment 597648 [details]
rhel7 qemu log file
Comment 2 Hans de Goede 2012-07-12 05:13:54 EDT
Hi,

Looking at the qemu cmdline the problem is that you've not chanegd the usb controller type from the default usb-1 controller to a usb-2 controller. The qemu log confirms this:

qemu-kvm: Warning: speed mismatch trying to attach usb device USB Redirection Device to bus usb.0

So qemu refuses the redirected device since you're trying to plug a USB-2 device into a USB-1 (virtual) controller.

To fix this, start virt-manager, go to the details view of the vm and change the model of the "Controller USB" device to "USB 2"

That should fix things, if for some reason that does not help, you can try following the manual
instructions for adding usbredir support to a libvirt managed vm here:
http://hansdegoede.livejournal.com/11084.html

I'm going to close this as notabug under the assumption that changing the control model fixes things, if it does not please re-open.

Regards,

Hans

p.s.

If you want to redirect more then 1 device at the same time you will need to add more "USB Redirection" devices (up to a maximum of 5, 6 if you remove the tablet which you can do safely if you're using the spice agent inside the guest).
Comment 3 Bill Sanford 2012-07-12 09:26:19 EDT
When I change the "Controller USB" device to "USB 2" I get an dialog box with:

Authetication Required

Privileges are required for low level USB device access (for usb device pass through).

About a second after, I get the USB storage seen locally and not in the guest.
Comment 4 Hans de Goede 2012-07-12 10:47:59 EDT
(In reply to comment #3)
> When I change the "Controller USB" device to "USB 2" I get an dialog box
> with:
> 
> Authetication Required
> 
> Privileges are required for low level USB device access (for usb device pass
> through).

Good, that is expected, usbredir needs raw usb device access, bypassing things like file
system access setting on usb devices, etc. So by default the policykit policy for it requires
root authentication, so in that dialog enter your root password, or if you're part of the wheel
group your own password. You only need to give your password once per remote-viewer
session.

See this blog post for instructions to change the default policy so that no authentication
is required: 
http://hansdegoede.livejournal.com/11936.html

Note You need to log in before you can comment on or make changes to this bug.