Setup remote desktop connection for raspberry pi

If you own a raspberry pi and have installed that little powerful gadget the first time you don't want to maintain your pi with a second monitor, keyboard and mouse. Thats why you need fastly a remote access to your raspberry.

Activate SSH

At firt we have to activate SSH (Secure Shell). Therfore we need once more an connected monitor, keyboard an if you like an mouse for the pi. I assume that you installed a current Operating System with an pre-installed SSH server. So we only need to aktivate the SSH Server.

Therefore we open the console of our raspberry and type in

pi@raspberrypi ~ $ sudo raspi-config  

That will open the configurator window. The following pictures shows how to activate the SSH Server. Depending on the flavor of the OS the GUI can vary.

Image: GUI SSH Activation Part 1

Image: GUI SSH Activation Part 2

Image: GUI SSH Activation Part 3

Identify IP

From now we don't need a connected keyboard and monitor besides we want to identify the IP of the raspberry directly. We need the IP for the next step to access our pi remotely via SSH.

pi@raspberrypi ~ $ ifconfig  

Alternatively we look up the ip address of the little tiny computer in the router. In image below we see the configuration in a german router modell named FRITZ!Box.

Image: IP Configuration in router

Access via SSH

With the knowledge of the IP address we can access the raspberry pi via SSH. For Mac OS we open a terminal window and type in the following command. Of course, the IP adress have to be replaced by your own IP address.

ssh -lpi

If you are using Windows as Operating System you can use the tool PuTTY:

Image: Screenshot of PuTTY

Now you have full remote access to Pi and you can do all thinkable configurations, installations, etc. via console. But some people are more the visual type and like to see what they do in a appropriate GUI. Therefore you need a Remote Desktop Connection.

Setup Remote Desktop Connection

To get remote desktop connection working you have to ensure that that the desktop of Raspberry Pi is starting after booting. Therefore you call again the configuration window of your Pi

pi@raspberrypi ~ $ sudo raspi-config 

Then we enable the booting with desktop like in image below:

Image: Boot to Desktop Configuration

To use remote desktop connection on Raspberry we have to install a RDP-Server with following command:

pi@raspberrypi ~ $ sudo apt-get install xrdp     

For Windows you can now open the remote desktop connection. For Mac you have to install a RDP-Client before. Such clients you can find in AppStore. But also Microsoft have a RDP-Client for Mac in Store.

Image: Remote Desktop Connection

After clicking on the button Connect we get shown the interface of XRDP - Server of the Raspberry on our screen with the request to type in username and password. If that step succeed the desktop screen of Pi is shown.

Image: Login to xrdp

In many cases you will also find descriptions for a graphical remote access with VNC (Virtual Network Computing). As always in life you have to balance wich technology suits at most for your requirements. A discussion of both technologies you can find at that Link.


comments powered by Disqus

Copyright Dunkel & Iwer GbR | Datenschutzerklärung | Impressum