Bug 1266231 - Grey out (disable) the "redirect usb" options in the Virtual Machine Manager (virt-manager)
Grey out (disable) the "redirect usb" options in the Virtual Machine Manager ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-manager (Show other bugs)
6.6
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-24 16:21 EDT by Peter Manzella
Modified: 2016-05-10 19:57 EDT (History)
20 users (show)

See Also:
Fixed In Version: virt-manager-0.9.0-30.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 19:57:52 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)

  None (edit)
Description Peter Manzella 2015-09-24 16:21:48 EDT
Description of problem:

After much research and testing, I have determined that the Virtual Machine Manager console does not support USB redirection when using Red Hat Enterprise Linux (RHEL) 6.6 and 6.7 as a client system. See the supporting information below.

The feature selection should be disabled in the Virtual Machine Manager.


Supporting Information
======================

Virtual Machine Manager Console (RHEL 6.6 and 6.7)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Based on testing, USB redirection does not work using the Virtual Machine Manager's integrated console in RHEL 6.6 and 6.7. This is documented in the RHEL 6 Virtualization Administration Guide.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-Guest_virtual_machine_device_configuration-USB_devices.html

Additionally, while testing redirection using the Virtual Machine menu, I receive the warning "There are no free USB channels" in the 'Select USB devices for redirection' dialog. This test was done with a single USB Redirection device.

With more than 1 USB Redirection device (2 to 4), it fails to redirect silently. It's worth noting that there is a check-mark next to the USB device in the 'Select USB devices for redirection' (Virtial Machine => Redirect USB device) dialog. This implies that the host attempted the redirection, but it was not attached to the guest OS in the console.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Version-Release number of selected component (if applicable):
virt-manager-0.9.0-29.el6.x86_64


How reproducible: 100%


Steps to Reproduce:
See above

Actual results:
Fails to redirect the USB device to the guest VM.

Expected results:
Should redirect the USB device to the guest VM.
Comment 3 Pavel Hrdina 2015-12-14 10:46:14 EST
Hi, I was investigating this bug and virt-manager uses Spice USB device selection widget, which do the whole USB redirect staff.  Moving to spice to get more investigation from their side, because spicy clinet works fine.
Comment 4 Fabiano Fidêncio 2015-12-14 10:59:41 EST
Pavel,

I am not familiar with virt-manager code at all, but what we do on virt-viewer is to check whether there's a USBREDIR channel and, in positive case, whether we have a SpiceUsbDeviceManager associated to the channel [0]. Based on this, we set a property in the session that will be used to gray out the usb redirection, if needed [1].

[0]: https://git.fedorahosted.org/cgit/virt-viewer.git/tree/src/virt-viewer-session-spice.c#n975
[1]: https://git.fedorahosted.org/cgit/virt-viewer.git/tree/src/virt-viewer-app.c#n924

I hope it helps you to fix your problem.
Comment 5 Fabiano Fidêncio 2015-12-15 04:06:16 EST
(In reply to Fabiano Fidêncio from comment #4)
> Pavel,
> 
> I am not familiar with virt-manager code at all, but what we do on
> virt-viewer is to check whether there's a USBREDIR channel and, in positive
> case, whether we have a SpiceUsbDeviceManager associated to the channel [0].
> Based on this, we set a property in the session that will be used to gray
> out the usb redirection, if needed [1].
> 
> [0]:
> https://git.fedorahosted.org/cgit/virt-viewer.git/tree/src/virt-viewer-
> session-spice.c#n975
> [1]:
> https://git.fedorahosted.org/cgit/virt-viewer.git/tree/src/virt-viewer-app.
> c#n924
> 
> I hope it helps you to fix your problem.

After talking to Pavel Hrdina, he pointed out that the problem is about USB Redirection not working and nothing related to gray-out the menus.
Comment 6 Fabiano Fidêncio 2015-12-15 04:22:03 EST
Peter,

Can you provide us some info about what kind of devices you're trying to redirect? No logs about the issue?
Comment 8 Uri Lublin 2015-12-15 10:39:58 EST
I just tried it on a RHEL 6.7 and it works for me, with 2 different
disk USB devices.

Win 7 x64 guest

virt-manager-0.9.0-29.el6.x86_64
virt-viewer-2.0-7.el6.x86_64
spice-gtk-0.26-4.el6.x86_64
spice-server-0.12.4-12.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6.x86_64

Note that "There are no free USB channels" appears after the redirection
action is taken. So if you have a single usbredir device after usbredir of
a USB device ("there is a check-mark next to the USB device") there are
no more free USB channels, meaning one can not usbredir more devices.
When USB devices are not allowed to usbredir, they are grey'ed out.

I tried 2 disk USB devices.

I tested a case with a single usbredir device, and a case with
two usbredir devices (and usbredir'ing 2 devices to the guest).

Can you please try to check if the guest "sees" the device ?
If a windows guest e.g. using Device Manager
If a Linux guest e.g. using lsusb

Does it work for you with a disk USB device ?
Comment 9 Peter Manzella 2015-12-15 11:15:06 EST
This bug only applies to the Virtual Machine Manager (virt-manager) console. The version used to open the bug is -

virt-manager-0.9.0-29.el6.x86_64

All testing was done using the integrated console of that product.

virt-viewer and/or remote-viewer are not related to this specific issue.
Comment 10 Uri Lublin 2015-12-15 11:57:43 EST
My testing was done also with virt-manager console.
Can you please test and answer the two questions in comment #8 ?

Also do you have (at least 2) "Controller USB" devices configured for your VM ?
You can also check this out with
virsh list --all # (possibly with sudo virsh)
virsh dumpxml $VMNAME | grep 'controller type=.usb'  # (possibly with sudo virsh)
Comment 11 Peter Manzella 2015-12-15 16:54:39 EST
I don't have all the details yet, but this appears to be an issue with device configuration using virt-manager 0.9.0.

I need to do some configuration tests and compare the XML of the guests.

I will post more when I have a better understanding.
Comment 14 ZhongXue 2015-12-21 02:39:01 EST
I can reproduce this on RHEL6.7, both on rhel6 guest and win7 guest, also with 2 different usb devices.

virt-manager-0.9.0-29.el6.x86_64
spice-gtk-0.26-4.el6.x86_64
spice-server-0.12.4-12.el6.3.x86_64

Steps:
1. On HostA, lunch virt-manager, create a remote connection to HostB
2. In HostA's virt-manager, run a guest of HostB
3. Plug a usb device in HostA, in guest console, click "Virtual Machine" -> "Redirct USB Device"
4. Choose the usb device from the pop up window, click "ok"
5. In guest, #lsusb

Expected Results:
The usb device can be redirected to the guest.

Actural Results:
USB Redirection failed silently.

With virt-manager updated to latest rhel6 version on HostA, this problem won't happen.

virt-manager-0.9.0-30.el6.x86_64
Comment 17 errata-xmlrpc 2016-05-10 19:57:52 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0860.html

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