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 923567 - Enable auto-redir in virt-manager
Summary: Enable auto-redir in virt-manager
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Gunannan Ren
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 807277
Blocks: 1083163 782183 840699 853317
TreeView+ depends on / blocked
 
Reported: 2013-03-20 05:45 UTC by hyao@redhat.com
Modified: 2018-12-09 16:58 UTC (History)
15 users (show)

Fixed In Version: virt-manager-0.10.0-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 807277
Environment:
Last Closed: 2014-06-13 12:11:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
debug info from virt-manager when redirect RSA usb (6.40 KB, text/plain)
2013-09-06 06:53 UTC, tingting zheng
no flags Details

Comment 6 Gunannan Ren 2013-06-24 13:11:27 UTC
The spice-gtk client library has done most of work, so it becomes relatively easy for virt-manager support
Patch sent out
https://www.redhat.com/archives/virt-tools-list/2013-June/msg00114.html

Comment 7 Gunannan Ren 2013-07-02 11:19:46 UTC
commit 88f2d1abe0ffecdf606acbf5f473034d858dc6db
Author: Guannan Ren <gren>
Date:   Mon Jul 1 14:33:59 2013 -0400

    details: Add auto USB redirection support in console viewer
    
    Add "Redirect USB device" option in console viewer. Initialize and
    embed UsbDeviceWidget object from SpiceClientGtk into a dialog to
    let user choose available USB devices for redirection.
    Throw an error message if USB connection failed.
    Auto-redirection is enable by default.
    
    There is race between creating usbredir channel and calling
    has_usb_redirection() when initializing spice session like
    happening on virt-viwer. So adding a new signal handler
    on_details_menu_virtual_manager_activate() to recheck the
    status of usbredir channel, set "Redirect USB device" option
    sensitive if it is availiable.

commit d6fc079ae88da2433ae257b25e58f48403b78cf7
Author: Guannan Ren <gren>
Date:   Mon Jul 1 14:33:06 2013 -0400

    error: use helper function to embed customized widget into dialog

Comment 12 hyao@redhat.com 2013-08-15 03:35:39 UTC
I listed issues I met and reassined the bug. 
BTW, please let me know if we need to open new bugs to cover the following issues since they make  the bug huge and not easy to read, in my opinion.

Version-Release number of selected component (if applicable):
# rpm -qa libvirt virt-manager
libvirt-1.1.1-2.el7.x86_64
virt-manager-0.10.0-2.el7.noarch

Scenario 1:
"--spice-disable-usbredir" option is missing in virt-manager manual.

How reproducible:
100%
Steps:
1. virt-manager --help | grep usbredir -A 2
  --spice-disable-usbredir
                        Disable USB redirection support
2.# man virt-manager | grep usbredir
Actual results:
"--spice-disable-usbredir" option is missing in virt-manager manual.
Expected results:
Offer detail description of --spice-disable-usbredir option. 


Scenario 2:
USB device is redirected to guest even when launching virt-manager with "--spice-disable-usbredir" option

How reproducible:
100%

Steps:
1. launch virt-manager with "--spice-disable-usbredir" option
#virt-manager --spice-disable-usbredir

2.Guest T2 with spice graphic is available.
Open guest T2 details and add a USB redirection by Add device-> USB Redirection.

3.Start T2 and redirect the usb device from host to guest T2 by Virtual Machine-> Redirect USB device-> select the exsited usb device.

4.Warning "There are no free USB channels" appears. Click OK button

5.Check if the usb device is redirected into guest by lsusb command.

Actual results:
Get the redirected usb device infomation in the guest USB device is redirected to guest.

Expected results:
When launch virt-manager with --spice-diable-usbredir option, for the spice guest:
Redirect USB device option is disabled in the guest console menu  Virtual Machine.
Or USB Redirection is not usable in Add device tab.


Scenario 3:

Steps:
1. Add a USB redirection device to guest and without set the host and port
2. start the guest and get the following error.

