[Pkg-libvirt-maintainers] Bug#637548: Bug#637548: virt-viewer: should not hardcode SSH port 22, but read from ~/.ssh/config
Guido Günther
agx at sigxcpu.org
Fri Aug 12 14:42:39 UTC 2011
Hi Luca,
On Fri, Aug 12, 2011 at 03:23:17PM +0200, Luca Capello wrote:
> Package: virt-viewer
> Version: 0.4.0-1
> Severity: important
> Tags: upstream
> Usertags: pca-virtualization
>
> Hi there!
>
> 0.4.0-1 is supposed to solve this issue thanks to:
>
> <http://anonscm.debian.org/gitweb/?p=pkg-libvirt/virt-viewer.git;a=commitdiff;h=2376c067bd80cf68c425d51982deece3e6129e1a>
This looks like a brown paper bag for me. It has
if (!sshport)
while it should have
if (sshport)
in virt-viewer-app.c:322. Sorry for that. I'll roll out a new version
but will wait for your patch.
Cheers,
-- Guido
>
> However, it seems this is not enough, given that I get the following:
> =====
> luca at gismo:~$ virt-viewer --debug --connect qemu+ssh://mantissa.pca.it/system shelob.pca.it
> ** (virt-viewer:13938): DEBUG: Opening connection to libvirt with URI qemu+ssh://mantissa.pca.it/system
>
> ** (virt-viewer:13938): DEBUG: Add handle 6 1 0x1b86250
> Enter passphrase for key '/home/luca/.ssh/id_rsa':
> ** (virt-viewer:13938): DEBUG: Add timeout 0x1b88340 -1 0x7f4d89cf4610 0x1b87fc0 1
> ** (virt-viewer:13938): DEBUG: Guest shelob.pca.it is running, determining display
>
> ** (virt-viewer:13938): DEBUG: Guest shelob.pca.it has a vnc display
>
> ** (virt-viewer:13938): DEBUG: Guest graphics address is localhost:5900
> ** (virt-viewer:13938): DEBUG: Opening indirect TCP connection to display at localhost:5900
>
> ** (virt-viewer:13938): DEBUG: Setting up SSH tunnel via (null)@mantissa.pca.it:22
>
> Bad port '0'
> ** (virt-viewer:13938): DEBUG: Display size request 50x50 (desktop 100x100)
> ** (virt-viewer:13938): DEBUG: Allocated 1022x739
> ** (virt-viewer:13938): DEBUG: Child allocate 739x739
> ** (virt-viewer:13938): DEBUG: Guest shelob.pca.it display has disconnected, shutting down
>
> luca at gismo:~$ virt-viewer --debug --connect qemu+ssh://mantissa.pca.it:22023/system shelob.pca.it
> [...]
> ** (virt-viewer:13954): DEBUG: Guest graphics address is localhost:5900
> ** (virt-viewer:13954): DEBUG: Opening indirect TCP connection to display at localhost:5900
>
> ** (virt-viewer:13954): DEBUG: Setting up SSH tunnel via (null)@mantissa.pca.it:22023
>
> ** (virt-viewer:13954): DEBUG: Display size request 50x50 (desktop 100x100)
> ** (virt-viewer:13954): DEBUG: Allocated 1022x739
> ** (virt-viewer:13954): DEBUG: Child allocate 739x739
> ** (virt-viewer:13954): DEBUG: desktop resize 720x400
> ** (virt-viewer:13954): DEBUG: Preparing main window resize
> ** (virt-viewer:13954): DEBUG: Decided todo 720x400 (desktop is 720x400, fullscreen is 1024x768
> ** (virt-viewer:13954): DEBUG: Display size request 720x400 (desktop 720x400)
> ** (virt-viewer:13954): DEBUG: Allocated 1022x739
> ** (virt-viewer:13954): DEBUG: Child allocate 1022x567
> ** (virt-viewer:13954): DEBUG: Display size request 50x50 (desktop 720x400)
> ** (virt-viewer:13954): DEBUG: Allocated 1022x739
> ** (virt-viewer:13954): DEBUG: Child allocate 1022x567
>
> luca at gismo~$
> =====
>
> Once again, the error reported is completely misleading, something that
> seems to be a constant with libvirt-related packages :-(
>
> Anyway, the same is true for 0.4.1-1, except for the fact that
> specifying the SSH port does not work anymore, bingo! Have I already
> said that I hate when someone tries to be smarter than my config files?
>
> Despite myself not being an expert programmer, there are two problems:
>
> 1) in src/virt-viewer-app.c:322 the ssh -p switch should be used only if
> the SSH port is defined, reflecting src/virt-viewer-app.c:327.
> Fixing this was enough to have virt-viewer working with my
> ~/.ssh/config, because...
>
> 2) in src/virt-viewer-app.c:1093 the SSH port is always set to 0,
> completely ignoring the value specified in the URI.
>
> Together with those, the function virt_viewer_app_open_tunnel_ssh in
> src/virt-viewer-app.c is a bit "problematic", given that global
> variables like host, port and user, defined for SSH, are actually
> redefined for the nc tunnel.
>
> I will send a patch fixing this mess once this bug has got a number.
> Feel free to forward it to upstream, as it is or modified. The license
> is the same as virt-viewer ;-)
>
> Thx, bye,
> Gismo / Luca
>
> -- System Information:
> Debian Release: wheezy/sid
> APT prefers unstable
> APT policy: (990, 'unstable'), (1, 'experimental')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages virt-viewer depends on:
> ii libc6 2.13-15 Embedded GNU C Library: Shared lib
> ii libgdk-pixbuf2.0-0 2.23.5-3 GDK Pixbuf library
> ii libglib2.0-0 2.28.6-1 The GLib library of C routines
> ii libgtk-vnc-1.0-0 0.4.3-4.1 VNC viewer widget for GTK+2 (runti
> ii libgtk2.0-0 2.24.5-4 GTK+ graphical user interface libr
> ii libvirt0 0.9.4~rc1-1 library for interfacing with diffe
> ii libxml2 2.7.8.dfsg-4 GNOME XML library
>
> virt-viewer recommends no packages.
>
> Versions of packages virt-viewer suggests:
> ii netcat-openbsd [netcat] 1.89-4 TCP/IP swiss army knife
> ii netcat-traditional [netcat] 1.10-39 TCP/IP swiss army knife
>
> -- no debconf information
> _______________________________________________
> Pkg-libvirt-maintainers mailing list
> Pkg-libvirt-maintainers at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-libvirt-maintainers
More information about the Pkg-libvirt-maintainers
mailing list