netcat used by VNC uses -q option which is not universally supported

Bug #474107 reported by Mikko Kortelainen
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Karmic by brainstorm

Bug Description

Binary package hint: virt-manager

After upgrading from Jaunty to Karmic, a remote CentOS 5.4 server with libvirt is unable to display screen using VNC because the nc (netcat) command on CentOS does not support the -q option, and the virt-manager in Karmic tries to use it. Earlier versions of Ubuntu showed the remote desktop fine without the -q option. Requesting removal if possible. The same version of netcat is used on Red Hat and CentOS versions 4 and 5 (at least), and possibly on other distributions as well.

The following error message is displayed by virt-manager in debug mode:

2009-11-04 12:35:01,428 (details:1265): Trying console login
2009-11-04 12:35:01,433 (details:1278): Graphics console configured at vnc://<email address hidden>:5902
2009-11-04 12:35:01,434 (details:1291): Starting connect process for bogus.domain.com 5902
2009-11-04 12:35:01,435 (details:1219): Spawning SSH tunnel to bogus.domain.com, for 127.0.0.1:5902
2009-11-04 12:35:01,440 (details:1242): Tunnel PID 25 FD 9822
nc: invalid option -- q
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
   [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
   [-x proxy_address[:port]] [hostname] [port[s]]
2009-11-04 12:35:31,818 (details:1250): Shutting down tunnel PID 9822 FD 25
2009-11-04 12:35:31,819 (details:1173): VNC disconnected

This can be fixed by installing a version of nc which recognizes the -q option on the remote server.

Related branches

Revision history for this message
zigi (ziegleka) wrote :

> This can be fixed by installing a version of nc which recognizes the -q option on the remote server.

Could you recommend from which source (repository, distribution)? Thank you

Revision history for this message
zigi (ziegleka) wrote :

I can confirm this bug. Karmic and Lucid are affected.

Revision history for this message
zigi (ziegleka) wrote :

This can be fixed by editing /usr/share/virt-manager/virtManager/details.py , line 1236:

-- argv += [ server, "nc", "-q", "0", vncaddr, str(vncport) ]
++ argv += [ server, "nc", vncaddr, str(vncport) ]

Changed in virt-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex Tabisz (alex-tabisz) wrote :

Zigi - nice fix/work around - thanks

Revision history for this message
zigi (ziegleka) wrote :
Revision history for this message
brainstorm (brainstorm) wrote :

On new virt-manager releases (0.8.3) from dnjl's PPA:

https://launchpad.net/~dnjl/+archive/virtualization

The offending "nc" code has moved to:

/usr/share/virt-manager/virtManager/console.py, line 508

argv += [ server, "nc", "-q", "0", vncaddr, str(vncport) ]

Unfortunately, zigi's fix does not work in that case :-/

Revision history for this message
zigi (ziegleka) wrote :
Revision history for this message
zigi (ziegleka) wrote :

From previous bug report on RedHat's bugzilla:

"This is now fixed upstream: we pass a shell script as the SSH command, and try
to detect these incompatibilities. It's definitely a hack, but we don't have a
lot of options:

http://hg.fedorahosted.org/hg/virt-manager/rev/1f781890ea4a "

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virt-manager - 0.8.2-2ubuntu4

---------------
virt-manager (0.8.2-2ubuntu4) lucid; urgency=low

  * debian/patches/autodetect-nc-params.patch: autodetect if the remote
    nc command supports the -q option. (LP: #474107)
  * debian/patches/0003-Make-sure-we-quit-afer-EOF-on-stdin.patch: disabled
    as the previous patch replaces it.
 -- Marc Deslauriers <email address hidden> Tue, 02 Mar 2010 14:43:43 -0500

Changed in virt-manager (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
zigi (ziegleka) wrote :

I can't test if this patch helps, due to same error in libvirtd. With virt-manager - 0.8.2-2ubuntu4 I can't connect to systems which use nc without -q.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Just so I can try and reproduce the problem you're having, you're connecting to an up-to-date CentOS 5 server with the default CentOS libvirt packages?

Revision history for this message
brainstorm (brainstorm) wrote : Re: [Bug 474107] Re: netcat used by VNC uses -q option which is not universally supported

Yes, that was my case (after my workaround on /usr/local/bin/nc):

# rpm -qi libvirt
Name : libvirt Relocations: (not relocatable)
Version : 0.6.3 Vendor: CentOS
Release : 20.1.el5_4 Build Date: Wed 21 Oct
2009 12:51:24 AM CEST
(...)

Regards,
Roman

On Wed, Mar 3, 2010 at 2:10 PM, Marc Deslauriers
<email address hidden> wrote:
> Just so I can try and reproduce the problem you're having, you're
> connecting to an up-to-date CentOS 5 server with the default CentOS
> libvirt packages?
>
> --
> netcat used by VNC uses -q option which is not universally supported
> https://bugs.launchpad.net/bugs/474107
> You received this bug notification because you are a direct subscriber
> of the bug.
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.