Xrdp fails to launch due to nvidias ~/.xsessionrc

I am not sure where to report bugs that are part of the jetson OS / L4T.

On a freshly flashed AGX Orin with L4T 34.1.1 /ubuntu20.04:

Installing xrdp and connecting presents the xrdp login prompt, but exits when attempting to log in to the desktop. I suspect it also result in vino presenting only the nvidia splash screen (see ~/.xsessionrc)

The reason can be seen in ~/.xsession-errors.
There is a syntax error (or otherwise) at line 83 of ~/.xsessionrc

/etc/X11/Xsession: 83: /home/sacvp-user/.xsessionrc: Syntax error: "(" unexpected (expecting "fi")

At ‘remove_apps’

        if [ -e "/usr/bin/gnome-shell" ]; then
                remove_apps=("thunderbird" "rhythmbox" "libreoffice-writer")
                favorite_apps="$(gsettings get org.gnome.shell favorite-apps)"

                for app in "${remove_apps[@]}"; do
                        favorite_apps="$(echo "${favorite_apps}" | \
                                sed -e "s/'${app}.desktop', //g" -e "s/, '${app}.desktop' / /g")"

                gsettings set org.gnome.shell favorite-apps "${favorite_apps}"

This error happens when a bash file is called using sh.

I’m not sure the exact launch process but I would suspect that ~/.xsessionrc should not use the bash stringarray, and instead be ‘sh’-ified.

Not sure what your use-case is. For using xrdp, we have tested the steps and it works:

  1. Run the commands:

$ sudo apt update
$ sudo apt install xubuntu-desktop
$ sudo apt install xrdp

  1. Modify startwm.sh

$ service xrdp stop
$ sudo vi /etc/xrdp/startwm.sh
*comment the following lines
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession
*add the line
$ service xrdp start

  1. Connect from Windows10 remote desktop

Please try the steps and see if you can remotely login successfully.

I am not using xubuntu/xfce4. my startwm.sh is unchanged.

Fixing or commenting out the bashism in L83 of .xsessionrc above works, and I am able to login to gnome with xrdp.

1 Like

Many thanks for the sharing.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.