5

I have Ubuntu 20.04 on the my AWS instance and I have installed xubuntu-desktop and xrdp. After putting exec startxfce4 into my user's ~/.xsession I can launch default XFCE4 session when I connecect from my Windows via Remote Desktop and choose "Xorg" option on the login screen. But that's just default XFCE4, and I'd like to start Xubuntu session, with all its customizations to look and feel. Please advise how to achieve that.

7
  • Don't you have a Xubuntu xsession in /usr/share/xsessions? I'd assume it should work the same way as xfce4session mentioned above. Dec 18, 2020 at 7:46
  • $ ls /usr/share/xsessions -la total 36 drwxr-xr-x 2 root root 4096 Dec 16 18:30 . drwxr-xr-x 317 root root 12288 Dec 17 09:35 .. ``` -rw-r--r-- 1 root root 303 Mar 26 2020 ubuntu.desktop -rw-r--r-- 1 root root 6273 Mar 30 2020 xfce.desktop -rw-r--r-- 1 root root 5962 Apr 20 2020 xubuntu.desktop```
    – ivan.ukr
    Dec 18, 2020 at 9:34
  • That only some ".desktop" files. I mean how do I make it start by default instead of "plain" xfce session?
    – ivan.ukr
    Dec 18, 2020 at 9:35
  • I've mistaken a bit in the question text. Actual content of the "~/.xsession" is "exec startxfce4"
    – ivan.ukr
    Dec 18, 2020 at 11:54
  • Well, those "some .desktop files" is what you need. Look inside for what is executed in xubuntu.desktop. Also, do us all a favor, and don't post outputs as comments. Dec 18, 2020 at 12:01

1 Answer 1

5

The reason is because several environment variables are not set and passed to startxfce4. Create a /usr/local/bin/start-xubuntu file and put "start-xubuntu" in ~/.xsessions:

#!/bin/bash

export XDG_DATA_DIRS="/usr/share/xfce4:/usr/share/xubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/usr/share"
export XDG_CONFIG_DIRS="/etc/xdg/xdg-xubuntu:/etc/xdg"

export LANG=en_US.UTF-8
export GDM_LANG=en_US.UTF-8
export DESKTOP_SESSION=xubuntu
export GDMSESSION=xubuntu
export XDG_SESSION_DESKTOP=xubuntu

# propagate to X sessions. It is important when user first
# login, they decide on the initial xfce/xubuntu template settings.
dbus-update-activation-environment --verbose XDG_DATA_DIRS XDG_CONFIG_DIRS DESKTOP_SESSION GDMSESSION XDG_SESSION_DESKTOP

exec startxfce4

Kudos goes to Netspectrum Ubuntu AMI on AWS, which gives you a ready-to-go xubuntu desktop via VNC, RDP or browser in a few seconds.

2
  • A correction to the answer by @user4572254: put start-xubuntu in ~/.xsession (not ~/.xsessions.)
    – Mostafa
    Aug 19, 2021 at 23:51
  • To reconnect correctly i made sure /etc/xrdp/startwm.sh had test -x /tmp/.X11-unix/X10 || exec /bin/sh /etc/X11/Xsession instead -- wherein X10 is the default xrdp display from the X11DisplayOffset from /etc/xrdp/sesman.ini -- probably could do this better though
    – Vetsin
    Jul 12, 2023 at 19:51

You must log in to answer this question.

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