Error starting domain: internal error: process exited while connecting to monitor: char device redirected to /dev/pts/3 (label charserial0)
qemu-kvm: -chardev socket,id=charredir0,host=None,port=None: address resolution failed for None:None: Servname not supported for ai_socktype
chardev: opening backend "socket" failed


Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 100, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 122, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1217, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 698, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error: process exited while connecting to monitor: char device redirected to /dev/pts/3 (label charserial0)
qemu-kvm: -chardev socket,id=charredir0,host=None,port=None: address resolution failed for None:None: Servname not supported for ai_socktype
chardev: opening backend "socket" failed

Expected result: 
Offer the host and port help information in virt-manager manaual. 
Give a warning if the host and port are mandatarty parameter when add a tcp usb redirection device.

Comment 13 Gunannan Ren 2013-08-16 08:53:36 UTC
(In reply to hyao from comment #12)
> I listed issues I met and reassined the bug. 
> BTW, please let me know if we need to open new bugs to cover the following
> issues since they make  the bug huge and not easy to read, in my opinion.
> 
> Version-Release number of selected component (if applicable):
> # rpm -qa libvirt virt-manager
> libvirt-1.1.1-2.el7.x86_64
> virt-manager-0.10.0-2.el7.noarch
> 
> Scenario 1:
> "--spice-disable-usbredir" option is missing in virt-manager manual.
> 

patch sent out to upstream
https://www.redhat.com/archives/virt-tools-list/2013-August/msg00087.html

> 
> Scenario 2:
> USB device is redirected to guest even when launching virt-manager with
> "--spice-disable-usbredir" option
> 


this option is to turn off the *auto* usb redirection, not whole the usb redirection, in the above patch, I changed that to --spice-disable-auto-usbredir.


> 
> 
> Scenario 3:
> 
> Steps:
> 1. Add a USB redirection device to guest and without set the host and port
> 2. start the guest and get the following error.
> 
> Error starting domain: internal error: process exited while connecting to
> monitor: char device redirected to /dev/pts/3 (label charserial0)
> qemu-kvm: -chardev socket,id=charredir0,host=None,port=None: address
> resolution failed for None:None: Servname not supported for ai_socktype
> chardev: opening backend "socket" failed
> 

I can't reproduce this by using git head. please report a new bug because this error is not related to this bug.

Comment 16 tingting zheng 2013-09-06 06:51:36 UTC
Refer to comment 12 and comment 13,tested the below scenarios:
1.Checked virt-manager manual and help.
# man virt-manager
--spice-disable-auto-usbredir Auto USB redirection is supportted by default. This option switches off it.

# virt-manager --help
  --spice-disable-auto-usbredir
                        Disable Auto USB redirection support

Problems:
In virt-manager manual,miss "return" after --spice-disable-auto-usbredir,the interpretation of the option should listed in another line.

2.Check default Auto USB redirection.
2.1 As bug 1005009,use root user to launch virt-manager.
2.2 Plug a usb on the host,launch virt-manager,open a guest,Click "Add Hardware"->"USB Redirection"->Type "Spice channel".
2.3 Open guest console,replug the usb disk,it can be auto redirected to guest successfully.
2.4 For RSA usb disk,it always fails to be redirected,there is always error:Could not redirect RSA SecurID (R) Authenticator [15e1:2007] at 6-2: Device is in use by another application
On host:
# lsusb
Bus 006 Device 004: ID 15e1:2007 RSA RSA SecurID (R) Authenticator

3.Check --spice-disable-auto-usbredirection
3.1 Refer to steps listed in issue 2 to add USB Redirection.
3.2 # virt-manager --spice-disable-auto-usbredirection

Problems:After use the option,usb can not be auto redirected,but the option works for ever even you launch virt-manager without the option,
it has disabled auto USB redirection.Communicated with gren,he said you need use dconf-editor to change the value back,so it's better to 
mark it in virt-manager manual.


4.Check virt-manager GUI "USB Redirection" with Type "Spice channel"
2.1 Plug a usb on the host,launch virt-manager,open a guest,Click "Add Hardware"->"USB Redirection"->Type "Spice channel".
2.2 Open guest console,click "Virtualization"->"Redirect USB device",choose the usb.
2.3 Check in guest,usb is redicted successfully.

5.Check virt-manager GUI "USB Redirection" with Type "TCP".
Exist bug 1005015 blocks the test,so I will test this function after the bug has been fixed.

Summary the problems listed above:
issue 1:
In virt-manager manual,miss "return" after --spice-disable-auto-usbredir,the interpretation of the option should listed in another line.

issue 2:
For RSA usb disk,it can not be redirected,there is always error:Could not redirect RSA SecurID (R) Authenticator [15e1:2007] at 6-2: Device is in use by another application
On host:
Attached the debug info from virt-manager.

issue 3:
After use the option,usb can not be auto redirected,but the option works for ever even you launch virt-manager without the option,
it has disabled auto USB redirection.Communicated with gren,he said you need use dconf-editor to change the value back,so it's better to 
mark it in virt-manager manual.

Comment 17 tingting zheng 2013-09-06 06:53:09 UTC
Created attachment 794595 [details]
debug info from virt-manager when redirect RSA usb

Comment 18 tingting zheng 2013-09-06 07:56:59 UTC
(In reply to tingting zheng from comment #16)
> Summary the problems listed above:
> issue 1:
> In virt-manager manual,miss "return" after --spice-disable-auto-usbredir,the
> interpretation of the option should listed in another line.
> 
> issue 2:
> For RSA usb disk,it can not be redirected,there is always error:Could not
> redirect RSA SecurID (R) Authenticator [15e1:2007] at 6-2: Device is in use
> by another application
> On host:
> Attached the debug info from virt-manager.
> 
> issue 3:
> After use the option,usb can not be auto redirected,but the option works for
> ever even you launch virt-manager without the option,
> it has disabled auto USB redirection.Communicated with gren,he said you need
> use dconf-editor to change the value back,so it's better to 
> mark it in virt-manager manual.


Added the version:
Version:
libvirt-1.1.1-3.el7.x86_64
virt-manager-0.10.0-3.el7.noarch
spice-glib-0.20-2.el7.x86_64
spice-gtk-0.20-2.el7.x86_64

For issue 2,confirmed with gren,filed bug 1005074.

Comment 19 Gunannan Ren 2013-09-06 08:09:21 UTC

(In reply to tingting zheng from comment #18)
> (In reply to tingting zheng from comment #16)
> > Summary the problems listed above:
> > issue 1:
> > In virt-manager manual,miss "return" after --spice-disable-auto-usbredir,the
> > interpretation of the option should listed in another line.

I think not starting with a 'newline' is fine dependent on how long the option
explanation is.

> > 
> > issue 2:
> > For RSA usb disk,it can not be redirected,there is always error:Could not
> > redirect RSA SecurID (R) Authenticator [15e1:2007] at 6-2: Device is in use
> > by another application
> > On host:
> > Attached the debug info from virt-manager.
> > 
> > issue 3:
> > After use the option,usb can not be auto redirected,but the option works for
> > ever even you launch virt-manager without the option,
> > it has disabled auto USB redirection.Communicated with gren,he said you need
> > use dconf-editor to change the value back,so it's better to 
> > mark it in virt-manager manual.

I think --spice-disable-auto-usbredirection is not like a switch or option suited for each virt-manager launch.
It is more of user preference. Although the auto-redirection feature is disabled, The user still can use "Redirect USB device" in guest console window to do the usb redirection.
virt-manager has been using gsettings to store the its global gnome preferences. There are more than a dozen such settings. manpage is not a good place to explain them.

Comment 20 tingting zheng 2013-09-22 08:41:05 UTC
Tested with:
spice-gtk-0.20-6.el7.x86_64
libvirt-1.1.1-6.el7.x86_64
virt-manager-0.10.0-3.el7.noarch
usbredir-0.6-5.el7.x86_64

1.Auto USB redirection works fine.
2.Option --spice-disable-auto-usbredirection works fine.
3.virt-manager GUI "USB Redirection" with Type "Spice channel" works fine.
4.virt-manager GUI "USB Redirection" with Type "tcp type" works fine.
5.For RSA usb disk,as bug 1005074 has closed as not a bug,so I didn't test with RSA usb disk.

Refer to the above comments and comment 19,move the bug to VERIFIED.

Comment 22 Ludek Smid 2014-06-13 12:11:47 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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