Bug 832004 - vncdisplay can't output default ip address for the vnc display
vncdisplay can't output default ip address for the vnc display
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-06-14 05:28 EDT by hongming
Modified: 2013-02-21 02:17 EST (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 02:17:19 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description hongming 2012-06-14 05:28:27 EDT
Description of problem:
vncdisplay can't output default ip address for the vnc display

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.# virsh start rhel6.3
   Domain rhel6.3 started

2.# virsh dumpxml rhel6.3
<graphics type='vnc' port='5901' autoport='yes'/>

3.# virsh vncdisplay rhel6u31

Actual results:
only output the port number for the VNC display.

Expected results:
Output the default ip address and port.

Additional info:
Comment 2 Alex Jia 2012-06-14 07:03:36 EDT
Michal committed a RFC request about "API to report guest IP address(es)" and committed a patch set recently on libvirt upstream, but patches haven't been ACKed now, it should be helpful for this issue.

Comment 3 Peter Krempa 2012-06-14 08:07:20 EDT
That API actually won't help much as the relevant address is where the hypervisor is running. The vncdisplay command has the problem that it's only printing the address present in the domain XML that may and may not contain the correct address you have to connect to. The problem with that address is that it might even be unreachable directly from the machine virsh is running on. (Eg. when the listen address is, you won't be able to connect to the hypervisor vnc display from remote hosts.)
Comment 4 Dave Allan 2012-06-14 11:03:25 EDT
Regardless of the usefulness of the information provided, I think the output should include the IP address.
Comment 5 Michal Privoznik 2012-06-14 12:08:40 EDT
This is a bit more complex than one could initially think.

vncdisplay command simply dumpx guest XML and do bunch of XPath queries to determine IP address and listen port. However, if there is none defined in the XML, then at the domain startup we take the one defined in qemu.conf. But we cannot store it into domain XML as it will discard future changes to qemu.conf. Therefore we need to make this as transient -> insert into live XML only.
Comment 6 Michal Privoznik 2012-06-27 10:19:34 EDT
Moving to POST:

commit d7f9d827531bc843b7c5aa9d3e8c08738a1de248
Author:     Daniel P. Berrange <berrange@redhat.com>
AuthorDate: Mon Jun 25 12:50:52 2012 +0100
Commit:     Daniel P. Berrange <berrange@redhat.com>
CommitDate: Mon Jun 25 13:05:55 2012 +0100

    Include the default listen address in the live guest XML
    If no 'listen' attribute or <listen> element is set in the
    guest XML, the default driver configured listen address is
    used. There is no way to client applications to determine
    what this address is though. When starting the guest, we
    should update the live XML to include this default listen

Comment 9 yanbing du 2012-07-24 04:40:11 EDT
Bug verified with libvirt-0.9.13-3.el6.x86_64.

# virsh list --all
 Id    Name                           State
 5     rhel6                          running
 6     rhel6-2                        running

# virsh vncdisplay rhel6

# virsh vncdisplay rhel6-2
Comment 10 errata-xmlrpc 2013-02-21 02:17:19 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.


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