Connect with us

How To

How to Establish Remote Desktop Access to Your Raspberry Pi?

Published

on

Raspberry Pi Remote Desktop

In this article, we are going to show you how to establish the remote desktop access to your Raspberry Pi using VNC. To use VNC you need to have two programs. First, you need the VNC Server on the computer you want to control. Then you need a VNC Viewer on the device that you wish to control from. Luckily Raspbian comes with pre-loaded VNC Connect, RealVNC’s remote access software. It consists of the VNC Server and the VNC Viewer. The primary thing you have to do before getting started is to ensure that you have the latest version of the VNC Connect. To know this just run the following commands in the Terminal:

sudo apt-get update
sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

Related: How to Play Retro Games on Your Raspberry Pi with DOSBox?

How to establish remote desktop access to the Raspberry Pi

Step 1: The first thing you have to do is enabling the VNC. Enabling VNC can be done in two ways: using the GUI or using Terminal. We will provide you with both the methods below – you can pick whichever you like.

Using the GUI
Go to Preferences > Raspberry Pi Configuration and click on “Interfaces.” While there, select “VNC: Enabled.”

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

Using Terminal
Open Terminal and enter the following command:

sudo raspi-config

After doing this go to Advanced Options and select the VNC. The config asks you, “Would you like the VNC Server to be enabled?” Now select “Yes” and exit the config by choosing “Finish.”

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

Step 2: Now connect to the Raspberry Pi using VNC Viewer. There are two ways to establish remote desktop access to the Raspberry Pi using VNC Viewer: one is through the direct connection and other is via cloud connection. Both methods are given below.

Related: How to Setup Your Raspberry Pi as a VPN Router?

Establishing a direct connection

Direct connections are very simple if you are going to connect to the Raspberry Pi from inside your home network.

On your Raspberry Pi, run the following command in Terminal:

hostname –I

The terminal will show your private IP address, which you will need later, so make a note of it.

On the device, you will use to control the Raspberry Pi, install the VNC Viewer. You can download the program from RealVNC’s site.
Enter your private IP address into the VNC Viewer.

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

Now the VNC Server will require you to authenticate with the Raspberry Pi’s username and password. And the default credentials of the Raspberry Pi’s username will be “pi” and your password will be “raspberry.”

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

If you have done everything correctly, you can see the Raspberry Pi’s desktop on your device which you are using.

Establishing a cloud connection

RealVNC is the company behind VNC Server and VNC Viewer, which allows you to register the account to their cloud service and use the service for free.

The cloud connection is a convenient way to connect to the Raspberry Pi because the cloud connections are secure and don’t require you to configure your router’s port forwarding settings or know your IP address. If you are only going to connect the Raspberry Pi from inside your home network, but the direct connection is a more reliable option and it is also noticeably faster than the cloud connection.

Related: How to Create a Raspberry Pi Thermometer Using Sense HAT?

How to establish a cloud connection to your Pi:

Sign up for the RealVNC account here.

Then Sign in to VNC Server on your Raspberry Pi using your new RealVNC account.

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

On the next screen, choose “Direct and cloud connectivity.”

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

Now download and install the VNC Viewer on your device, you will use to control your Raspberry Pi.

Sign in to the VNC Viewer using the same RealVNC account as you did above. Click on the icon for the Raspberry Pi.

Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop

Just as with the direct connection, VNC Server will require you to authenticate with the Raspberry Pi‘s username and password. If you did everything right, you can see your Raspberry Pi’s desktop on the device you are using.

Related: How to Use the Raspberry Pi as a Network-Wide Ad Blocker?

Creating a virtual desktop

If you are not running the PIXEL desktop, then you can still establish the remote desktop access to the Raspberry Pi. The VNC Server is capable of creating the virtual desktop, giving you the ability to work in a graphical interface from another device. This virtual desktop will exist only on the Raspberry Pi’s memory So that you cannot see any mouse movements on the Raspberry Pi’s screen as you could with the direct or cloud connection. If you want to launch multiple independent VNC sessions, then the Virtual desktop approach is especially useful if you wish to launch multiple independent VNC sessions.

You can create and connect to a virtual desktop like this:

  • On your Raspberry Pi, run vncserver in the Terminal and write down IP address and the display number, which the program prints.
Raspberry Pi Remote Desktop
Raspberry Pi Remote Desktop
  • On the device, you can use to control the Raspberry Pi, enter the IP address and the port into a VNC Viewer.
  • In this case of establishing a direct connection and a cloud connection, VNC Server will require you to authenticate with your Raspberry Pi’s username and password.

You can destroy a virtual desktop with this command:

vncserver -kill :<display-number>

Thank you for reading this post.

Facebook

Trending

Would you like to receive notifications on latest updates? No Yes