Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1684632 - "internal error: Unable to parse URI qemu+ssh://.../system"
Summary: "internal error: Unable to parse URI qemu+ssh://.../system"
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-01 17:12 UTC by ricky.tigg
Modified: 2019-03-11 19:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-11 13:37:46 UTC


Attachments (Terms of Use)

Description ricky.tigg 2019-03-01 17:12:50 UTC
Description of problem: ..."Unable to parse URI qemu+ssh://.../system"

Version-Release number of component: virt-manager.noarch 2.1.0-1.fc29 @updates

Under File ==> Add Connection... , qemu:///system as URI.

Actual results:
Unable to connect to libvirt qemu+ssh://yk@yk@192.168.122.127/system.
internal error: Unable to parse URI qemu+ssh://yk@yk@192.168.122.127/system
Verify that the 'libvirtd' daemon is running on the remote host.
Libvirt URI is: qemu+ssh://yk@yk@192.168.122.127/system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1012, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/share/virt-manager/virtinst/connection.py", line 138, in open
    open_flags)
  File "/usr/lib64/python3.7/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: internal error: Unable to parse URI qemu+ssh://yk@yk@192.168.122.127/system

Expected results: Connection to be recognized as valid.

Additional info: 
Remote connection to guest from virtual terminal is successful:
................................................................................
$ ssh yk@192.168.122.127
The authenticity of host '192.168.122.127 (192.168.122.127)' can't be established.
ECDSA key fingerprint is SHA256:lVflosLuheP1PJyTIhIi3pcykSAD/OE6rQwNqoQuOZ8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.122.127' (ECDSA) to the list of known hosts.

$ systemctl | grep libvirtd
libvirtd.service               loaded active running   Virtualization daemon
................................................................................
On host:
virsh # net-info default
Bridge:         virbr0

The hostname is for an unknown reason not recognized:

virsh # net-dhcp-leases default
 Expiry Time  MAC address  Protocol  IP address           Hostname     Client ID or DUID
--------------------------------------------------------------------------------
 (...)       (...)         ipv4      192.168.122.127/24   -            ff:00:...

Comment 1 Daniel Berrange 2019-03-01 17:16:02 UTC
The problem isn't the hostname, it is that the username in the URI is duplicated  'yk@yk@'

Comment 2 ricky.tigg 2019-03-01 17:30:14 UTC
Even reading my own text for syntax errors, I could'not see the whole text any more. That indicated, that I should have stop working hours earlier, instead of getting tired. Thanks Daniel B.

Comment 3 ricky.tigg 2019-03-04 20:06:41 UTC
Actual results now while correct syntaxes have been used:

Unable to connect to libvirt qemu+ssh://yk@192.168.122.127/system.
Configure SSH key access for the remote host, or install an SSH askpass package locally.
Libvirt URI is: qemu+ssh://yk@192.168.122.127/system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1012, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/share/virt-manager/virtinst/connection.py", line 138, in open
    open_flags)
  File "/usr/lib64/python3.7/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Cannot recv data: ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
yk@192.168.122.127: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).: Connection reset by peer

Additional info: 
Remote classic SSH connection to guest from virtual terminal is successful still only if relying on the use of an IPv4 address.

Comment 4 Cole Robinson 2019-03-05 15:26:34 UTC
As the error suggests, if you don't have SSH keys setup you'll need to install an askpass provider for password prompting (openssh-askpass for example). And virt-manager explicitly does not have an RPM Requires on it because it's an optional component (and there's desktop specific providers so adding a general purpose dep is a pain)

Comment 5 ricky.tigg 2019-03-05 17:09:01 UTC
Thanks. It seems to me that SSH and QEMU+SSH have different requirements then.

Comment 6 ricky.tigg 2019-03-11 09:01:33 UTC
On host:
$ dnf list installed | grep openssh-askpass
openssh-askpass.x86_64                            7.9p1-4.fc29            @updates 

On guest:
$ systemctl | grep -Ei 'libvirt|polkit'
libvirtd.service                                  loaded active running   Virtualization daemon                                                          
polkit.service                                    loaded active running   Authorization Manager 

$ dnf list installed | grep -Ei 'libvirt-daemon|polkit'
libvirt-daemon.x86_64                  4.7.0-1.fc29                    @fedora  
polkit.x86_64                          0.115-2.fc29                    @anaconda
polkit-libs.x86_64                     0.115-2.fc29                    @anaconda
polkit-pkla-compat.x86_64              0.1-13.fc29                     @anaconda

Error produced:
Unable to connect to libvirt qemu+ssh://yk@192.168.122.127/system.
authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'
Verify that the 'libvirtd' daemon is running on the remote host.
Libvirt URI is: qemu+ssh://yk@192.168.122.127/system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1012, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/share/virt-manager/virtinst/connection.py", line 138, in open
    open_flags)
  File "/usr/lib64/python3.7/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'

Comment 7 Cole Robinson 2019-03-11 13:37:46 UTC
You need to enable polkit libvirt access for the yk user on the remote host:

https://blog.wikichoon.com/2016/01/polkit-password-less-access-for-libvirt.html

Comment 8 ricky.tigg 2019-03-11 17:21:44 UTC
Executed on guest:
$ sudo usermod -aG libvirt `whoami`
$ groups
yk wheel libvirt

Error produced:
Unable to connect to libvirt qemu+ssh://yk@192.168.122.127/system.
no connection driver available for qemu:///system
Verify that the 'libvirtd' daemon is running on the remote host.
Libvirt URI is: qemu+ssh://yk@192.168.122.127/system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1012, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/share/virt-manager/virtinst/connection.py", line 138, in open
    open_flags)
  File "/usr/lib64/python3.7/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: no connection driver available for qemu:///system

Comment 9 Daniel Berrange 2019-03-11 17:27:43 UTC
(In reply to ricky.tigg from comment #8)
> libvirt.libvirtError: no connection driver available for qemu:///system

I expect that error message comes from the remote libvirtd you are connecting to. Either the QEMU driver was not compiled into libvirt, or it was not installed, or it has failed to initialize during startup. I expect you'd see the same error if you do "ssh yk@192.168.122.127 virsh -c qemu:///system list"

Comment 10 ricky.tigg 2019-03-11 19:41:19 UTC
$ LANG=C ssh yk@192.168.122.127 virsh -c qemu:///system list
yk@192.168.122.127's password: 
bash: virsh: command not found

$ ssh yk@192.168.122.127 `which virsh` -c qemu:///system list
yk@192.168.122.127's password: 
bash: /usr/bin/virsh: No such file or directory

Commands "ssh yk@192.168.122.127", "virsh -c qemu:///system list" are executed when entered alone.


Note You need to log in before you can comment on or make changes to this bug.