You are not logged in.

#1 2020-10-31 01:00:55

zheke
Member
Registered: 2019-06-05
Posts: 7

Authentication agent on XRDP

I'm trying to set up a headless server on which I need to connect remotely to the server and virtual machines (host and client running Arch) using XRDP(server) and Windows Remote Desktop(client), everything is good until I need to run software than need authentication agents, ie: gparted, virt-manager and/or gnome keyring ie: github desktop, I need to know if there is a way I have 3 days trying it everything I found on Internet, until today I've tried on Gnome, KDE Plasma, LXqt, XFCE, Openbox, I3, no matter what I do on my .xinitrc I currently have:

#!/bin/bash
...
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec dbus-run-session startxfce4

When I run Gpard on terminal this is the output:
Error executing command as another user: No authentication agent found.

If I try to manually run gnome polkit agent  from /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 I got:
polkit-gnome-authentication-agent-1:2125): polkit-gnome-1-WARNING **: 17:59:07.470: Unable to determine the session we are in: No session for pid 2125.

Hope you could give me some advice, before throwing my server through the window.

Offline

#2 2020-10-31 01:06:00

loqs
Member
Registered: 2014-03-06
Posts: 12,149

Re: Authentication agent on XRDP

Why are you starting startxfce4 with dbus-run-session?

exec dbus-run-session startxfce4

Please use code tags for command,  their outputs and listings e.t.c..
Edit:
Also please post the full contents of ~/.xinitrc

Last edited by loqs (2020-10-31 01:12:45)

Offline

#3 2020-10-31 03:48:19

zheke
Member
Registered: 2019-06-05
Posts: 7

Re: Authentication agent on XRDP

Thanks for the reply.

I haven't change anything on the default xinitrc code, othen ran deleting the tw default code and adding my session,
runing:

exec dbus-run-session -- startxfce4 

cause simple

exec startxfce4 

does not work for destops like xfce4 or kde, works for openbox and i3.

here is the xinit file

eramos@archserver ~ % cat .xinitrc
#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

#export XDG_SESSION_TYPE=x11
#export GDK_BACKEND=x11
exec dbus-run-session -- startxfce4 

Offline

#4 2020-10-31 03:59:43

loqs
Member
Registered: 2014-03-06
Posts: 12,149

Re: Authentication agent on XRDP

zheke wrote:
exec startxfce4 

does not work for destops like xfce4 or kde, works for openbox and i3.

What happens when you use the above?

Offline

#5 2020-10-31 04:17:24

zheke
Member
Registered: 2019-06-05
Posts: 7

Re: Authentication agent on XRDP

Shows the dialog:

Unable to contact settings server
Could not connect: connection refused

Offline

#6 2020-10-31 04:19:10

loqs
Member
Registered: 2014-03-06
Posts: 12,149

Re: Authentication agent on XRDP

Is the session broken?

Offline

#7 2020-10-31 04:30:45

zheke
Member
Registered: 2019-06-05
Posts: 7

Re: Authentication agent on XRDP

loqs wrote:

You mean if shows Remote=no and Active=yes?

This is the output:

eramos@archserver ~ % loginctl show-session $XDG_SESSION_ID
EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
RebootToBootLoaderMenu=18446744073709551615
BootLoaderEntries=arch.conf auto-reboot-to-firmware-setup
IdleHint=no
IdleSinceHint=1604117880081417
IdleSinceHintMonotonic=208953501
DelayInhibited=sleep
InhibitDelayMaxUSec=5s
UserStopDelayUSec=10s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=yes
LidClosed=no
OnExternalPower=yes
RemoveIPC=yes
RuntimeDirectorySize=1666162688
RuntimeDirectoryInodesMax=406778
InhibitorsMax=8192
NCurrentInhibitors=2
SessionsMax=8192
NCurrentSessions=1

Offline

#8 2020-10-31 04:34:52

loqs
Member
Registered: 2014-03-06
Posts: 12,149

Re: Authentication agent on XRDP

echo $XDG_SESSION_ID

My guess is the variable is not set.

Offline

#9 2020-10-31 04:59:22

zheke
Member
Registered: 2019-06-05
Posts: 7

Re: Authentication agent on XRDP

loqs wrote:
echo $XDG_SESSION_ID

My guess is the variable is not set.

You are right, it shows nothing, how is this environment variable is initialized?

Offline

#10 2020-10-31 05:12:35

loqs
Member
Registered: 2014-03-06
Posts: 12,149

Re: Authentication agent on XRDP

$XDG_SESSION_ID is set by pam_systemd in /etc/pam.d/system-login.
Are you using https://aur.archlinux.org/packages/xrdp-git/ which is built without pam support?
Auto detection picks up pam with the config for the service being /etc/pam.d/xrdp-sesman.

Last edited by loqs (2020-10-31 05:17:50)

Offline

#11 2020-10-31 05:24:21

zheke
Member
Registered: 2019-06-05
Posts: 7

Re: Authentication agent on XRDP

loqs wrote:

$XDG_SESSION_ID is set by pam_systemd in /etc/pam.d/system-login.
Are you using https://aur.archlinux.org/packages/xrdp-git/ which is built without pam support?

Im using xrdp-devel-git https://aur.archlinux.org/packages/xrdp-devel-git
I need xrdp 0.9.14 for xorgxrdp, and the non git is 0.9.13, shoud I change it on the make file?

Offline

#12 2020-10-31 05:32:52

loqs
Member
Registered: 2014-03-06
Posts: 12,149

Re: Authentication agent on XRDP

Check the journal,  when you login does it contain and an entry similar to the following:

systemd-logind[402]: New session c2 of user username

Offline

#13 2020-10-31 05:40:43

zheke
Member
Registered: 2019-06-05
Posts: 7

Re: Authentication agent on XRDP

loqs wrote:

Check the journal,  when you login does it contain and an entry similar to the following:

systemd-logind[402]: New session c2 of user username

This is the output:

Oct 30 22:35:44 archserver systemd-logind[411]: New session 2 of user eramos.
░░ Subject: A new session 2 has been created for user eramos
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
░░
░░ A new session with the ID 2 has been created for the user eramos.
░░
░░ The leading process of the session is 793.

I downgrade it to xrdp (non-git) and xorgxrdp-git (non-git is 0.9.14) it stills the same.

Offline

Board footer

Powered by FluxBB