Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to contact settings server on Manjaro #2666

Closed
Cromagnon31 opened this issue May 11, 2023 · 19 comments
Closed

Unable to contact settings server on Manjaro #2666

Cromagnon31 opened this issue May 11, 2023 · 19 comments

Comments

@Cromagnon31
Copy link

Hi,

I need some help to resolve this issue.
xrdp is installed on an up to date Manjaro XFCE.
xrdp version is 0.9.21.1-1
xorgxrdp version is0.9.19.2

Xrdp was working fine. I did not use for some weeks and I didn't understand what is going wrong now.
I've tried to understand the trouble but without any success.

Connection and authentication seems ok, and after that I have a graphical error popup wich could be translated as: "Unable to contact settings server".

Thanks in advance for your help.

2023-05-11 14_47_49-owhomel1 - Connexion Bureau à distance

xrdp.log
xrdp-sesman.log

@matt335672
Copy link
Member

Here are a couple of links for you:-

#2646
#2647

It's almost certainly the first one of these which is caused by issue #1684

@Cromagnon31
Copy link
Author

Thanks for your help.

A/ I already had made the following changes when xrdp was working :

B/ Xrdp updates have removed pam_close_systemd_system_dbus.so entry in /etc/pam.d/xrdp-sesman
I recompile it to take last changes (#2646) in account and restore the entry.
Problem remain.

I set systemctl default-target to multi-user.target ( ##2258).
Problem remain.

I stop tigervnc service (x0vncserver)
Problem remain.

I also connect to xrdp with another user than those connected in ssh to to the tests
Problem remain

no .xsession-errors file generated

no errors in xrdp service status but errors in xrdp-sesman service :

● xrdp-sesman.service - xrdp session manager
Loaded: loaded (/usr/lib/systemd/system/xrdp-sesman.service; enabled; preset: disabled)
Active: active (running) since Sun 2023-05-14 10:39:33 CEST; 1h 4min ago
Docs: man:xrdp-sesman(8)
man:sesman.ini(5)
Process: 1031 ExecStart=/usr/bin/xrdp-sesman (code=exited, status=0/SUCCESS)
Main PID: 1045 (xrdp-sesman)
Tasks: 1 (limit: 17920)
Memory: 3.2M
CPU: 112ms
CGroup: /system.slice/xrdp-sesman.service
└─1045 /usr/bin/xrdp-sesman

mai 14 11:43:47 owhomel1 xrdp-sesman[1045]: [ERROR] sesman_data_in: scp_process_msg failed
mai 14 11:43:47 owhomel1 xrdp-sesman[3624]: pam_close_systemd_system_dbus(xrdp-sesman:session): "systemd-system-bus" was not defined
mai 14 11:43:47 owhomel1 xrdp-sesman[3624]: pam_unix(xrdp-sesman:session): session opened for user olivier(uid=1000) by (uid=0)
mai 14 11:43:47 owhomel1 xrdp-sesman[3624]: [INFO ] PAM: Web console: https://OwhomeL1:9090/ or https://192.168.3.9:9090/
mai 14 11:43:47 owhomel1 xrdp-sesman[1045]: [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
mai 14 11:43:47 owhomel1 xrdp-sesman[3624]: [INFO ] Found X server running at /tmp/.X11-unix/X10
mai 14 11:43:47 owhomel1 xrdp-sesman[3624]: [INFO ] Session started successfully for user olivier on display 10
mai 14 11:43:47 owhomel1 xrdp-sesman[3624]: [INFO ] Session in progress on display 10, waiting until the window manager (pid 3625) exits to e>
mai 14 11:43:50 owhomel1 xrdp-sesman[1045]: [INFO ] Process 3624 has exited
mai 14 11:43:50 owhomel1 xrdp-sesman[1045]: [INFO ] ++ terminated session: username olivier, display :10.0, session_pid 3624, ip ::ffff:192.>
lines 1-23/23 (END)

No solution found at this time.

@matt335672
Copy link
Member

Can you get a terminal window open in your session?

If so, what do you get for these commands:-

env | sort
systemctl --user status

@Cromagnon31
Copy link
Author

I hope it's what you expect.

env-systemctl_status-20230515.log

@matt335672
Copy link
Member

That's an empty file, and not at all expected.

Try this:-

  1. sudo apt install xterm
  2. Edit /etc/xrdp/startwm.sh. Near the top after the header comment add the line xterm.
  3. Try to connect again. You should get an xterm up.
  4. In the xterm, type these commands. The first command uses '>' to create a file and the second uses '>>' to append to it.
    env | sort >~/xrdp-test.log 2>&1
    systemctl --user status >>~/xrdp-test.log 2>&1
    

Press CTRL-D to exit the xterm
You should then have a file ~/xrdp-test.log which you can paste here.

@Cromagnon31
Copy link
Author

Sorry, it's not what I expected too...

env-systemctl_status-20230515_xfce.log

env-systemctl_status-20230515_xterm.log

@matt335672
Copy link
Member

Thanks.

Those both look absolutely fine. The systemd --user instance is running in both cases, and that's normally what the problem is.

What does your /etc/xrdp/startwm.sh look like?

@Cromagnon31
Copy link
Author

startwm.sh, same version than the .pacnew version. The .pacsave version doesn't work at all (fall to xterm !!!)

startwm.zip

@matt335672
Copy link
Member

We need to trace this I think.

Can you type in the following when logged in as the target user and then post the output?

DISPLAY= bash -x /etc/xrdp/startwm.sh

Also, do you have anything in ~/.xinitrc?

@Cromagnon31
Copy link
Author

Normaly nothing particular in .xinitrc. xfce as default desktop.

display-startwm_sh-xinitrc.zip

@matt335672
Copy link
Member

Thanks.

For the benefit of anyone else following this we're getting this in the log:-

++ exec dbus-launch --sh-syntax --exit-with-session xfce4-session
xfce4-session: Impossible d’ouvrir l’affichage : .
Taper « xfce4-session --help » pour plus d’aide.

En Anglais:-

Failed to open display: .
Type "xfce4-session --help" for more help.

That's fine - we set the DISPLAY to a dummy value to trace the script.

What isn't fine is that a D-Bus session is being created for you by systemd --user, and then you're running your session in a separate D-Bus session.

I think your get_session() function should look more like this:-

get_session(){
        local args=
        if [[ -z $DBUS_SESSION_BUS_ADDRESS ]]; then
        	# Need dbus-session
		args+=(dbus-launch --sh-syntax --exit-with-session)
	fi
	case "$1" in
		awesome) args+=(awesome) ;;
		bspwm) args+=(bspwm-session) ;;
		budgie) args+=(budgie-desktop) ;;
		cinnamon) args+=(cinnamon-session) ;;
		deepin) args+=(startdde) ;;
		enlightenment) args+=(enlightenment_start) ;;
		fluxbox) args+=(startfluxbox) ;;
		gnome) args+=(gnome-session) ;;
		i3|i3wm) args+=(i3 --shmlog-size 0) ;;
		jwm) args+=(jwm) ;;
		kde) args+=(startplasma-x11) ;;
		lxde) args+=(startlxde) ;;
		lxqt) args+=(lxqt-session) ;;
		mate) args+=(mate-session) ;;
		xfce) args+=(xfce4-session) ;;
		openbox) args+=(openbox-session) ;;
		*) args+=("$1") ;;
	esac

	echo "${args[*]}"  
}

