neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.62k stars 1.73k forks source link

After logging in, unable to enter the KDE desktop environment and the connection is then closed #2975

Closed duan-1 closed 6 months ago

duan-1 commented 6 months ago

xrdp version

0.9.24

Detailed xrdp version, build options

xrdp 0.9.24
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --prefix=/usr
      --sysconfdir=/etc
      --localstatedir=/var
      --sbindir=/usr/bin
      --with-systemdsystemunitdir=/usr/lib/systemd/system
      --enable-jpeg
      --enable-tjpeg
      --enable-fuse
      --enable-fdkaac
      --enable-opus
      --enable-rfxcodec
      --enable-mp3lame
      --enable-pixman
      --enable-painter
      --enable-vsock
      --enable-ipv6
      --enable-pam-config=arch
      --enable-rdpsndaudin
      --with-imlib2
      CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/home/patoria/.cache/yay/xrdp/src=/usr/src/debug/xrdp -flto=auto
      LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto

  Compiled with OpenSSL 3.2.1 30 Jan 2024

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

  1. open MS office client
  2. entered username and password
  3. only show the green background
  4. connect was closed

✔️ 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

3月 04 01:49:06 miniPC xrdp[412]: [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.2.11 port 62029
3月 04 01:49:06 miniPC xrdp[3485]: [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
3月 04 01:49:06 miniPC xrdp[3485]: [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
3月 04 01:49:06 miniPC xrdp[3485]: [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] SSL_read: I/O error
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] libxrdp_force_read: header read error
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] Processing [ITU-T T.125] Connect-Initial failed
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] [MCS Connection Sequence] receive connection request failed
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] xrdp_iso_send: trans_write_copy_s failed
3月 04 01:49:06 miniPC xrdp[3485]: [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
3月 04 01:49:08 miniPC xrdp[412]: [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.2.11 port 62030
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] Connected client computer name: Y7000
3月 04 01:49:08 miniPC xrdp[3486]: [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
3月 04 01:49:08 miniPC xrdp[3486]: [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x07], keyboard_subtype:[0x00], keylayout:[0x00000804]
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [us] options []
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] TLS connection established from ::ffff:192.168.2.11 port 62030: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
3月 04 01:49:08 miniPC xrdp[3486]: [WARN ] xrdp_caps_process_codecs: unknown codec id 5
3月 04 01:49:08 miniPC xrdp[3486]: [WARN ] Cannot find keymap file /etc/xrdp/km-00000804.ini
3月 04 01:49:08 miniPC xrdp[3486]: [WARN ] Cannot find keymap file /etc/xrdp/km-00000804.ini
3月 04 01:49:08 miniPC xrdp[3486]: [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
3月 04 01:49:08 miniPC xrdp[3486]: [WARN ] local keymap file for 0x00000804 found and doesn't match built in keymap, using local keymap file
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] connecting to sesman on 127.0.0.1:3350
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] xrdp_wm_log_msg: sesman connect ok
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] sesman connect ok
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] sending login info to session manager. Please wait...
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] xrdp_wm_log_msg: login successful for user patoria on display 10
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] login successful for user patoria on display 10
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] loaded module 'libxup.so' ok, interface size 10296, version 4
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] started connecting
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] lib_mod_connect: connecting via UNIX socket
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] lib_mod_log_peer: xrdp_pid=3486 connected to X11rdp_pid=3496 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff:192.168.2.11 client_port=62030
3月 04 01:49:14 miniPC xrdp[3486]: [INFO ] connected ok
3月 04 01:49:18 miniPC xrdp[3486]: [WARN ] xrdp_mm_chansrv_connect: connect failed trying again...
3月 04 01:49:22 miniPC xrdp[3486]: [WARN ] xrdp_mm_chansrv_connect: connect failed trying again...
3月 04 01:49:26 miniPC xrdp[3486]: [WARN ] xrdp_mm_chansrv_connect: connect failed trying again...
3月 04 01:49:30 miniPC xrdp[3486]: [WARN ] xrdp_mm_chansrv_connect: connect failed trying again...
3月 04 01:49:30 miniPC xrdp[3486]: [ERROR] xrdp_mm_chansrv_connect: error in trans_connect chan
3月 04 01:49:30 miniPC xrdp[3486]: [ERROR] SSL_shutdown: Failure in SSL library (protocol error?)
3月 04 01:49:30 miniPC xrdp[3486]: [ERROR] SSL: error:0A000123:SSL routines::application data after close notify

