Coder Social home page Coder Social logo

Comments (15)

Venomen avatar Venomen commented on May 19, 2024 11

There is simple solution ;). In my case, I had to run it from console and use debug.. so I could write and use password!! :X :d don't ask why, it just don't work from program menu.. OS X El Capitan, all installed from brew.

virt-manager -c "qemu+ssh://[email protected]:6666/system?socket=/var/run/libvirt/libvirt-sock" --debug

from homebrew-virt-manager.

xvladi avatar xvladi commented on May 19, 2024 6

I have the same error with virt-manager like you.

Same URI with virsh:

$ virsh -c qemu+ssh://user@host/system
error: failed to connect to the hypervisor
error: An error occurred, but the cause is unknown

using

$ virsh -c qemu+ssh://user@host/system?socket=/var/run/libvirt/libvirt-sock
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh #

according to the Readme works.

Same success with virt-manager:

virt-manager -c qemu+ssh://user@host/system?socket=/var/run/libvirt/libvirt-sock

(virt-manager@OSX 10.11 -> libvirtd@centos7)

from homebrew-virt-manager.

sklav avatar sklav commented on May 19, 2024 2

similar issue using virt-manager from mac. but works if i use sudo and connection string as above.

Solution for those interested is to modify /usr/local/etc/libvirt/libvirt.conf
add your connection string like above using the examples.

then sudo virt-manager -c hostname

I am able to get virsh working from the command line when using sudo
example: sudo virsh -c connect-string list seems to work for me also make sure root has ssh key copied over. maybe not the best solution but works for me till something better comes along.

from homebrew-virt-manager.

jeffreywildman avatar jeffreywildman commented on May 19, 2024

Hi, what is the command (with options, redacted if necessary) that you are running? This error message looks related to authentication issues. You may need to supply --no-fork or --debug to get SSH password prompts to display, or set up SSH keys.

from homebrew-virt-manager.

krjw avatar krjw commented on May 19, 2024

Thanks for the quick reply. I try to connect via the gui in virt-manager.

File>AddConnection

Hypervisor QEMU/KVM
Method SSH
user ****
hostname ****

have added sshkeys to the server ... still no luck

here the debug message

[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (cli:256) Launched with command line: /usr/local/Cellar/virt-manager/1.3.1/libexec/share/virt-manager/virt-manager --debug
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (virt-manager:143) virt-manager version: 1.3.1
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (virt-manager:144) virtManager import: <module 'virtManager' from '/usr/local/Cellar/virt-manager/1.3.1/libexec/share/virt-manager/virtManager/init.pyc'>

(process:58669): Gtk-WARNING : Locale not supported by C library.
Using the fallback 'C' locale.
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (virt-manager:203) GTK version: 3.18.6
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (engine:496) libguestfs inspection support: False
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (systray:154) Showing systray: False
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (engine:1028) processing cli command uri= show_window= domain=
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (engine:1030) No cli action requested, launching default window
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (manager:203) Showing manager
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (engine:401) window counter incremented to 1
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (engine:158) No stored URIs found.
[Wed, 16 Dec 2015 21:10:11 virt-manager 58669] DEBUG (engine:140) Initial gtkapplication activated
[Wed, 16 Dec 2015 21:10:12 virt-manager 58669] DEBUG (engine:225) Determining default libvirt URI
[Wed, 16 Dec 2015 21:10:12 virt-manager 58669] DEBUG (packageutils:39) No PackageKit packages to search for.
[Wed, 16 Dec 2015 21:10:18 virt-manager 58669] DEBUG (connect:104) Couldn't contact avahi: g-io-error-quark: Could not connect: (1)
[Wed, 16 Dec 2015 21:10:18 virt-manager 58669] DEBUG (connect:145) Showing open connection
[Wed, 16 Dec 2015 21:10:27 virt-manager 58669] DEBUG (connect:437) Generate URI=qemu+ssh:///system, auto=False
[Wed, 16 Dec 2015 21:10:27 virt-manager 58669] DEBUG (connect:134) Closing open connection
[Wed, 16 Dec 2015 21:10:27 virt-manager 58669] DEBUG (connection:568) conn=qemu+ssh:///system changed to state=Connecting
[Wed, 16 Dec 2015 21:10:27 virt-manager 58669] DEBUG (connection:887) Scheduling background open thread for qemu+ssh://****_/system
[Wed, 16 Dec 2015 21:10:28 virt-manager 58669] DEBUG (connection:568) conn=qemu+ssh://
_*/system changed to state=Disconnected
[Wed, 16 Dec 2015 21:10:28 virt-manager 58669] DEBUG (engine:638) connect_error: conn transport=ssh
[Wed, 16 Dec 2015 21:10:28 virt-manager 58669] 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.

Would you still like to remember this connection?
details=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://*****

Traceback (most recent call last):
File "/usr/local/Cellar/virt-manager/1.3.1/libexec/share/virt-manager/virtManager/connection.py", line 903, in _do_open
self._backend.open(self._do_creds_password)
File "/usr/local/Cellar/virt-manager/1.3.1/libexec/share/virt-manager/virtinst/connection.py", line 148, in open
open_flags)
File "/usr/local/Cellar/virt-manager/1.3.1/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

