[Pkg-libvirt-maintainers] Bug#709230: virt-viewer can not connect to remote VM

Sebastian Kricner webmaster at funwelt.de
Tue May 21 18:45:22 UTC 2013


Package: virt-viewer
Version: 0.5.3-1
Severity: important

virt-viewer does not connect to remote VM.
Upon connecting to a remote VM using virt-viewer with the arguments
qemu+ssh:///URI/system domain the user gets asked for the ssh login
credentials.

After then virt-viewer just exits.

I have seen a strong link to the netcat used.
virt-viewer does not work at all with netcat-traditional and when using netcat-
openbsd it still does not work.

Manually inspecting this issue reveals following:

xxxxxxx at cluster-node1 ~ $ ssh -l root xxxxxxxxx sh -c 'if 'nc' -q 2>&1 | grep
"requires an argument" >/dev/null 2>&1; then ARG=-q0;else ARG=;fi;'nc' $ARG -U
/var/run/libvirt/libvirt-sock-ro'
Enter passphrase for key '/home/xxxxxxxxx/.ssh/id_rsa':
bash: -c: line 0: syntax error near unexpected token `then'
bash: -c: line 0: `sh -c if nc -q 2>&1 | grep "requires an argument" >/dev/null
2>&1; then ARG=-q0;else ARG=;fi;nc $ARG -U /var/run/libvirt/libvirt-sock-ro'

Using dpkg-reconfigure dash to set /bin/sh to /bin/bash does not have any
effect.

Issuing the commands supplied to ssh by the virt-viewer manually on the server
console reveals following:

Using netcat-traditional:

root at server1 ~ # if 'nc' -q 2>&1 | grep "requires an argument" >/dev/null 2>&1;
then ARG=-q0;else ARG=;fi;'nc' $ARG -U /var/run/libvirt/libvirt-sock-ro
nc: invalid option -- 'U'
nc -h for help

Using netcat-openbsd:

root at server1 ~ # if 'nc' -q 2>&1 | grep "requires an argument" >/dev/null 2>&1;
then ARG=-q0;else ARG=;fi;'nc' $ARG -U /var/run/libvirt/libvirt-sock-ro

Seems to work. But as written above it does not work when supplying this via
"ssh sh -c".

netcat6:

root at server1 ~ # if 'nc' -q 2>&1 | grep "requires an argument" >/dev/null 2>&1;
then ARG=-q0;else ARG=;fi;'nc' $ARG -U /var/run/libvirt/libvirt-sock-ro
nc: invalid option -- 'U'
Usage:
        nc [options...] hostname port
        nc -l -p port [-s addr] [options...] [hostname] [port]

Recognized options are:
 -4                     Use only IPv4
 -6                     Use only IPv6
 -b, --bluetooth        Use Bluetooth (defaults to L2CAP protocol)
 --buffer-size=BYTES    Set buffer size
 --continuous           Continuously accept connections
                        (only in listen mode with --exec)
 --disable-nagle        Disable nagle algorithm for TCP connections
 -e, --exec=CMD         Exec command after connect
 --half-close           Handle network half-closes correctly
 -h, --help             Display help
 -l, --listen           Listen mode, for inbound connects
 --mtu=BYTES            Set MTU for network connection transmits
 -n                     Numeric-only IP addresses, no DNS
 --no-reuseaddr         Disable SO_REUSEADDR socket option
                        (only in listen mode)

 --nru=BYTES            Set NRU for network connection receives
 -p, --port=PORT        Local port
 -q, --hold-timeout=SEC1[:SEC2]
                        Set hold timeout(s) for local [and remote]
 --rcvbuf-size          Kernel receive buffer size for network sockets
 --recv-only            Only receive data, don't transmit
 -s, --address=ADDRESS  Local source address
 --sco                  Use SCO over Bluetooth
 --send-only            Only transmit data, don't receive
 --sndbuf-size          Kernel send buffer size for network sockets
 -t, --idle-timeout=SECONDS
                        Idle connection timeout
 -u, --udp              Require use of UDP
 -v                     Increase program verbosity
                        (call twice for max verbosity)
 --version              Display nc6 version information
 -w, --timeout=SECONDS  Timeout for connects/accepts
 -x, --transfer         File transfer mode
 -X, --rev-transfer     File transfer mode (reverse direction)
 -T, --ttl=TTL          TTL of outgoing IP packet
 -z                     Don't send any data (scan mode)



What is wrong?

At least it should be fixable by recompling from virt-viewer source if the
issue is solved.



-- System Information:
Debian Release: 7.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7.2 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages virt-viewer depends on:
ii  libc6               2.13-38
ii  libgdk-pixbuf2.0-0  2.26.1-1
ii  libglib2.0-0        2.33.12+really2.32.4-5
ii  libgtk-3-0          3.4.2-6
ii  libgtk-vnc-2.0-0    0.5.0-3.1
ii  libvirt0            0.9.12-11
ii  libxml2             2.8.0+dfsg1-7+nmu1

virt-viewer recommends no packages.

Versions of packages virt-viewer suggests:
ii  netcat-openbsd [netcat]  1.105-7



More information about the Pkg-libvirt-maintainers mailing list