Bug 807277 - Enable auto-redir in virt-manager [NEEDINFO]
Enable auto-redir in virt-manager
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-manager (Show other bugs)
6.3
All Linux
high Severity high
: rc
: 6.4
Assigned To: Giuseppe Scrivano
Virtualization Bugs
:
: 964215 (view as bug list)
Depends On: 964215 996459 1001999 1031775 1085318
Blocks: 782183 835616 1083163 840699 853317 923567 987763
  Show dependency treegraph
 
Reported: 2012-03-27 08:19 EDT by Grant Williamson
Modified: 2016-04-26 12:06 EDT (History)
22 users (show)

See Also:
Fixed In Version: virt-manager-0.9.0-20.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 853317 923567 987763 (view as bug list)
Environment:
Last Closed: 2014-10-14 02:25:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rmcswain: needinfo?


Attachments (Terms of Use)
spice debug info with virt-manager (21.45 KB, text/plain)
2014-05-11 23:16 EDT, tingting zheng
no flags Details
xml file of guest (2.91 KB, text/plain)
2014-05-21 22:32 EDT, tingting zheng
no flags Details

  None (edit)
Description Grant Williamson 2012-03-27 08:19:40 EDT
Description of problem:
usb auto-redir is planned for inclusion in RHEL 6.3 however there are no plans to enable it in virt-manager.

Using remote-viewer and/or spicy on a host in conjunction with virt-manager confuses most end users.

The user experience with auto-redir should be seamlessly integrated on the rhel6 host.

I understand from the developer that adding support is somewhat trivial since all the code already exists in spice-gtk which virt-manager uses.

It should just be the case of enabling in virt-manager and adding a button for device selection.

