6

How do I get the full Ubuntu Gnome experience instead of the generic Gnome experience via XRDP?

When I login from the console, I get the Ubuntu customization of Gnome: The dock is a stripe that extends from the one edge of the screen to the other, and the Settings app has a Dock entry.

When I login via XRDP, it looks like Generic Gnome: The dock is only large enough to contain its icons, and Settings has no Dock entry. More importantly, I have a bunch of icons on my "Ubuntu" desktop which are absent from the "generic" desktop.

I've read, "Ubuntu dock setting is accessible only from the GNOME session(s) customised by Ubuntu, not from the default GNOME session(s)," so that's why I think I'm getting generic GNOME via XRDP.

  • I'm running Ubuntu 18.04.3 and selected the 'Ubuntu' window manager.
  • I've installed xdrp.
  • I've created a .xsession with gnome-session --session=ubuntu and chmod +x.

Before creating .xsession, ps showed gnome-session-binary --session=ubuntu for console sessions and gnome-session-binary for XDRP sessions. After creating .xsession (and restarting), both sessions include --session=ubuntu, but the XRDP session still LOOKS like generic Gnome and it is missing my desktop icons.

I checked $XDG_CURRENT_DESKTOP. On the console it is ubuntu:GNOME. On XRDP it is "GNOME". So I launched --session=ubuntu but it seems to have been lost.

How do I get the full Ubuntu Gnome experience instead of the generic Gnome experience via XRDP?

1 Answer 1

16

This was covered in a thread on their git repo forum here. One relativery simple way to activate the full desktop experience is to edit the startwm.sh script located under /etc/xrdp/startwm.sh which looks like that:

#!/bin/sh
# xrdp X session start script (c) 2015, 2017 mirabilos
# published under The MirOS Licence

if test -r /etc/profile; then
    . /etc/profile
fi

if test -r /etc/default/locale; then
    . /etc/default/locale
    test -z "${LANG+x}" || export LANG
    test -z "${LANGUAGE+x}" || export LANGUAGE
    test -z "${LC_ADDRESS+x}" || export LC_ADDRESS
    test -z "${LC_ALL+x}" || export LC_ALL
    test -z "${LC_COLLATE+x}" || export LC_COLLATE
    test -z "${LC_CTYPE+x}" || export LC_CTYPE
    test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION
    test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT
    test -z "${LC_MESSAGES+x}" || export LC_MESSAGES
    test -z "${LC_MONETARY+x}" || export LC_MONETARY
    test -z "${LC_NAME+x}" || export LC_NAME
    test -z "${LC_NUMERIC+x}" || export LC_NUMERIC
    test -z "${LC_PAPER+x}" || export LC_PAPER
    test -z "${LC_TELEPHONE+x}" || export LC_TELEPHONE
    test -z "${LC_TIME+x}" || export LC_TIME
    test -z "${LOCPATH+x}" || export LOCPATH
fi

if test -r /etc/profile; then
    . /etc/profile
fi

test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession

NOTE: Do not delete it and replace it because it will make xrdp fail at launch. Just edit the file in place with sed for instance. Here I add 3 lines starting at line 4. They are going to be appended from line 4 to 6.

sudo sed -i '4 i\export XDG_CURRENT_DESKTOP=ubuntu:GNOME' /etc/xrdp/startwm.sh
sudo sed -i '4 i\export GNOME_SHELL_SESSION_MODE=ubuntu' /etc/xrdp/startwm.sh
sudo sed -i '4 i\export DESKTOP_SESSION=ubuntu' /etc/xrdp/startwm.sh

The end file looks like this:

#!/bin/sh
# xrdp X session start script (c) 2015, 2017 mirabilos \
# published under The MirOS Licence
export DESKTOP_SESSION=ubuntu
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME

if test -r /etc/profile; then
    . /etc/profile
fi
if test -r /etc/default/locale; then
    . /etc/default/locale
    
    test -z "${LANG+x}" || export LANG
    test -z "${LANGUAGE+x}" || export LANGUAGE
    test -z "${LC_ADDRESS+x}" || export LC_ADDRESS
    test -z "${LC_ALL+x}" || export LC_ALL
    test -z "${LC_COLLATE+x}" || export LC_COLLATE
    test -z "${LC_CTYPE+x}" || export LC_CTYPE
    test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION
    test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT
    test -z "${LC_MESSAGES+x}" || export LC_MESSAGES
    test -z "${LC_MONETARY+x}" || export LC_MONETARY
    test -z "${LC_NAME+x}" || export LC_NAME
    test -z "${LC_NUMERIC+x}" || export LC_NUMERIC
    test -z "${LC_PAPER+x}" || export LC_PAPER
    test -z "${LC_TELEPHONE+x}" || export LC_TELEPHONE
    test -z "${LC_TIME+x}" || export LC_TIME
    test -z "${LOCPATH+x}" || export LOCPATH
fi

if test -r /etc/profile; then
    . /etc/profile
fi
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession

After that, systemctl restart xrdp.service or restart your machine and it should work fine. Here is my xrdp session after restart.

Xrdp with gnome desktop experience activated

6
  • 1
    Thanks for this answer. It nealry works perfect for me, but I am still missing the dock, when using the rdc. Any hints?
    – TheTanic
    Jul 8, 2022 at 11:05
  • You should see the dock if you follow the steps above, with Ubuntu 2004 at least.
    – Andy McRae
    Jul 14, 2022 at 13:40
  • Actually my problem was, that I need to restart gnome from time to time to get the dock... Don't know why
    – TheTanic
    Jul 15, 2022 at 7:45
  • 1
    Mhh hard to say.. We dont run into this situation. Usually when the gnome app freezes we restart the machines and it works.. but maybe your case is a bit different. you should try to restart the gnome app once every x hours if you don't want to restart your machine
    – Andy McRae
    Jul 18, 2022 at 13:41
  • It's obvious once you think about it, but for me it would still be worth adding that these changes are done on the server, not the client. I also needed to reboot. Just restarting the xrdp service gave me a black screen when Iogged in.
    – craq
    Jul 27, 2022 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .