This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 730911 - 'virt-viewer --direct --connect' fails to connect remote vms.
'virt-viewer --direct --connect' fails to connect remote vms.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-viewer (Show other bugs)
6.2
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
: Regression
Depends On:
Blocks: 743047
  Show dependency treegraph
 
Reported: 2011-08-16 04:18 EDT by Huming Jiang
Modified: 2011-12-06 10:07 EST (History)
5 users (show)

See Also:
Fixed In Version: virt-viewer-0.4.1-5.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 10:07:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Huming Jiang 2011-08-16 04:18:02 EDT
Description of problem:
If you use 'virt-viewer --direct --connect' with an remote IP address to connect a vm, virt-viewer will connect to the graphic server 0.0.0.0:5900, and could not connect the remote vm you have selected.

Version-Release number of selected component (if applicable):
virt-viewer-0.4.1-3.el6.x86_64

How reproducible:
Always

Steps to Reproduce:

1.Make sure your local host has no running vm.
  #virt-viewer --direct --connect=qemu+ssh://10.66.3.130/system rh

  There will be an error pop-up:"Unable to connect to the graphic server 0.0.0.0:5900"

2.If there is an vm running on your local host, 
  #virsh dumpmxl rh6-copy-clone
...
    <graphics type='spice' port='5900' tlsPort='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
...
  #virt-viewer --direct --connect=qemu+ssh://10.66.3.130/system rh
  Then the vm 'rh6-copy-clone' on the local host will be opened.
  
Actual results:
See the description in the 'Steps to Reproduce'.

Expected results:
Virt-viewer should open the remote vm.

Additional info:
Comment 2 Daniel Berrange 2011-09-19 07:13:02 EDT
This regression is caused by the following upstream patch

commit 6c477650ca3497eb56fa273a421f72d4d8f9aca1
Author: Jiri Denemark <Jiri.Denemark@gmail.com>
Date:   Mon May 23 12:15:05 2011 +0100

    Add support for listen attribute
    
    Virt-viewer now parses listen attribute from graphics element to be able
    to connect to domains configured with explicit listen address:
    
        <graphics type='vnc' port='-1' autoport='yes' listen='123.45.67.89'/>


The patch is fine in the case where the XML gives an explicit address, but for a wildcard address like 0.0.0.0 it clearly does not work.

In the latter case we'll need to fallback to use the hostname from the libvirt URI as with previous releases.
Comment 4 Daniel Berrange 2011-09-19 12:49:06 EDT
Note for testing, there are three guest configurations that should be tested

 1. No listen attribute

      <graphics type='vnc' port='-1' autoport='yes'/>

 2. Specific listen attribute

      <graphics type='vnc' port='-1' autoport='yes' listen='123.45.67.89'/>

 3. Wildcard listen attribute

      <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>


These need to be tested with two command lines:

 1. Tunnelled over ssh:

  virt-viewer -c qemu+ssh://root@somehost.name.and.domain/system vm-name

 2. Direct connection

  virt-viewer --direct -c qemu+ssh://root@somehost.name.and.domain/system vm-name
Comment 6 Daisy Wu 2011-09-21 02:40:15 EDT
The issue 'virt-viewer --direct --connect' fails to connect remote vms' can reproduce on version:
virt-viewer-0.4.1-3.el6.x86_64

Verified on version:
virt-viewer-0.4.1-5.el6.x86_64

Environment:
kernel-2.6.32-191.el6.x86_64
libvirt-0.9.4-11.el6
python-virtinst-0.600.0-3.el6
qemu-kvm-0.12.1.2-2.185.el6
virt-manager-0.9.0-6.el6
virt-viewer-0.4.1-5.el6.x86_64

Prepared two host and a remote vm:
local host
remote host 
remote vm named xpi386

Detail Steps:
1.Make sure local host has no running vm.
logon the local host:
#virt-viewer --direct --connect=qemu+ssh://remotehostIP/system xpi386

There will be an error pop-up:"Unable to connect to the graphic server
0.0.0.0:5900"

2.If there is an vm running on local host,
#virsh dumpmxl win2008x64
...
<graphics type='vnc' port='5900' autoport='yes'/>
...
#virt-viewer --direct --connect=qemu+ssh://remotehostIP/system xpi386
Then the vm 'win2008x64' on the local host will be opened.

3. No listen attribute:
#virsh dumpmxl xpi386
<graphics type='vnc' port='-1' autoport='yes'/>
logon the local host:
a. #virt-viewer -c qemu+ssh://root@remotehostIP/system xpi386
The remote vm 'xpi386' opened successfully through virt-viewer.
b. #virt-viewer --direct -c qemu+ssh://root@remotehostIP/system xpi386
The remote vm 'xpi386' can not open,error pop up: "Unable to connect to the graphic server localhost:5900"
logon the remote host:
#virt-viewer --direct -c qemu+ssh://root@remotehostIP/system xpi386
The remote vm 'xpi386' opened successfully through virt-viewer.

4. Specific listen attribute:
#virsh dumpmxl xpi386
<graphics type='vnc' port='-1' autoport='yes' listen='10.66.6.23'/>
<listen type='address' address='10.66.6.23'/>

logon the local host:
#virt-viewer -c qemu+ssh://root@remotehostIP/system xpi386
#virt-viewer --direct -c qemu+ssh://root@remotehostIP/system xpi386
The remote vm 'xpi386' opened successfully through virt-viewer.

5. Wildcard listen attribute:
#virsh dumpmxl xpi386
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>

logon on the local host:
#virt-viewer -c qemu+ssh://root@remotehostIP/system xpi386
#virt-viewer --direct -c qemu+ssh://root@remotehostIP/system xpi386
The remote vm 'xpi386' opened successfully through virt-viewer.
Comment 7 errata-xmlrpc 2011-12-06 10:07:23 EST
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/RHEA-2011-1614.html

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