Thanks for helping!!!

from homebrew-virt-manager.

jeffreywildman avatar jeffreywildman commented on May 19, 2024

What is the form of the Libvirt URI you are using? Perhaps try connecting to the same Libvirt URI using the command virsh? If you can't connect using virsh, then the problem may be localized to the URI.

from homebrew-virt-manager.

krjw avatar krjw commented on May 19, 2024

the uri is just an ip address/system ok i'll try virsh thx :D

from homebrew-virt-manager.

jeffreywildman avatar jeffreywildman commented on May 19, 2024

Also see the Readme for notes on socket location overriding.

from homebrew-virt-manager.

krjw avatar krjw commented on May 19, 2024

now I get this with virsh and virt-manager -c ***:
error: authentication failed: unsupported authentication type 2

from homebrew-virt-manager.

krjw avatar krjw commented on May 19, 2024

ssh keys are copied and i can do a normal ssh login with both root and the user i want to use for virt-manager. the problem i have now encountered is that the user apparently does not have the rights to use libvirtd... and it doesnt help to be part of the group libvirtd... i need to configure polkit to access virsh from the normal user. here is a helpful link addressing this problem:
http://www2.linuxsysadmintutorials.com/configure-polkit-to-run-virsh-as-a-normal-user/
although there seems to be a problem with the if statement as the comments describe below.
I hope this helps! I have not configured it yet due to maintenance work on the server, but I will work on it asap. Merry christmas and happy celebrating!

from homebrew-virt-manager.

krjw avatar krjw commented on May 19, 2024

Thanks a lot worked for me too! Shall I close this? Or is it still considered an issue?

Greetings,
i7clock

from homebrew-virt-manager.

Venomen avatar Venomen commented on May 19, 2024

I think it should be repaired cause you can't use password in popup menu in program gui.

from homebrew-virt-manager.

jeffreywildman avatar jeffreywildman commented on May 19, 2024

On Ubuntu, openssh-askpass provides the graphical prompt for SSH passwords when using virt-manager. After a quick search, it does not appear that this dependency is readily available for OSX, possibly due to different keychain management (outside my area of knowledge). However, during installation, virt-manager may be pointed to a suitable replacement with the --askpass-package-names= option to setup.py. Time permitting, this should be pushed upstream.

from homebrew-virt-manager.

toddpfaff avatar toddpfaff commented on May 19, 2024

I was having the "libvirtError: An error occurred, but the cause is unknown" problem and some searching lead me to the solution mentioned above - adding the ?socket argument to the connection URI string. That solved the problem for me in the case of a simple virsh command or a virt-manager connection to a single remote libvirtd.

Does anyone know how to then get virt-manager to use such strings in connections? I'm not talking about the case where one runs virt-manager with a connection URI on the command line, but rather the case where one wants to create multiple remote libvirt connections from one virt-manager connection using the virt-manager File, Add connection dialog. The Generated URI will be of the form qemu+ssh://Username@Hostname/system, but we need this to have the ?socket string appended in order to work around the problem discussed above.

I also know that on a linux system virt-manager uses dconf to store connection URIs at path [org/virt-manager/virt-manager/connections] in the file typically found in ~/.config/dconf/user.

Does virt-manager on MacOS use dconf? If not, where does it store connection URIs? Once I know that I can try to enter them manually with the ?socket string appended.

Alternatively, is there another solution to this problem that doesn't require the ?socket string?

from homebrew-virt-manager.

Moep90 avatar Moep90 commented on May 19, 2024

Added an Alias
alias virt-manager="virt-manager -c qemu+ssh://usr@hostname:port/system?socket=/var/run/libvirt/libvirt-sock"

from homebrew-virt-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.