Remote control your Raspberry Pi from your PC with VNC!
If you use raspberry pi regulargly, you may have already needed to use the graphical interface of the raspberry pi without having monitor available. It is a classic problem, and always annoying.
Today we will see how to use VNC to control your raspberry pi from another computer, so you can use your raspberry pi without screen!
Materials needed to set up VNC
For this tutorial, we will need only a very minimal installation:
- A raspberry pi 3 under Raspbian, functional and up to date
- A computer from which to take control
What is VNC?
VNC, or Virtual Network Computing, is a system allowing remote control of one computer by another. When using VNC, two different parts of the software are used.
The first part is the VNC server. This one is installed on the machine we want to take control of (here the raspberry pi), and it will allow the connection and the control by the client part.
The second part is therefore the VNC client. It is installed on the machine from which you wish to control the server and it will allow to translate your actions into operations comprehensible by the server which will then control the remote machine from your computer.
The main interest of VNC is that it allows to take control of a remote machine, while displaying the desktop of it. So you can see in real time what is happening on your Raspberry Pi, without having to plug it into a screen!
Enable the VNC server on your Raspberry Pi
In order to connect to your raspberry pi with VNC, we will first have to activate it.
The first step will therefore be to connect to the raspberry pi in SSH, if you do not know how to, follow our tutorial to learn how to connect in SSH to the raspberry pi.
Once you connect SSH to raspberry pi, we will be able to activate the VNC server which is installed by default on Raspbian (on previous versions, it was necessary to install itself real-vnc).
For that, nothing very complicated, you just need to run the command
sudo raspi-config, select the line
Interfacing Options, then line
VNC, and finally answer that you want to enable VNC.
Connect to VNC to control raspberry pi
Now that we have activated the VNC server of the raspberry pi, we just have to connect to it. For this we will have to install a client on the computer from which we want to take control of the Raspberry Pi.
By default, raspberry pi uses the RealVNC server, which is configured to use a login mode based on user accounts on the machine. The only problem is that this connection method is not supported by all VNC clients. We will have to install a compatible client, the RealVNC client.
To install the RealVNC client on your computer, nothing complicated. Simply go to the official download page of RealVNC Viewer, download and install the version corresponding to your operating system (Linux, Mac or Windows).
Once you have installed RealVNC viewer, you only have to launch it and connect to the IP address of the Raspberry Pi, the default identifiers are those of the account
Once you have established the connection to an IP address, RealVNC viewer will remember this connection, and by right-clicking this connection, you will be able to configure various options, such as the quality of the image, its fluidity, etc. .
You now know how to control your raspberry pi with VNC, and you just have to take advantage of it to test hacks without having to bother with the monitor.
Do not hesitate to consult our other tutorials, like our buying guide for Raspberry Pi.