Closed duan-1 closed 6 months ago
Problem is here:-
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [WARN ] Window manager (pid 3495, display 10) . This could indicate a window manager config problem
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [WARN ] Window manager (pid 3495, display 10) exited quickly (0 secs). This could indicate a window manager config problem
Very often this can be caused by having the same user logged in on the machine console as you are trying to use for XRDP. This isn't supported and is in the FAQ.
Can you confirm that you're not logged in to the console as the same user?
If that's not it, check /home/patoria/.xsession-errors
to see if there are more clues in there.
What I can confirm is that I have logged out. But /home/patoria/.xsession-errors
does not exist in my account directory.
If there's no .xsession-errors
, we're not getting as far as starting the session:-
1) Check the session script is executable:-
ls -l /etc/xrdp/startwm.sh
2) Try this in an ssh session, so we can see if there's a problem with the startwm.sh
script. This command won't succeed, but will run the script with tracing enabled. Be aware there's a space after the '='.
DISPLAY= /bin/sh -x /etc/xrdp/startwm.sh
Thank you very much for your patience.Script is executable,I got the following results after running DISPLAY= /bin/sh -x /etc/xrdp/startwm.sh
.
+ wm_start
+ '[' -r /etc/locale.conf ']'
+ . /etc/locale.conf
++ LANG=zh_CN.UTF-8
+ export LANG LANGUAGE
+ '[' -r /home/patoria/.xinitrc ']'
+ pre_start
+ '[' -r /etc/profile ']'
+ . /etc/profile
++ append_path /usr/local/sbin
++ case ":$PATH:" in
++ append_path /usr/local/bin
++ case ":$PATH:" in
++ append_path /usr/bin
++ case ":$PATH:" in
++ export PATH
++ test -d /etc/profile.d/
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/debuginfod.sh
++ . /etc/profile.d/debuginfod.sh
+++ '[' -z 'https://debuginfod.archlinux.org ' ']'
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/freetype2.sh
++ . /etc/profile.d/freetype2.sh
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/gawk.sh
++ . /etc/profile.d/gawk.sh
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/gpm.sh
++ . /etc/profile.d/gpm.sh
+++ case $(/usr/bin/tty) in
++++ /usr/bin/tty
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/locale.sh
++ . /etc/profile.d/locale.sh
+++ '[' -z zh_CN.UTF-8 ']'
+++ LANG=zh_CN.UTF-8
+++ export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/PackageKit.sh
++ . /etc/profile.d/PackageKit.sh
+++ [[ -n '' ]]
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/perlbin.sh
++ . /etc/profile.d/perlbin.sh
+++ '[' -d /usr/bin/site_perl ']'
+++ append_path /usr/bin/site_perl
+++ case ":$PATH:" in
+++ '[' -d /usr/bin/vendor_perl ']'
+++ append_path /usr/bin/vendor_perl
+++ case ":$PATH:" in
+++ '[' -d /usr/bin/core_perl ']'
+++ append_path /usr/bin/core_perl
+++ case ":$PATH:" in
+++ export PATH
++ for profile in /etc/profile.d/*.sh
++ test -r /etc/profile.d/vte.sh
++ . /etc/profile.d/vte.sh
+++ '[' -n '5.2.26(1)-release' -o -n '' ']'
+++ [[ hxB == *i* ]]
+++ return 0
++ unset profile
++ unset -f append_path
++ test /bin/sh
++ test ''
++ unset TERMCAP
++ unset MANPATH
+ '[' -r /home/patoria/.bash_profile ']'
+ . /home/patoria/.bash_profile
++ [[ -f /home/patoria/.bashrc ]]
++ . /home/patoria/.bashrc
+++ [[ hxB != *i* ]]
+++ return
+ return 0
+ . /home/patoria/.xinitrc
++ userresources=/home/patoria/.Xresources
++ usermodmap=/home/patoria/.Xmodmap
++ sysresources=/etc/X11/xinit/.Xresources
++ sysmodmap=/etc/X11/xinit/.Xmodmap
++ '[' -f /etc/X11/xinit/.Xresources ']'
++ '[' -f /etc/X11/xinit/.Xmodmap ']'
++ '[' -f /home/patoria/.Xresources ']'
++ '[' -f /home/patoria/.Xmodmap ']'
++ '[' -d /etc/X11/xinit/xinitrc.d ']'
++ for f in /etc/X11/xinit/xinitrc.d/?*.sh
++ '[' -x /etc/X11/xinit/xinitrc.d/40-libcanberra-gtk-module.sh ']'
++ . /etc/X11/xinit/xinitrc.d/40-libcanberra-gtk-module.sh
+++ case "${DESKTOP_SESSION-}" in
+++ '[' -z '' ']'
+++ GTK_MODULES=canberra-gtk-module
+++ export GTK_MODULES
++ for f in /etc/X11/xinit/xinitrc.d/?*.sh
++ '[' -x /etc/X11/xinit/xinitrc.d/50-systemd-user.sh ']'
++ . /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
+++ systemctl --user import-environment DISPLAY XAUTHORITY
Environment variable $XAUTHORITY not set, ignoring.
+++ command -v dbus-update-activation-environment
+++ dbus-update-activation-environment DISPLAY XAUTHORITY
++ for f in /etc/X11/xinit/xinitrc.d/?*.sh
++ '[' -x /etc/X11/xinit/xinitrc.d/80xapp-gtk3-module.sh ']'
++ . /etc/X11/xinit/xinitrc.d/80xapp-gtk3-module.sh
+++ '[' -z '' ']'
+++ GTK3_MODULES=xapp-gtk3-module
+++ export GTK3_MODULES
++ unset f
++ twm
++ local runcnf=1
++ local retval=127
++ [[ hxB == *\i* ]]
++ runcnf=0
++ xclock -geometry 50x50-1+1
++ [[ ! -S /run/dbus/system_bus_socket ]]
++ [[ ! -x /usr/lib/packagekitd ]]
++ [[ -n '' ]]
++ [[ ! -x /usr/lib/pk-command-not-found ]]
++ '[' 0 -eq 1 ']'
++ [[ -n 5.2.26(1)-release ]]
++ local runcnf=1
++ local retval=127
++ [[ hxB == *\i* ]]
++ runcnf=0
++ [[ ! -S /run/dbus/system_bus_socket ]]
++ [[ ! -x /usr/lib/packagekitd ]]
++ [[ -n '' ]]
++ [[ ! -x /usr/lib/pk-command-not-found ]]
++ '[' 0 -eq 1 ']'
++ [[ -n 5.2.26(1)-release ]]
++ exec xterm -geometry 80x66+0+0 -name login
++ xterm -geometry 80x50+494+51
+++ gettext PackageKit 'command not found'
++ xterm -geometry 80x20+494-0
+++ gettext PackageKit 'command not found'
++ local runcnf=1
++ local runcnf=1
++ local retval=127
++ local retval=127
++ [[ hxB == *\i* ]]
++ [[ hxB == *\i* ]]
++ runcnf=0
++ runcnf=0
++ [[ ! -S /run/dbus/system_bus_socket ]]
++ [[ ! -S /run/dbus/system_bus_socket ]]
++ [[ ! -x /usr/lib/packagekitd ]]
++ [[ ! -x /usr/lib/packagekitd ]]
++ [[ -n '' ]]
++ [[ -n '' ]]
++ [[ ! -x /usr/lib/pk-command-not-found ]]
++ [[ ! -x /usr/lib/pk-command-not-found ]]
++ '[' 0 -eq 1 ']'
++ '[' 0 -eq 1 ']'
++ [[ -n 5.2.26(1)-release ]]
++ [[ -n 5.2.26(1)-release ]]
/home/patoria/.xinitrc: Line 55:exec: xterm: not found
+++ gettext PackageKit 'command not found'
+++ gettext PackageKit 'command not found'
++ printf 'bash: %s%s\n' 'twm: ' command not found
bash: twm: command not found
++ return 127
++ printf 'bash: %s%s\n' 'xclock: ' command not found
bash: xclock: command not found
++ return 127
++ printf 'bash: %s%s\n' 'xterm: ' command not found
bash: xterm: command not found
++ return 127
++ printf 'bash: %s%s\n' 'xterm: ' command not found
bash: xterm: command not found
++ return 127
Looks like startwm.sh
is unaware it needs to start KDE.
I'm not hugely familiar with Arch, and how xrdp is packaged for it. However, from https://wiki.archlinux.org/title/Xrdp :-
After successfully starting a display server, xrdp will execute
/etc/xrdp/startwm.sh
by default. This script is meant to start a window manager (similar to .xinitrc) and will read from~/.xinitrc
or/etc/X11/xinit/xinitrc
if they exist. It is recommended to edit~/.xinitrc
to start your desktop environment or window manager, but you can also edit/etc/xrdp/startwm.sh
If you don't have a suitable ~/.xinitrc
, here's one from a Manjaro VM I have. You will need to edit line 12 to specify kde
instead of xfce
:-
#!/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 dbus_args=(--sh-syntax --exit-with-session)
case "$SESSION" in
awesome) dbus_args+=(awesome) ;;
bspwm) dbus_args+=(bspwm-session) ;;
budgie) dbus_args+=(budgie-desktop) ;;
cinnamon) dbus_args+=(cinnamon-session) ;;
deepin) dbus_args+=(startdde) ;;
enlightenment) dbus_args+=(enlightenment_start) ;;
fluxbox) dbus_args+=(startfluxbox) ;;
gnome) dbus_args+=(gnome-session) ;;
i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
jwm) dbus_args+=(jwm) ;;
kde) dbus_args+=(startkde) ;;
lxde) dbus_args+=(startlxde) ;;
lxqt) dbus_args+=(lxqt-session) ;;
mate) dbus_args+=(mate-session) ;;
xfce) dbus_args+=(xfce4-session) ;;
openbox) dbus_args+=(openbox-session) ;;
*) dbus_args+=("$SESSION") ;;
esac
echo "dbus-launch ${dbus_args[*]}"
}
exec $(get_session)
I've gone through the Arch Linux wiki many times, and method 4.3 addresses this issue. However, because the description in that section didn't quite match my situation, I overlooked this solution, wasting your time. I'm terribly sorry about that. The actual solution was simply adding /usr/lib/plasma-dbus-run-session-if-needed startplasma-x11
or dbus-launch --exit-with-session startplasma-x11
to .xinitrc
, and voilà, problem solved!
The correct solution is as follows:
.xinitrc
cp /etc/X11/xinit/xinitrc ~/.xinitrc
twm
and xterm
/usr/lib/plasma-dbus-run-session-if-needed startplasma-x11
or dbus-launch --exit-with-session startplasma-x11
to end of .xinitrc
Thanks for the update.
I think the wiki has changed a lot. It used to be easier to follow than it is now. In any case, adding your solution above may well help others.
xrdp version
0.9.24
Detailed xrdp version, build options
Operating system & version
Arch Linux
Installation method
dnf / apt / zypper / pkg / etc
Which backend do you use?
xorgxrdp
What desktop environment do you use?
KDE
Environment xrdp running on
Intel graphic GPU
What's your client?
MS office client
Area(s) with issue?
No response
Steps to reproduce
✔️ Expected Behavior
Successfully entered the KDE desktop environment.
❌ Actual Behavior
After entering the username and password, only a green background is displayed, and then the connection is closed.
Anything else?
xrdp.log
xrdp-sesman.log