#516482 libvirt0: qemu+ssh requires netcat-openbsd

#516482#5
Date:
2009-02-21 20:03:09 UTC
From:
To:
Package: virt-manager
Version: 0.6.1-4
Severity: minor

It's taken me many hours to track this down, not sure the best way
(well, possibly remove the dependency!).

If you use qemu+ssh to a remote system, it calls "nc -U
/var/run/libvirt/libvirt-sock".

a) it should probably call "netcat" instead (I know we keep 'nc' for
backwards compatability, but I think 'netcat' has also been adopted
everywhere now (i.e. by other distros)).

b) -U is only supported by netcat-openbsd, not netcat-traditional
(perhaps mention this in the 'details' error message?)

c) not convinced what this actually does TBH - isn't that file 'owned'
by libvirt - i.e. couldn't it just be 'cat'ted instead hence removing
this dependency?

Anyway, set to minor, just hopefully saving someone else some
frustrations!

Many thanks :-)

Adrian

#516482#10
Date:
2009-02-22 12:59:59 UTC
From:
To:
missing something?
 -- Guido

#516482#15
Date:
2009-02-22 13:07:49 UTC
From:
To:
Ah, I hadn't spotted that.

Probably just the error message in that case (I had to strace it to
figure out what was going wrong - if the error that came back from the
exec was displayed it would have been a 2min job).

Adrian

#516482#20
Date:
2009-03-16 14:49:02 UTC
From:
To:
Virsh prints the error message given by nc :
$ virsh -c qemu+ssh://root@host/system
nc: invalid option -- U
nc -h for help
error: failed to connect to the hypervisor

But it could be replaced by a more human friendly error message. Same with the
generic dialog from Virt-manager about a "libvirtd" problem...

#516482#25
Date:
2009-03-17 15:46:02 UTC
From:
To:
I agree that error handling could be improved a lot here. Patches are of
course welcome.
Cheers,
 -- Guido

#516482#30
Date:
2009-05-06 13:53:26 UTC
From:
To:
Hi virt-manager Developers,

Just spend some hours with virt-manager from my Debian GNU/Notebook not
being able to connect to two OpenSuSE 11.1 Xen hosts.

###GUI###
virt-manager from GUI tells nothing about the real reason:

Unable to open a connection to the libvirt management daemon.

Libvirt URI is: xen+ssh://root@foobar/

Verify that:
 - The 'libvirtd' daemon has been started

Unable to open connection to hypervisor URI 'xen+ssh://root@foobar/':
<class 'libvirt.libvirtError'> server closed connection
None

Maybe you need to install ssh-askpass in order to authenticate.



###Shell###
virsh # connect xen+ssh://root@foobar/
bash: nc: command not found
error: Failed to connect to the hypervisor
error: server closed connection


foobar# ln -s /usr/bin/netcat /usr/bin/nc


virsh # connect xen+ssh://root@foobar/
nc: invalid option -- 'U'
nc -h for help
error: Failed to connect to the hypervisor
error: server closed connection


Finding http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=516482 through
friend Google.


foobar# zypper install netcat-openbsd


virsh # connect xen+ssh://root@foobar/

virsh # list --all
...



After all this was coming down to netcat-openbsd needed on the remote
machines. I don't think relying on such a dependency is good practice
beneath no specific error at all given when in GUI.


 For my part I would raise the severity of this bug here.

Best regards, Jan

#516482#35
Date:
2010-07-28 04:49:56 UTC
From:
To:
in 0.8.4 i have had to swap back from netcat-openbsd to netcat-traditional

as netcat-openbsd doesnt support the '-q' option

can libvirtd query netcat first to determine the implementation?

perhaps the -q option can be added to netcat-openbsd?