Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to libvirt #63

Open
onastvar opened this issue Nov 22, 2016 · 10 comments
Open

Unable to connect to libvirt #63

onastvar opened this issue Nov 22, 2016 · 10 comments

Comments

@onastvar
Copy link

Anyone know how to fix libvirt issue. I'm on El Capitan. All installed fine.

Unable to connect to libvirt.

An error occurred, but the cause is unknown

Verify that the 'libvirtd' daemon is running
on the remote host.

Libvirt URI is: qemu+ssh://root@server/system?socket=/var/run/libvirt/libvirt-sock

Traceback (most recent call last):
File "/usr/local/Cellar/virt-manager/1.4.0/libexec/share/virt-manager/virtManager/connection.py", line 904, in _do_open
self._backend.open(self.do_creds_password)
File "/usr/local/Cellar/virt-manager/1.4.0/libexec/share/virt-manager/virtinst/connection.py", line 148, in open
open_flags)
File "/usr/local/Cellar/virt-manager/1.4.0/libexec/vendor/lib/python2.7/site-packages/libvirt.py", line 105, in openAuth
if ret is None:raise libvirtError('virConnectOpenAuth() failed')

libvirtError: An error occurred, but the cause is unknown

@skshandilya
Copy link

any workarounds for this? I am connecting from 1.4 virt-manager to libvirt version 1.3.1

@btro
Copy link

btro commented Dec 25, 2016

I receive the same error like OP. My virt-manager --version: 1.4.0. Mac OS: 10.12.2 (16C67). My Linux machine can connect via the URI without any problem. I'm using public key auth with an imported identity and no password prompt is happening or is expected - maybe that is related?

[Sun, 25 Dec 2016 23:17:26 virt-manager 81838] DEBUG (engine:140) Initial gtkapplication activated
[Sun, 25 Dec 2016 23:17:26 virt-manager 81838] DEBUG (connection:569) conn=qemu+ssh://user@[IP]/system changed to state=Connecting
[Sun, 25 Dec 2016 23:17:26 virt-manager 81838] DEBUG (connection:888) Scheduling background open thread for qemu+ssh://user@[IP]/system
[Sun, 25 Dec 2016 23:17:27 virt-manager 81838] DEBUG (connection:569) conn=qemu+ssh://user@[IP]/system changed to state=Disconnected
[Sun, 25 Dec 2016 23:17:27 virt-manager 81838] DEBUG (engine:638) connect_error: conn transport=ssh
[Sun, 25 Dec 2016 23:17:27 virt-manager 81838] DEBUG (error:99) error dialog message:
summary=Unable to connect to libvirt.

An error occurred, but the cause is unknown

Verify that the 'libvirtd' daemon is running
on the remote host.
details=Unable to connect to libvirt.

An error occurred, but the cause is unknown
[...]

No workaround on my end :(

@alv000h
Copy link

alv000h commented Feb 22, 2017

+1
Same here

Libvirt URI is: qemu+ssh://user@marte/system?socket=/var/run/libvirt/libvirt-sock

Traceback (most recent call last):
File "/usr/local/Cellar/virt-manager/1.4.0/libexec/share/virt-manager/virtManager/connection.py", line 904, in _do_open
self._backend.open(self._do_creds_password)
File "/usr/local/Cellar/virt-manager/1.4.0/libexec/share/virt-manager/virtinst/connection.py", line 148, in open
open_flags)
File "/usr/local/Cellar/virt-manager/1.4.0/libexec/vendor/lib/python2.7/site-packages/libvirt.py", line 105, in openAuth
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: An error occurred, but the cause is unknown

@alv000h
Copy link

alv000h commented Apr 21, 2017

@jeffreywildman any idea on this error?

@TheFonix
Copy link

Meanwhile we still wait :(

@dakwak
Copy link

dakwak commented Sep 18, 2017

i have been getting the same error all the way. Then I decided to use the socket in the connection URI. virt-manager --no-fork -c qemu+ssh://root@libvirthost/system?socket=/run/libvirt/libvirt-sock
in your case libvirt-sock can be somewhere else on the host, try to locate it. that should make a successful connection

UPDATE

It worked for few hours then it didn't. This is strange! the above is not anymore right for this case

@neko-kai
Copy link

neko-kai commented Sep 4, 2018

This worked virt-manager -c 'qemu+ssh://user@host/session?socket=/var/run/libvirt/libvirt-sock' with ssh keys auth

@aristofanio
Copy link

This worked: virt-manager -c 'qemu:///session' (based in @Kaishh )

@roobware
Copy link

roobware commented Apr 19, 2019

I had the same problem. Login not possible with correct string and socket parameter.
Daemon is running on server site, local check on server side of the hypervisor with virsh was successfull, but, the connection had always the error received hangup event on socket.

I searched all of the threats to this, nothing worked. Simple idea at last - setup a VirtualBox machine with the same OS as the server :) Now, i found the bug!

This was a incompatible package of netcat!
It is important, to use the openbsd netcat package on your server side!

I changed it to the openbsd netcat package and, voilà, connection is working on macOS Mojave 10.14.4 :)

VirtManagerConnectionMacOsMojave

@karpulix
Copy link

This worked virt-manager -c 'qemu+ssh://user@host/session?socket=/var/run/libvirt/libvirt-sock' with ssh keys auth

Thank you, this worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants