I've been trying to get xRDP running on an Ubuntu Budgie 18.10 box and I ran into some quirks, so here's my notes:
As every how-to on the internet will tell you, start with installing and enabling xRDP
sudo apt install xrdp sudo systemctl enable xrdp
Some how-tos mention enabling port 3389 on the firewall
sudo ufw allow 3389/tcp
But I've not needed to do it.
At this point on previous distros/desktops everything is good to go. But with Ubuntu Budgie, I ran into an issue where the Remote Desktop client would connect and display the sesman login screen, but after logging in the connection closes. So to fix that I needed to edit /etc/xrdp/startwm.sh, commenting out the last two lines and adding budgie-desktop to the end:
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession #exec /bin/sh /etc/X11/Xsession budgie-desktop
And then restart xrdp:
sudo systemctl restart xrdp
I can now log in with sesman and get a desktop. However there is still something slightly odd - even though I've logged in via sesman, I also get a Budgie login prompt and so I have to log in twice. I seem to have stumbled across a fix, by trying to get audio to work.
One of the recommended packages to install with xrdp is xrdp-pulseaudio-installer. After installing it (and a metric ton of dependencies) you still won't have working audio. What's supposed to happen is that you run
but xrdp-build-pulse-modules doesn't actually work. Fortunately, I'm not the the first person to run into this problem. So, following the instructions here I was able to get it working. For the what and why, go there. But in case that page disappears off the internet, here's what I did (not including adding sources in Software & Updates)
cd /tmp sudo apt source pulseaudio cd /tmp/pulseaudio* cd /tmp/pulseaudio-12.2/ sudo ./configure cd /usr/src/xrdp-pulseaudio-installer make PULSE_DIR="/tmp/pulseaudio-12.2" sudo make PULSE_DIR="/tmp/pulseaudio-12.2" sudo install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so
I then rebooted. Now audio works and the needing to log in twice issue seems to have disappeared, though I do not know why.