-
Install xrdp and xfce (or another desktop environment)
sudo apt update sudo apt install xrdp xfce4 xfce4-goodies
-
Configure xrdp to use xfce
echo xfce4-session >~/.xsession
-
Backup the current
startwm.sh
:Before making changes, it's a good idea to back up the original file.
sudo cp /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.backup
-
Edit
startwm.sh
:sudo nano /etc/xrdp/startwm.sh
-
Allow xrdp through firewall (if you have UFW enabled)
sudo ufw allow 3389/tcp
-
Modify the file:
At the end of the file, before the two
exec
lines, addstartxfce4
. Then comment out the twoexec
lines using the#
character. Your file should look like:if test -r /etc/profile; then . /etc/profile fi if test -r ~/.profile; then . ~/.profile fi #test -x /etc/X11/Xsession && exec /etc/X11/Xsession #exec /bin/sh /etc/X11/Xsession dbus-launch --exit-with-session startxfce4
-
Session Cleanup:
rm ~/.ICEauthority rm ~/.Xauthority
-
Restart xrdp:
-
Start and enable xrdp service
# autostart sudo systemctl enable xrdp sudo systemctl start xrdp # or restart if it is already enabled sudo systemctl restart xrdp
- Open Remote Desktop Connection > select "Xorg" session