I installed xRDP on my Ubuntu 16.04 LTS so that I can easily connect to my Linux box from any Windows machine using the remote desktop tool that comes by default with every Windows installation. The actually installation is very simple:
sudo apt-get install xrdp
Through another post, you will see that I have the Xfce4 desktop environment installed:
https://www.dev-notes.com/blog/2018/03/30/installing-xfce4-desktop-environment/
Xfce4 plays very well with xRDP. To launch Xfce4 when a xRDP session is conneted, add this line to your .xsession file:
echo xfce4-session >~/.xsession
And then edit your startwm.sh file using your favorite text editor (nano is used below as example); add “startxfce4” without the quotes to the end of that file.
sudo nano /etc/xrdp/startwm.sh
At this point, you can either restart the machine, or run the two commands below to ensure xrdp is ready to accept connections.
sudo service xrdp restart sudo /usr/sbin/xrdp-sesman
Finally, I noticed that when I am connected from a Windows machine, my tab key did not work correctly, causing me to lose the ability to autocomplete file names, among other things. It ended up the fix is very easy. Again, launch your favorite text editor to open up this Xfce configuration file:
nano ~/.config/xfce4/xconf/xfce4-keyboard-shortcuts.xml
Look for this line:
<property name="<Super>Tab" type="string" value="switch_window_key" />
And modify it to this line below:
<property name="<Super>Tab" type="empty" />