Remote desktop – Raspberry Pi (Raspbian)

Recently we set up a Raspberry Pi as a sort of kiosk to display the team work schedule for one of our clients.  It was the first time I’ve played around with a RPi which was exciting.  I flashed an SD card with a vanilla image of Raspbian from official sources which went relatively smoothly (apart from me discovering the card reader in my desktop isn’t working).

The idea is that the device is connected to a wall mounted display and a start up script loads a browser window and displays the required web page.  However I also wanted a way to control the Pi over the network.  In line with the personal distaste Eric and I have for VNC I decided I’d try to set up a Remote Desktop server on the Pi.

I discovered a OSS project called xrdp which was also a breeze to install since it is in the debian repositories.  Low and behold it worked out of the box!  Or should I say it partly worked out of the box.  The issue was that logging into an RDP session presented you with a *new* session not the *same* session that was being displayed on the monitor.

So after doing a lot of hunting, I learnt that xrdp is just a wrapper around VNC.  So I needed firstly to install a VNC service for the current user.  This blog was the key to getting this working.  An overview of the steps required:

sudo apt-get install vino

Create ~/.config/autostart/vino.desktop and edit the contents like so:

[Desktop Entry]
Type=Application
Exec=/usr/lib/vino/vino-server --sm-disable

The VNC session was launched when the user auto-logged-in on boot.  I then configured the xrdp to point to the VNC session modifying /etc/xrdp/xrdp.ini to the following:

...
[xrdp1]
name-Active user
lib=libvnc.so
username=
password=xxxxx
ip=127.0.0.1
port=5900
...