Can you edit your xinitrc and change the function to look like that? Then try logging in again. If it doesn't work, please post another trace.

@Cromagnon31
Copy link
Author

Error is now quite different. After login screen, Blue background switch to black and client exits.

below xrdp-sesman.log. I attached display-startwm.sh logs. One from ssh, the other from Manjaro's xfce terminal.
I also attached .xinitrc with dbus presence test inserted.
Do you need more ?

[20230517-14:56:41] [INFO ] starting xrdp-sesman with pid 241275
[20230517-14:57:10] [INFO ] Socket 12: AF_INET6 connection received from ::1 port 55374
[20230517-14:57:10] [INFO ] Terminal Server Users group is disabled, allowing authentication
[20230517-14:57:10] [INFO ] ++ created session (access granted): username olivier, ip ::ffff:192.168.3.116:52988 - socket: 12
[20230517-14:57:10] [INFO ] starting Xorg session...
[20230517-14:57:10] [INFO ] Starting session: session_pid 241281, display :10.0, width 1920, height 1080, bpp 24, client ip ::ffff:192.168.3.116:52988 - socket: 12, user name olivier
[20230517-14:57:10] [INFO ] [session start] (display 10): calling auth_start_session from pid 241281
[20230517-14:57:10] [ERROR] sesman_data_in: scp_process_msg failed
[20230517-14:57:10] [INFO ] PAM: Web console: https://OwhomeL1:9090/ or https://192.168.3.9:9090/

