jeffreywildman / homebrew-virt-manager

A set of homebrew formulae to install virt-manager and virt-viewer on MAC OSX
1.01k stars 266 forks source link

Connection issues via SSH (received hangup event on socket) #128

Closed Woovie closed 5 years ago

Woovie commented 5 years ago

virt-manager -c qemu+ssh://root@$HOSTNAME/system --no-fork --debug

[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (cli:203) Launched with command line: /usr/local/Cellar/virt-manager/2.1.0/libexec/share/virt-manager/virt-manager -c qemu+ssh://root@$HOSTNAME/system --no-fork --debug
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (virt-manager:177) virt-manager version: 2.1.0
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (virt-manager:178) virtManager import: <module 'virtManager' from '/usr/local/Cellar/virt-manager/2.1.0/libexec/share/virt-manager/virtManager/__init__.py'>
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (virt-manager:215) PyGObject version: 3.30.4
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (virt-manager:219) GTK version: 3.24.5
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (systray:202) Showing systray: False
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (inspection:41) python guestfs is not installed
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (engine:114) Loading stored URIs:
qemu+ssh://root@$HOSTNAME/system
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (engine:528) processing cli command uri=qemu+ssh://root@$HOSTNAME/system show_window=manager domain=
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (connection:565) conn=qemu+ssh://root@$HOSTNAME/system changed to state=Connecting
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (connection:1002) Scheduling background open thread for qemu+ssh://root@$HOSTNAME/system
[Mon, 08 Apr 2019 19:00:46 virt-manager 11144] DEBUG (engine:282) Initial gtkapplication activated
[Mon, 08 Apr 2019 19:00:47 virt-manager 11144] DEBUG (connectauth:152) connect_error: conn transport=ssh
[Mon, 08 Apr 2019 19:00:47 virt-manager 11144] DEBUG (connection:565) conn=qemu+ssh://root@$HOSTNAME/system changed to state=Disconnected
[Mon, 08 Apr 2019 19:00:47 virt-manager 11144] DEBUG (error:83) error dialog message:
summary=Unable to connect to libvirt qemu+ssh://root@$HOSTNAME/system.

internal error: received hangup event on socket

Verify that the 'libvirtd' daemon is running on the remote host.
details=Libvirt URI is: qemu+ssh://root@$HOSTNAME/system

Traceback (most recent call last):
  File "/usr/local/Cellar/virt-manager/2.1.0/libexec/share/virt-manager/virtManager/connection.py", line 1012, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/local/Cellar/virt-manager/2.1.0/libexec/share/virt-manager/virtinst/connection.py", line 138, in open
    open_flags)
  File "/usr/local/Cellar/virt-manager/2.1.0/libexec/lib/python3.7/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: internal error: received hangup event on socket
[Mon, 08 Apr 2019 19:01:03 virt-manager 11144] DEBUG (engine:415) No windows found, requesting app exit
[Mon, 08 Apr 2019 19:01:03 virt-manager 11144] DEBUG (engine:251) Autostart connection error: Unable to connect to libvirt qemu+ssh://root@$HOSTNAME/system.

internal error: received hangup event on socket

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

Libvirt URI is: qemu+ssh://root@$HOSTNAME/system

Traceback (most recent call last):
  File "/usr/local/Cellar/virt-manager/2.1.0/libexec/share/virt-manager/virtManager/connection.py", line 1012, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/local/Cellar/virt-manager/2.1.0/libexec/share/virt-manager/virtinst/connection.py", line 138, in open
    open_flags)
  File "/usr/local/Cellar/virt-manager/2.1.0/libexec/lib/python3.7/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: internal error: received hangup event on socket
[Mon, 08 Apr 2019 19:01:03 virt-manager 11144] DEBUG (engine:441) Exiting app normally.

.ssh/config

Host $HOSTNAME
    User root
    IdentityFile $PATH_TO_KEY
    Port 2222

Works fine via SSH.

Woovie commented 5 years ago

Didn't read the README prior to following online guides to use this. Overriding the socket path fixed it.

virt-manager -c 'qemu+ssh://root@$DOMAIN/system?socket=/var/run/libvirt/libvirt-sock' --no-fork --debug

jeffreywildman commented 5 years ago

Thanks for updating with the solution, closing.