Remote control your Raspberry Pi from your PC with VNC!
ⓘ Cet article peut avoir été partiellement ou totalement traduit à l'aide d'outils automatiques. Nous nous excusons des erreurs que cela pourrait engendrer.
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.