xrdp-sesman.log

3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] Socket 12: AF_INET6 connection received from ::1 port 41916
3月 04 01:49:14 miniPC xrdp-sesman[409]: pam_kwallet5(xrdp-sesman:auth): pam_kwallet5: pam_sm_authenticate
3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] Terminal Server Users group is disabled, allowing authentication
3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] ++ created session (access granted): username patoria, ip ::ffff:192.168.2.11:62030 - socket: 12
3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] starting Xorg session...
3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] Starting session: session_pid 3490, display :10.0, width 1920, height 1080, bpp 24, client ip ::ffff:192.168.2.11:62030 - socket: 12, user name patoria
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] [session start] (display 10): calling auth_start_session from pid 3490
3月 04 01:49:14 miniPC xrdp-sesman[409]: [ERROR] sesman_data_in: scp_process_msg failed
3月 04 01:49:14 miniPC xrdp-sesman[3490]: pam_kwallet5(xrdp-sesman:setcred): pam_kwallet5: pam_sm_setcred
3月 04 01:49:14 miniPC xrdp-sesman[3490]: pam_unix(xrdp-sesman:session): session opened for user patoria(uid=1000) by patoria(uid=0)
3月 04 01:49:14 miniPC xrdp-sesman[409]: [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
3月 04 01:49:14 miniPC xrdp-sesman[3490]: pam_kwallet5(xrdp-sesman:session): pam_kwallet5: pam_sm_open_session
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] Found X server running at /tmp/.X11-unix/X10
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] Session started successfully for user patoria on display 10
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] Session in progress on display 10, waiting until the window manager (pid 3495) exits to end the session
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [WARN ] Window manager (pid 3495, display 10) exited with non-zero exit code 127 and signal 0. 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
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] Calling auth_stop_session and auth_end from pid 3490
3月 04 01:49:14 miniPC xrdp-sesman[3490]: pam_unix(xrdp-sesman:session): session closed for user patoria
3月 04 01:49:14 miniPC xrdp-sesman[3490]: pam_kwallet5(xrdp-sesman:session): pam_kwallet5: pam_sm_close_session
3月 04 01:49:14 miniPC xrdp-sesman[3490]: pam_kwallet5(xrdp-sesman:setcred): pam_kwallet5: pam_sm_setcred
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] Terminating X server (pid 3496) on display 10
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] Terminating the xrdp channel server (pid 3501) on display 10
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] X server on display 10 (pid 3496) returned exit code 0 and signal number 0
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] xrdp channel server for display 10 (pid 3501) exit code 0 and signal number 0
3月 04 01:49:14 miniPC xrdp-sesman[3490]: [INFO ] cleanup_sockets:
3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] Process 3490 has exited
3月 04 01:49:14 miniPC xrdp-sesman[409]: [INFO ] ++ terminated session:  username patoria, display :10.0, session_pid 3490, ip ::ffff:192.168.2.11:62030 - socket: 12
matt335672 commented 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.

duan-1 commented 6 months ago

What I can confirm is that I have logged out. But /home/patoria/.xsession-errors does not exist in my account directory.

matt335672 commented 6 months ago

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
duan-1 commented 6 months ago

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
matt335672 commented 6 months ago

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)
duan-1 commented 6 months ago

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:

  1. copy .xinitrc
    cp /etc/X11/xinit/xinitrc ~/.xinitrc
  2. deleting everything about twm and xterm
  3. adding /usr/lib/plasma-dbus-run-session-if-needed startplasma-x11 or dbus-launch --exit-with-session startplasma-x11 to end of .xinitrc
matt335672 commented 6 months ago

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.