[20230517-14:57:10] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
[20230517-14:57:10] [INFO ] Starting X server on display 10: /usr/lib/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20230517-14:57:10] [INFO ] Found X server running at /tmp/.X11-unix/X10
[20230517-14:57:10] [INFO ] Found X server running at /tmp/.X11-unix/X10
[20230517-14:57:10] [INFO ] Found X server running at /tmp/.X11-unix/X10
[20230517-14:57:10] [INFO ] Session started successfully for user olivier on display 10
[20230517-14:57:10] [INFO ] Session in progress on display 10, waiting until the window manager (pid 241282) exits to end the session
[20230517-14:57:10] [INFO ] Starting the xrdp channel server for display 10
[20230517-14:57:10] [INFO ] Starting the default window manager on display 10: /etc/xrdp/startwm.sh
[20230517-14:57:11] [WARN ] Window manager (pid 241282, display 10) exited quickly (1 secs). This could indicate a window manager config problem
[20230517-14:57:11] [INFO ] Calling auth_stop_session and auth_end from pid 241281
[20230517-14:57:11] [INFO ] Terminating X server (pid 241283) on display 10
[20230517-14:57:11] [INFO ] Terminating the xrdp channel server (pid 241316) on display 10
[20230517-14:57:11] [INFO ] X server on display 10 (pid 241283) returned exit code 0 and signal number 0
[20230517-14:57:11] [INFO ] xrdp channel server for display 10 (pid 241316) exit code 0 and signal number 0
[20230517-14:57:11] [INFO ] cleanup_sockets:
[20230517-14:57:11] [INFO ] Process 241281 has exited
[20230517-14:57:11] [INFO ] ++ terminated session: username olivier, display :10.0,
session_pid 241281, ip ::ffff:192.168.3.116:52988 - socket: 12
[20230517-14:57:18] [INFO ] sesman_main_loop: sesman asked to terminate
[20230517-14:57:19] [INFO ] starting xrdp-sesman with pid 241367

display-startwm_sh-2-ssh.log
display-startwm_sh-2-term.log
xinitrc.txt

@matt335672
Copy link
Member

Both those logs look a lot better.

Problem now is the session is starting and exiting quickly:-

[20230517-14:57:11] [WARN ] Window manager (pid 241282, display 10) exited quickly (1 secs). This could indicate a window manager config problem

Add this near the top of your .xinitrc

if [ -n "$XRDP_SESSION" ]; then
    set -x
    exec >~/xrdp-debug.log 2>&1
fi

That will give us a debug log in ~/xrdp-debug.log which should (hopefully) tell us why XFCE is struggling.

You're not logged in as olivier on the console at the same time are you? That won't work. See the FAQ

@Cromagnon31
Copy link
Author

@matt335672 You where right concerning a the user olivier already logged onto the graphical console. It seems to be the cause of the last issue.

Many thanks, xrdp is working again on my Manjaro XFCE.

So the trouble came from dbus session already created. I don't kwo why this appear now.
A Manjaro update ? A systemd update systemd 252 (252.10-2-manjaro) ?

As xrdp is working as expected, It' may be a good idea to expose my .xinitrc file as it's working well isn't it ?

This leads to other questions :

  • what the best/simple way to enforce a single graphical session per user ?
  • is it still a good idea to make xrdp multi user ?
    ° Using nest-systemd-user ?
    If yes I didn't find to implement it !

The weakness of xrdp is that it's quite slow. Poping up start menu count in seconds...
xrdp is running on an AMD A10-7700K then I I've tried xorgxrdp-glamor. Bad idea... Worse than evil. Starting Firefox take tens of seconds. Revert back to xorgxrdp ! - what are the tuning options to speed it up ?

@Cromagnon31 Cromagnon31 changed the title Unable to contact settings server Unable to contact settings server on Manjaro May 17, 2023
@matt335672
Copy link
Member

  • what the best/simple way to enforce a single graphical session per user ?

We don't have one yet. This is being tracked in #2491

