Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237277 - no suitable netcat application is atm in gentoo to run virsh remotely.
Summary: no suitable netcat application is atm in gentoo to run virsh remotely.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard: netcat-openbsd (?)
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2008-09-10 09:52 UTC by luca pasquali
Modified: 2009-09-11 23:42 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild, changelog and metadata file for netcat-openbsd (netcat-openbsd.tar.bz2,1.35 KB, text/plain)
2008-09-12 09:16 UTC, luca pasquali
Details
netcat-openbsd-1.84.ebuild (netcat-openbsd-1.84.ebuild,1.57 KB, text/plain)
2009-03-16 15:59 UTC, Balazs Nemeth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description luca pasquali 2008-09-10 09:52:32 UTC
some other netcat software needs to be adopted in gentoo. 

Reproducible: Always

Steps to Reproduce:
1. emerge netcat (on the libvirt host) 
2. virsh -c qemu+ssh://host/system 
3. emerge gnu-netcat (on the libvirt host)
4. ln -s /usr/bin/netcat /usr/bin/nc
5. virsh -c qemu+ssh://host/system
Actual Results:  
luca@doomsday:~$ virsh -c qemu+ssh://root@kvm01/
Connecting to uri: qemu+ssh://root@kvm01/
Password: 
nc: invalid option -- U
Try `nc --help' for more information.
libvir: Remote error : socket closed unexpectedly
error: failed to connect to the hypervisor
luca@doomsday:~$ 


the openbsd netcat has the needed feature in the libvirt thing. a porting for linux is atm in redhat, fedora, centos os, debian and ubuntu and it is included as dependancy of libvirt executable binaries (i.e. virsh).
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-09-10 17:19:30 UTC
feel free to write the ebuild then change the KEYWORDS to "EBUILD"
Comment 2 luca pasquali 2008-09-11 05:15:54 UTC
well i guess it's quite doable. 
I'll test which netcat-openbsd linux (debian or red-hat ones i.e.) port is more reusable for gentoo and I'll try to write an ebuild against it.
Just one thing concerns me in portage's acquisition of such package, libvirt isn't designed to be a linux-only API. 
I mean that at least for a client-side usage, it probably will be usable on *BSD desktop systems to manage virtual environments.
Anyway an usable linux only ebuild for netcat-openbsd is my first entry in my todo list, stating I need it.
 cheers,

luca
(In reply to comment #1)
> feel free to write the ebuild then change the KEYWORDS to "EBUILD"
> 

Comment 3 luca pasquali 2008-09-12 09:16:43 UTC
Created attachment 165250 [details]
ebuild, changelog and metadata file for netcat-openbsd

howdy,
the starting ebuild done. I synced it from centos 5.2 repository (1.84-10.fc6)
this package provides virtual/netcat, is this wrong? I don't need to be able to emerge both net-analyzer/netcat or net-analyzer/gnu-netcat too.
Comment 4 luca pasquali 2009-01-15 16:11:37 UTC
(In reply to comment #1)
> feel free to write the ebuild then change the KEYWORDS to "EBUILD"
> 

howdy, 
do I need to do anything else to be done from my side to get this package go in portage?
should I poke some gentoo developer on irc o something like that?
cheers!

--
luca
Comment 5 phceac 2009-01-18 11:16:55 UTC
Tested on amd64.  Builds and installs as /usr/bin/nc.openbsd.

After manual replacement of the normal nc with the new binary, I am able to use libvirt & virt-manager over ssh.  

Perhaps there needs to be a virtual/netcat to allow for 2 packages providing the same binary?

Would it help if the ebuild was attached as a plain text file? (currently a tbz2)
Comment 6 Balazs Nemeth 2009-03-16 15:59:04 UTC
Created attachment 185198 [details]
netcat-openbsd-1.84.ebuild

This is a slightly modified ebuid based upon luca's ebuild.
 - added blockers about netcat and gnu-netcat 
 - dosym nc.openbsd -> nc
Comment 7 Balazs Nemeth 2009-03-16 16:01:01 UTC
(In reply to comment #6)
> Created an attachment (id=185198) [edit]
> netcat-openbsd-1.84.ebuild
> 
> This is a slightly modified ebuid based upon luca's ebuild.
>  - added blockers about netcat and gnu-netcat 
>  - dosym nc.openbsd -> nc
> 

Now the "nc: invalid option -- U" message dissappeared but I cant connect anyway.

$ virsh -c xen+ssh://root@192.168.253.41/
Connecting to uri: qemu:///session
libvir: Remote error : socket closed unexpectedly
Comment 8 Brett Edgar 2009-05-05 18:55:57 UTC
(In reply to comment #7)
> Now the "nc: invalid option -- U" message dissappeared but I cant connect
> anyway.
> 
> $ virsh -c xen+ssh://root@192.168.253.41/
> Connecting to uri: qemu:///session
> libvir: Remote error : socket closed unexpectedly

Make sure you have this 'netcat-openbsd' on *both* systems.  It's not going to do you any good on just one of them. ;)

I can confirm that with netcat-openbsd on both a local and remote system, libvirt and virt-manager work excatly as they should over SSH.

Either a warning needs to be added to the libvirt ebuild indicating that OpenBSD netcat is required for SSH connections, or this ebuild should be added to the tree and libvirt changed to DEPEND on 'netcat-openbsd'.  What needs to be done to add this to the tree?

Comment 9 toon 2009-05-23 08:43:03 UTC
Hi,

I think this bug report needs a boost!

I ran into exactly this problem.
I installed in my OVERLAY-directory:
- the tarball as attached to this bug report by Luca
- the enhanced ebuild script as attached by Balazs
It solved my problem.  Now I can connect to the libvirt daemon
from a remote virt-manager instance via an SSH tunnel.  Great!!!

Please introduce a virtual netcat metapackage and accept this ebuild into the tree.
Comment 10 Johannes Truschnigg 2009-08-10 17:43:55 UTC
http://bugs.gentoo.org/show_bug.cgi?id=280650 proposes another solution to the same problem.
Comment 11 Kevin Zuber 2009-08-19 18:23:32 UTC
Hi there,

I've the exact same problem and it have cost me 6 hours on finding this bug report because neither libvirt nor virt-manager displays a good error message.
It's very annoying and a big waste of time. 
Please do anything - at least add a warning in the ebuild of libvirt with the problem and a link to this bug report, when emerging it. 
Better fix the problem. 

But please do something.
Comment 12 Patrick Lauer gentoo-dev 2009-09-08 21:24:25 UTC
+  08 Sep 2009; Patrick Lauer <patrick@gentoo.org> +libvirt-0.6.5-r1.ebuild:
+  Fixing netcat dep #280650 #237277 #283884