libvirt remote uri format

Joe Muro joemuro at us.ibm.com
Mon Apr 6 14:45:27 UTC 2020


The client machine is running macOS. So that explains it. For my case,
hard-coding the socket path is not a major problem, although having libvirt
"auto-detect" the correct path would certainly be nice.

Thanks for your help.

- Joe



From:	Andrea Bolognani <abologna at redhat.com>
To:	Joe Muro <joemuro at us.ibm.com>, libvirt-users at redhat.com
Date:	04/06/2020 04:47 AM
Subject:	[EXTERNAL] Re: libvirt remote uri format



On Fri, 2020-04-03 at 19:37 -0500, Joe Muro wrote:
> Hi,
>
> I am using python libvirt api to get domain information. When using a uri
without specifying the socket path, an error occurs.
>
> uri = "qemu+ssh://myuser@some.kvm.host/system"
> conn = libvirt.open(uri)
>
> This results in the following:
>
> libvirt: XML-RPC error : internal error: received hangup event on socket
>
> If I append the socket path to the URI, it works. e.g.
>
> qemu
+ssh://myuser@some.kvm.host/system?socket=/var/run/libvirt/libvirt-sock
>
> Is this the recommended way to construct an ssh uri? My concern is that
the socket path may be different when connecting to different libvirt
hosts.
>
> remote host is ubuntu 20.04 running libvirtd (libvirt) 6.0.0 under
systemd

Is the client machine running macOS by any chance?

There is a long-standing issue where that platform will use different
paths for certain resources, including the libvirtd socket, and the
way it currently works is that the default socket path is chosen by
the client, so any mismatch will result in something like the above.

The plan is to replace our use of nc with a custom virt-nc helper
that will link against libvirt on the host side and will thus be able
to use the default socket path appropriate for the system; however,
as far as I'm aware nobody is currently working on it.

--
Andrea Bolognani / Red Hat / Virtualization



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20200406/09e9d38e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20200406/09e9d38e/attachment.gif>


More information about the libvirt-users mailing list