Can this be reviewed for inclusion.
Comment 3 Cole Robinson 2012-04-02 17:59:26 EDT
Since this isn't upstream yet, it's a bit late for 6.3 cycle. Deferring to 6.4
Comment 4 Grant Williamson 2012-04-03 01:13:03 EDT
If a patch were to be created, we would be happy to re-spin out own package till 6.4 is released.
Comment 5 Dave Allan 2012-04-04 23:31:38 EDT
This RFE is certainly reasonable, so I think the best approach is to engage upstream and submit a patch there.  Cole or others can provide review and acks to move the process along.
Comment 14 Dave Allan 2012-10-02 14:28:07 EDT
(In reply to comment #5)
> This RFE is certainly reasonable, so I think the best approach is to engage
> upstream and submit a patch there.  Cole or others can provide review and
> acks to move the process along.

Nathan/Grant, is IBM planning on submitting any code upstream?
Comment 19 Gunannan Ren 2013-07-02 00:45:58 EDT
commit 88f2d1abe0ffecdf606acbf5f473034d858dc6db
Author: Guannan Ren <gren@redhat.com>
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@redhat.com>
Date:   Mon Jul 1 14:33:06 2013 -0400

    error: use helper function to embed customized widget into dialog
Comment 31 Gunannan Ren 2013-09-04 14:43:58 EDT
backport patches sent out
http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-September/msg00086.html
Comment 38 Giuseppe Scrivano 2014-02-04 08:27:16 EST
*** Bug 964215 has been marked as a duplicate of this bug. ***
Comment 45 tingting zheng 2014-05-05 05:27:59 EDT
Tested with:
python-virtinst-0.600.0-20.el6.noarch
virt-manager-0.9.0-20.el6.x86_64

Steps:
1. Plug a usb on the host,launch virt-manager,open a guest,Click "Add Hardware"->"USB Redirection"->Type "Spice channel".
2. Open guest console,click "Virtualization"->"Redirect USB device",choose the usb,error shows:
USB redirection error
<GError at 0x26f74c0>
3.Use lsusb in guest,the usb is not redirected.

Refer to the above comments,move the bug to ASSIGNED.
Comment 46 Giuseppe Scrivano 2014-05-05 07:19:34 EDT
I've just tested it again here and it works correctly for me.  The error comes from spice-gtk-python.  What version of spice-gtk-python are you using?  What USB device?  Could you try with another USB device?
Comment 47 tingting zheng 2014-05-06 01:12:48 EDT
(In reply to Giuseppe Scrivano from comment #46)
> I've just tested it again here and it works correctly for me.  The error
> comes from spice-gtk-python.  What version of spice-gtk-python are you
> using?  What USB device?  Could you try with another USB device?

# rpm -qa |grep spice-gtk-python
spice-gtk-python-0.20-11.el6_5.1.x86_64

# lsusb
Bus 002 Device 003: ID 0951:1646 Kingston Technology

I tried another usb disk,the same error shows.
Comment 49 tingting zheng 2014-05-11 23:16:45 EDT
Created attachment 894539 [details]
spice debug info with virt-manager
Comment 51 Giuseppe Scrivano 2014-05-12 02:47:31 EDT
thanks for the log.  The error seems to come from spice and virt-manager has no control over it:

(virt-manager:11356): GSpice-DEBUG: usb-device-manager.c:1291 connecting device 0x371c9a0
(virt-manager:11356): GSpice-DEBUG: channel-usbredir.c:324 usbredir-9:0: connecting usb channel 0x37c8400
(virt-manager:11356): GSpice-DEBUG: channel-usbredir.c:490 usbredir-9:0: usbredirhost: device rejected
(virt-manager:11356): GSpice-DEBUG: channel-usbredir.c:683 usbredir-9:0: Kingston DataTraveler 3.0 [0951:1666] at 2-2 rejected by host
(virt-manager:11356): GSpice-DEBUG: channel-usbredir.c:397 usbredir-9:0: disconnecting device from usb channel 0x37c8400
(virt-manager:11356): GSpice-DEBUG: channel-usbredir.c:490 usbredir-9:0: usbredirhost: device disconnected
2014-05-11 23:14:19,149 (error:83): dialog message: USB redirection error : USB redirection error

Should I reassign or clone this bug to spice-gtk?
Comment 52 Giuseppe Scrivano 2014-05-13 08:38:40 EDT
moving to spice-gtk for further probing...
Comment 54 Christophe Fergeau 2014-05-19 05:14:33 EDT
If you connect to the same VM using virt-viewer/remote-viewer, is USB redirection working?
Comment 55 tingting zheng 2014-05-19 22:50:22 EDT
(In reply to Christophe Fergeau from comment #54)
> If you connect to the same VM using virt-viewer/remote-viewer, is USB
> redirection working?

# lsusb
Bus 002 Device 007: ID 0951:1666 Kingston Technology 

When I use virt-viewer to connect the same guest,click "File"->"USB device selection",click the usb disk I want to redirect,there is error:'USB redirection error:Kingston DataTraveler 3.0 [0951:1666] at 2-7 rejected by host.
Comment 56 Giuseppe Scrivano 2014-05-21 07:56:24 EDT
could you please attach the XML definition for your VM (virsh dumpxml guest)?
Comment 57 tingting zheng 2014-05-21 22:32:46 EDT
Created attachment 898177 [details]
xml file of guest
Comment 58 Christophe Fergeau 2014-05-22 04:48:12 EDT
This XML seems to be missing the needed USB controllers for USB redirection to work, see http://people.freedesktop.org/~teuf/spice-doc/html/ch02s06.html#idm244178574320 . You will also be limited to redirecting one USB device at the same time.
Comment 59 tingting zheng 2014-05-22 07:06:59 EDT
(In reply to Christophe Fergeau from comment #58)
> This XML seems to be missing the needed USB controllers for USB redirection
> to work, see
> http://people.freedesktop.org/~teuf/spice-doc/html/ch02s06.
> html#idm244178574320 . You will also be limited to redirecting one USB
> device at the same time.

Yes,my fault,I should add usb controller with model usb2.

As virt-manager on rhel6 doesn't support to change for usb2 model,I modify guest xml to add:
 <controller type='usb' index='0' model='ich9-ehci1'/>
<controller type='usb' index='0' model='ich9-uhci1'>
  <master startport='0'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
  <master startport='2'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
  <master startport='4'/>
</controller>

Then follow step in comment 45.
1.Plug a usb on the host,launch virt-manager,open a guest,Click "Add Hardware"->"USB Redirection"->Type "Spice channel".
2.Open guest console,click "Virtualization"->"Redirect USB device",choose the usb,the usb disk can be redirected successfully.
3.For "USB Redirection" with type "tcp",there is bug 1085318 which is not fixed,so I will retest the bug with tcp type once the bug is fixed.
Comment 60 Giuseppe Scrivano 2014-05-22 07:46:08 EDT
can you test if the other cases work for you now?
Comment 61 tingting zheng 2014-05-23 02:00:28 EDT
(In reply to Giuseppe Scrivano from comment #60)
> can you test if the other cases work for you now?

Sure.
1.As virt-manager on rhel6 doesn't support to change for usb2 model,I filed a new RFE bug 1100561,since virt-manager GUI provide support USB Redirection,it's useful and convenient to support usb2 model from virt-manager.

2.I modify guest xml to add:
 <controller type='usb' index='0' model='ich9-ehci1'/>
<controller type='usb' index='0' model='ich9-uhci1'>
  <master startport='0'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
  <master startport='2'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
  <master startport='4'/>
</controller>

Tested for usb redirection with spice type,both virt-manager and virt-viewer/remote-viewer works well,usb disk can be redirected successfully.

Besides usb redirection with tcp type blocked by bug 1085318,If there is something I've missed,pls correct me.
Comment 63 Giuseppe Scrivano 2014-06-03 13:03:33 EDT
as the spice tcp redirection bug is already tracked and it is a known issue, I think we can skip to test it here.
Comment 64 tingting zheng 2014-06-03 22:42:21 EDT
(In reply to Giuseppe Scrivano from comment #63)
> as the spice tcp redirection bug is already tracked and it is a known issue,
> I think we can skip to test it here.

So from virt-manager GUI,I can open a guest,Click "Add Hardware"->"USB Redirection"->Type "Spice channel" or "tcp",usb redirection with spice type works well refer to comment 61,from virt-manager side,the bug has been fixed,so I moved the bug to VERIFIED.
Comment 67 errata-xmlrpc 2014-10-14 02:25:26 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.

http://rhn.redhat.com/errata/RHBA-2014-1447.html

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