[virt-tools-list] virt-viewer over ssh
Daniel P. Berrange
berrange at redhat.com
Wed Nov 7 08:11:10 UTC 2012
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 :|
More information about the virt-tools-list
mailing list