Done a bit mroe digging and and these are the conclusions I have reached [or jumped to]
My understanding of xrdp is that it uses a RDP connection to a VNC session runnning on the pi. VNC handles the communcation with X.
This is incorrect, as pointed out by cstrunk.
xrdp can use VNC but the default behavior on RPI is to use Xorg
As an aside, I did a clean install of stretch and was able to get xrdp running without messing about uninstalling/installing the various flavours of VNC...
Code: Select all
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get clean
sudo apt-get -y install xrdp
the isssue is that when starting X on the console xstart is called. This sets
amongst other things then calls xinit
What appears to be happening with xrdp is that it is calling xinit directly, thus bypassing startx which is why $XAUTHORTY is not set.
I beleive the "best" solution would be to figure out where/how xrdp calls xinit and point it to startx instead. I just hope it isn't hardcoded.
Anther option may be to set $XAUTHRITY in /etc/X11/xinit/xinitrc, /etc/X11/Xsession or /etc/xrdp/startwm.sh but I don't particularly like this approach as it seems like a bit of a kludge and I've no idea what the impact might be.
As for using VNC, despite my love/hate relationship with MS and their products there are good reasons to use RDP over VNC.
1) VNC is a bit "heavy" in terms of network usage and performance
2) RDP is available on every windows desktop (unless you are using a very old version)
3) No additional installation required on windows clients - useful in business environments if the IT dept don't permit software installation by users or to maintain a clean/performant environment.*
* My background is in tech support in the 90's where every 3rd party product you installed exponentially increased the chances of a problem and the complexity of resolving it while simultaneously negatively impacting the performance. As such I still try to avoid installing products on my windows machines unless they offer particular functionality that is not already provided by the existing software already installed. I will even periodically rebuild my desktop environments simply to get a clean install and elimnate software I no longer need/use. This may be a bit "old skool" way of thinking but it has served me well.
Don't get me wrong. I think VNC is a useful tool, and if I had never heard of RDP/xrdp I would happily use VNC. But for many use cases RDP may be the "better" option.
Corrected typos in sudo apt-get snippet above
Have tested the above snippet with a brand new install of 2017-09-07-raspbian-stretch and it works! (apart from the xauthority/root issue discussed and the keyboard has gone all "yankee doodle" on me).