pkttyagent doesn't seem to work for virt-manager over ssh -X?

1

0

TL;DR: I seem to be too stupid to use PolKit authentication over ssh?


I have two machines (running Fedora) with ssh public-key logins to a user with administrative privileges (groups e.g. wheel, adm).

When logging in locally on the “server” machine, I can run virt-manager to access various VM's that exist on it. However, when connecting via ssh -X -Cserver, I find that virt-manager immediately refuses to connect to the virtual machines saying that:

Virtual Machine Manager Connection Failure (on server)

Unable to connect to libvirt.

authentication failed: polkit: polkit\56retains_authorization_after_challenge=1 Authorization requires authentication but no agent is available.

I've tried the naïve approach of launching it like this:

 virt-manager & pkttyagent -p $(pgrep virt-manager)

… but all I'm left with is:

  • pkttyagent is silent;
  • virt-manager exits as soon as I close the error dialog box.

Can anyone suggest a way to, perhaps, register pkttyagent prior to running virt-manager, or else register another authentication agent over ssh -X?

→ It should be noted that running virt-manager as root remotely isn't even an option (effectively) because I have VM's that run under my own user account (qemu user-mode, accessible via Gnome Boxes) as well as system-wide ones, and the local-user definitions aren't accessible by root. Even if I didn't fear the idea of running an X app as root in the first place…

BRPocock

Posted 2014-02-28T17:55:39.927

Reputation: 181

Answers

2

This command worked on my system:

virt-manager ; pkttyagent --process $(pgrep virt-manager)

Abdelouahed Haitoute

Posted 2014-02-28T17:55:39.927

Reputation: 21

That's something I'd tried (with the & rather than ; to allow it to run in background), but did not seem to work… – BRPocock – 2014-07-10T18:01:17.447

1There's a different between & and ;. The ; is in my case the correct way. Do you get by the way an error message when using ;? – Abdelouahed Haitoute – 2014-07-10T22:14:33.583

1

Have you tried running a graphical agent? For example, lxpolkit, polkit-gnome-authentication-agent-1, or polkit-kde-authentication-agent-1.

Alternatively, you could write a polkit rule that would remove the authentication requirement, either for a specific user or for 'wheel' members.


(Note that 'adm' does not normally mean "administrative privileges"; it means access to system logs and accounting data.)

user1686

Posted 2014-02-28T17:55:39.927

Reputation: 283 655

(:facepalm:) I had tried this, but I misinterpreted the error messages it spouts. /usr/libexec/polkit-gnome-authentication-agent-1 moans about failing to connect to a DBus socket — but, it I background it and then run virt-manager, it does in fact work. Apparently the WARNING it prints is related to a11y, and there's no positive indication that it worked regardless. edit maaaybe. It seems to hang before allowing me to enter a password, but it may just be super slow for some reason. – BRPocock – 2014-02-28T18:45:25.763