Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1266231

Summary: Grey out (disable) the "redirect usb" options in the Virtual Machine Manager (virt-manager)
Product: Red Hat Enterprise Linux 6 Reporter: Peter Manzella <pmanzell>
Component: virt-managerAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: ailan, cfergeau, chayang, dblechte, fidencio, jsuchane, juzhang, juzhou, meverett, mkenneth, mxie, mzhan, phrdina, rbalakri, tlavigne, tzheng, uril, virt-maint, xiaodwan, xzhong
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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 23:57:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Manzella 2015-09-24 20:21:48 UTC
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 15:46:14 UTC
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 15:59:41 UTC
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 09:06:16 UTC
(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 09:22:03 UTC
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 15:39:58 UTC
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 16:15:06 UTC
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 16:57:43 UTC
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 21:54:39 UTC
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 07:39:01 UTC
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 23:57:52 UTC
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