Raspbian now allows remote access Raspberry pi with VNC Connect. Learn how to use this free version for the Raspberry Pi community.

Controlling his Raspberry Pi remotely with VNC

The objective of this tutorial is successfully to take control of our Raspberry Pi remotely ,  let it run independently without keyboard / mouse or connected screen.

In order to easily take control of the Raspberry Pi , it is important that it is connected to the network using a Fixed IP address – Configure a fixed IP address for Wifi or Cable for its Raspberry)

1 – Installing VNC

Open LxTerminal

Update your Raspberry with:

sudo apt-get update
Then install VNC

sudo apt-get install tightvncserver

2 – Launch of VNC

In LxTerminal , enter the following command to run VNC for the first time:

vncserver: 1

If all goes well, VNC will want you to enter a login password, so enter a password with up to 8 characters.

Now, if you are trying to connect with a VNC Viewer on a computer, give it the IP address of your Raspberry and click Connect, enter the password entered earlier.

vnc connection


And here you are connected to your Raspberry pi with vnc

2 – Automatic start of VNC at startup of Raspberry

2.1 – The file including our scripts

Open the file explorer then go to the / home directory to create a Scripts folder

Right click> Create a new …> Folder >> Scripts

2.2 – Creating the script to open VNC

Go to the script / home / scripts folder (created in step 2.1 ), open the folder as root user , in order to have additional rights.

To do this, use Tools> Open the current directory as the root user

Create a LoadVnc.sh file , right-click> Create new …> empty file and specify the name of the LoadVnc .sh file

Edit the file with Leafpad , right-click> Leafpad , and paste the following code:

LoadVnc .sh

#! / bin / sh
vncserver: 1

2.2 – Creating the Autostart folder

Open the /home/pi/.config/ folder (directly access the folder by entering the address bar of the explorer), open it in root user mode (seen in step 2.2).

If the autostart folder exists, go to step 2.3. Otherwise, create it with a right click.

2.3 – Creating the script to be called at startup

Now that we are in this folder, we will create the vnc.desktop file . Make right click> Create New …> empty file and specify the file name video.desktop

Edit the file with Leafpad , right-click> Leafpad , and paste the following code:

[Desktop Entry]
Encoding = UTF-8
Version = 1.0
Type = Application
Exec = / home / ft / Scripts / LoadVnc.sh
Terminal = false
Name = VNC Autostart
Comment = Automatic start of VNC
Category = Application;

Now you can now administer your Raspberry Pi from any computer with VNC Viewer.