The Remote Desktop Connection Window

Running headless

I’m not talking about chickens although it sometimes feels like that.

When the Pi is living inside its cabinet (or perhaps inside its nesting box?) it won’t have a keyboard or monitor plugged in.  Of course, I could drill holes here and there and plug these in through the sides, but they won’t be needed when its finished, so why spoil the case?

So how can I make adjustments once it’s all tucked away?  Since the Pi does have a fully-featured operating system, you can use the Windows Remote Desktop Connection to control it from your PC, just as if your monitor and keyboard are actually plugged directly into the Pi.  You do need to set this up first, though.

How to set up Remote Desktop

I’m assuming that you have already set up a WiFi dongle whilst directly plugged into the Pi, and that you can use this WiFi to access your local network.  If not, this will need to be the subject of a separate post that I haven’t prepared yet. {The latest Pi has built-in WiFi, so you won’t have to bother with installing a dongle.]

Once you have a WiFi connection, the next job is to install a service onto the Pi called xrdp.  I have set my Pi to login to the Raspbian desktop (the one that looks rather like the usual Windows Desktop on a PC).  But to instal the xrdp utility, you need to login directly** to the Pi as a user and go the the Pi’s command line.  [Note that if you are in the Pi desktop, you can access the Raspbian command line interface by selecting the Accessories>Terminal option from the main menu.]  Then enter:

sudo apt-get install xrdp

This will cause the xrdp app to download and install, which does take quite few minutes to do.

Loggin in from your PC

Once xrdp is installed, go to your PC and click the Start or Windows button, and type Remote Desktop Connection to search for the Remote Desktop application.  (Once you’ve found it, you might like to pin it to the taskbar so that you have quick access to it.)  Open the Remote Desktop application and enter the local  IP address of your Pi. (If you aren’t sure of the IP address, open the control panel of your router and copy the IP address of the connection to the Pi.)

The Remote Desktop Connection Window
The Remote Desktop Connection Window on the PC

Click connect and the xrdp prompt will appear if the Pi is running. Enter the user name and password for the Pi and you should see the Pi desktop open in the remote window. (The password is anonymised, so type it carefully.)  You can save the login details if you wish, to make future logins quicker.

Working on the remote desktop

Once the remote desktop is open, you can work on it as if you are plugged directly into the Pi.***  Updates to the window are somewhat slower than when you are directly connected, so do allow for the response time – if you are too impatient, you could get messed up because the screen hasn’t fully updated.

Now, you can operate your Pi from anywhere! Obviously, you will need to allow connections through your firewall if you want to operate over the internet, but be careful with this. Someone who got control of your Pi could wreak havoc not only with your data, but turn it into part of a BotNet too.  If you plan to do this, make sure that default user names and passwords have been deleted and secure ones substituted.

** if you haven’t got the access to plug directly into your Pi, you can still access it remotely from your PC using PuTTY.  This only gives you access to the command line interface, but will enable you to install xrdp  so that you can use the Remote Desktop in future. Google this if you need help.

*** A further annoying issue: for some reason, the xrdp installation does not have the correct mapping table for UK keyboards. This means that some of the symbol keys enter an incorrect symbol. If you have suffered from this before, you will know which UK keys produce the required symbol, but it is still inconvenient. I don’t know if this has been fixed in recent releases, but if you have this problem, some clever person has worked out the correct mapping table and instructions for installing it are here.

This does not fix an issue with using MS Remote Desktop on an iPad.  You can login but then some of the keys on the electronic keyboard don’t work. I guess that this is a similar keyboard mapping problem, but it appears that most users have opted to use a dedicated iPad app instead of fighting this.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.