xrdp is fine with mutiple sessions-per-user on FreeBSD and Devuan. The issue is with the way that systemd --user works. nest-systemd-user is a possible workaround, but it's only really been tried on Ubuntu up 'til now.

The best option for performance on xorgxrdp currrently is to use RemoteFX. This is not supported for Windows 11 clients - ~Microsoft have deprecated it (#2400). For the Windows 10 client, you need to set your connection speed to 'LAN' on the experience tab of MSTSC and make sure you're using 32-bit colour. Other clients will have their own ways of implementing it.

Also:-

  1. try the Xvnc backend which works differently and may give you better performance.
  2. try disabling desktop features which may cause a lot of data to be sent at once (e.g. shadows, live backgrounds, XFCE compositor).

@Cromagnon31
Copy link
Author

@matt335672

Sorry for the lack of feedback. I had already wrote a message a week ago but I guess I didn't validate the preview. So I write it again...

In fact multiple session per user is not my priority. I'll follow #2491 issue.

Remote FX seems not the good horse. It's deprecated and removed for all windows versions now.
https://support.microsoft.com/en-us/topic/kb4570006-update-to-disable-and-remove-the-remotefx-vgpu-component-in-windows-bbdf1531-7188-2bf4-0de6-641de79f09d2

The best optimisation was to remove background picture. XFCE Compositor was already disabled.

I alreay use VNC (TigerVNC seems better than X11VNC) for but it lacks of security/encryption. I didn't find an easy way to use SSH tunnel with Windows clients.

An important info :
With D-bus already launched https://github.com/matt335672/pam_close_systemd_system_dbus workaroud of #1684 is no more necessary. Privileges elevation dialog boxes are popping up fine without.

To conclude I've made a clean Xrdp installation on a new Manjaro (22.1.3).
Below the how to.

  • Installation of xrdp (0.9.21.1-1) and xorg-xrdp (0.9.19-2) with GUI

  • Starting and enabling xrdp sercices :

sudo systemctl start xrdp-sesman xrdp
sudo systemctl enable xrdp-sesman xrdp

  • Verify or edit /etc/xrdp/sesman.ini and update Xorg section as explained :
[Xorg]
param=/usr/lib/xorg
  • Create or modify /etc/X11/Xwrapper.config and add the following lines :
# Allow anyone to start X
allowed_users=anybody
  • Add default session destop and launch D-bus session if not already done in ~/.xinitrc.
#!/bin/bash
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

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

SESSION=${1:-xfce}

# 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

get_session(){
        local args=
        if [[ -z $DBUS_SESSION_BUS_ADDRESS ]]; then
        # Need dbus-session
                args+=(dbus-launch --sh-syntax --exit-with-session)
        fi
        case "$1" in
                awesome) args+=(awesome) ;;
                bspwm) args+=(bspwm-session) ;;
                budgie) args+=(budgie-desktop) ;;
                cinnamon) args+=(cinnamon-session) ;;
                deepin) args+=(startdde) ;;
                enlightenment) args+=(enlightenment_start) ;;
                fluxbox) args+=(startfluxbox) ;;
                gnome) args+=(gnome-session) ;;
                i3|i3wm) args+=(i3 --shmlog-size 0) ;;
                jwm) args+=(jwm) ;;
                kde) args+=(startplasma-x11) ;;
                lxde) args+=(startlxde) ;;
                lxqt) args+=(lxqt-session) ;;
                mate) args+=(mate-session) ;;
                xfce) args+=(xfce4-session) ;;
                openbox) args+=(openbox-session) ;;
                *) args+=("$1") ;;
        esac

        echo "${args[*]}"
}

@matt335672
Copy link
Member

Thanks for that @Cromagnon31

I'd like to add that your Xwrapper.config shouldn't be necessary. See this comment for CentOS 8 and also #2253 for Arch. On Arch/Manjaro, the setting should be param=/usr/lib/Xorg I think.

@Cromagnon31
Copy link
Author

@matt335672 You're right for Xwrapper.config. It's not necessary. I've removed it.
Should I edit the post to remove Xwrapper.config and change the X of Xorg in capital letter ?

@matt335672
Copy link
Member

I shouldn't worry @Cromagnon31. I like to think that the users reading this forum have the ability to read more than a single post when trying to resolve issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants