virt-manager refuses to connect "<class 'libvirt.libvirtError'> cannot recv data:"

Bug #366057 reported by Theodotos Andreou
This bug report is a duplicate of:  Bug #251036: SSH errors not presented to user. Edit Remove
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
New
Undecided
Unassigned

Bug Description

I use a freshly installed kubuntu jaunty amd64.

user@user-desktop:~$ uname -a
Linux user-desktop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux

I try to connect to an intrepid ubuntu server running kvm using the command:
virt-manager -c qemu+ssh://<email address hidden>/system

It refuses to connect with the message:
------
Unable to open a connection to the libvirt management daemon.

Libvirt URI is: qemu+ssh://<email address hidden>/system

Verify that:
 - The 'libvirt-bin' package is installed
 - The 'libvirtd' daemon has been started
 - That you have access to '/var/run/libvirt/libvirt-sock'
------

Under details I get:
------
Unable to open connection to hypervisor URI 'qemu+ssh://<email address hidden>/system':
<class 'libvirt.libvirtError'> cannot recv data: Connection reset by peer
None
------

I do not think the problem is on the server side as I used to connect correctly using the same command on Hardy but an older version of virt-manager.

Revision history for this message
preben.olsen (preben-olsen) wrote :

Here is a workaround for this. I have seen this problem in both virt-manager 0.6.1 (Jaunty) and self compiled 0.7:

Virt manager 0.6.1:
File -> Add Connection -> quemu+ssh

Can't connect, receive this error:

Unable to open connection to hypervisor URI 'qemu+ssh://<email address hidden>/system':
<class 'libvirt.libvirtError'> cannot recv data: Connection reset by peer
None

Virt manager 0.7.0:
File -> Add connection -> quemu+ssh

Can't connect, receive this error:

Unable to open connection to hypervisor URI 'qemu+ssh://<email address hidden>/system':
<class 'libvirt.libvirtError'> cannot recv data: Connection reset by peer
None

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

Workaround: Create and use key authentication instead of password:

ssh-keygen -t rsa -N ""
ssh-copy-id -i /home/myuser/.ssh/id_rsa.pub <email address hidden>

Adding and connecting with virt-manager then works.

Revision history for this message
Theodotos Andreou (theodotos) wrote :

I installed ssh-askpass and it worked like a charm. Thanks for the tip.

But ssh-askpass should be included as a dependency for virt-manager since password authentication will not work without it and you can not use key authentication on all scenarios.

Revision history for this message
lx3r (lx3r) wrote :

check if
  /root/.ssh/known_hosts
has the correct keys.
(if unsure, just delete everything...)

if the key is wrong, it doesnt return an error, it just wont work

Revision history for this message
Motin (motin) wrote :

This is not a dupe of #251036 ... That treats a case about mismatching keys. This is more generic about the lack of dependency on ssh-askpass

Now, for me, installation ssh-askpass hasn't yet neither, but that may be yet another bug...

Revision history for this message
Motin (motin) wrote :

Seems like I am dropping words...

"Now, for me, installation of ssh-askpass hasn't yet helped neither, after successful password entered the same error message appears, but that may be yet another bug..."

Revision history for this message
123vier (flowrist) wrote :

I don't think this is a duplicate.

On a new install of 16.04.1 installing virt-manager should add ssh-askpass/ssh-askpass-gnome as a dependency. It even suggests the wrong package "openssh-askpass".

Revision history for this message
Natalia Litvinova (natalytvinova) wrote :

It is not a duplicate. I got the same problem, virt-manager suggested to install ssh-askpass without specifying. It defenetely should install it as a dependency. My problem was solved by installing ssh-askpass-gnome.

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

Other bug subscribers

Remote bug watches

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