[virt-tools-list] virt-viewer over ssh

Geyang Kong gkong at redhat.com
Wed Nov 7 10:06:53 UTC 2012


Hi Guys

I've got something interesting and think it's incorrect. List issue here, may be a bug

Description of problem:
  Graphic device listens to different addresses after modifying qemu.conf file.

Version-Release number of selected component (if applicable):
libvirt-python-0.10.2-7.el6.x86_64
libvirt-client-0.10.2-7.el6.x86_64
libvirt-0.10.2-7.el6.x86_64

Reproduce steps:
1. Install a guest through virt-manager by following the wizard with default settings.
2. Modify /etc/libvirt/qemu.conf, uncomment vnc_listen = "0.0.0.0"
3. service libvirtd restart.
4. virsh destroy $guest.
5. virsh start $guest.
6. Repeat step 4 

Actual results:
1. After step 4, guest listen to 127.0.0.1
2. After step 5, guest listen to 0.0.0.0
3. After step 6, guest listen to 127.0.0.1

Expected results:
1. Guest should keep listening a single address, either 127.0.0.1 or 0.0.0.0.

Additional info:
1. This issue also happens on spice guest.

----- Original Message -----
From: "Daniel P. Berrange" <berrange at redhat.com>
To: "Dave Allan" <dallan at redhat.com>
Cc: virt-tools-list at redhat.com
Sent: Wednesday, November 7, 2012 4:11:10 PM
Subject: Re: [virt-tools-list] virt-viewer over ssh

On Tue, Nov 06, 2012 at 10:42:20PM -0500, Dave Allan wrote:
> On Tue, Nov 06, 2012 at 04:14:43PM -0500, Dave Allan wrote:
> > On Tue, Nov 06, 2012 at 08:11:07PM +0100, Guido Günther wrote:
> > > On Tue, Nov 06, 2012 at 09:56:19AM -0500, Dave Allan wrote:
> > > > I'm having trouble with virt-viewer not connecting to a VM on a remote
> > > > host over SSH.  It connects, briefly gives me a black VM display, and
> > > > then says that the remote disconnected.  I've noticed a few paches on
> > > 
> > > That was basically what I was seeing IIRC. I've roled my patches into
> > > the Debian package:
> > > 
> > > 	http://packages.debian.org/experimental/virt-viewer
> > > 
> > > (in case you have a vm around to test). I didn't get around to dig
> > > deeper into Christophe comments due to a lack of free time yet though.
> > > Cheers, 
> > >  -- Guido
> > 
> > I made some progress understanding what's happening, at least on my
> > system.  Bisecting shows commit
> > 56b0217c626349748c5cc6f2fbccfa6a905f75a4 to be the point at which
> > virt-viewer stops connecting to my VM.  After looking at that commit,
> > I was able to get virt-viewer to connect by adding listen='localhost'
> > to my VM's graphics element.  I'm afraid I haven't had time today to
> > dig into exactly what the effect of that patch is so I can't propose
> > an alternative.
> 
> I think I see what's happening:
> 
> In the default qemu.conf VNC is configured to listen on 127.0.0.1.
> When virt-viewer finds no listen address in the domain xml it
> substitutes the hostname from the connect URI and tries to use nc to
> connect to it, but in the default configuration the guest isn't
> listening on that IP, it's only listening on 127.0.0.1 so the
> connection fails.  Either specifying a listen address or changing
> qemu.conf to allow the guest to listen on 0.0.0.0 will allow
> connections to succeed.
> 
> The problem is tricky since I don't see how the client can determine,
> in the absence of a listen tag in the graphics element, what IP the
> guest is actually listening on.  However, the default qemu.conf
> specifies localhost, so it seems to me that the behavior prior to the
> change in 56b0217 was more likely to be correct as it matches the
> server default.
> 
> At this point, I favor reverting 56b0217, but I'm curious to see
> what other people think.

You're only considering the case where virt-viewer is using SSH and
thus local to the VM. In the non-SSH case, virt-viewer is connecting
to a remote host IP directly and thus 'localhost' is absolutely wrong.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
virt-tools-list mailing list
virt-tools-list at redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list




More information about the virt-tools-list mailing list