VNC is one of the primary ways used to remotely control a Raspberry Pi. Since most users do not use the Raspberry Pi like an everyday PC, and therefore may not even have a monitor and other peripherals connected to it, being able to control the Raspberry Pi from another device comes in handy. Another common way to remotely administer a Raspberry Pi is by setting up SSH.
Fortunately for us, the Raspberry Pi OS already comes with VNC installed by default, since the developers know that many users will run it as a headless device (meaning without a monitor), and only access the Raspberry Pi remotely. In this tutorial, you will see how to enable VNC on a Raspberry Pi in order to facilitate screen sharing.
In this tutorial you will learn:
How to enable VNC screen sharing for a Raspberry Pi
Software Requirements and Linux Command Line Conventions
Category
Requirements, Conventions or Software Version Used
System
Raspberry Pi
Software
VNC
Other
Privileged access to your Linux system as root or via the sudo command.
Conventions
# โ requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ โ requires given linux commands to be executed as a regular non-privileged user
Enable VNC screen sharing for a Raspberry Pi step by step instructions
Follow the steps below to enable VNC on the Raspberry Pi, allowing you to remotely connect and use it like you would an ordinary desktop PC. We will cover two methods below, both command line and GUI. If you are currently connected to the Raspberry Pi via SSH or just prefer the command line, then we will use the raspi-config utility. Otherwise, desktop users can enable VNC from the preferences menu. Follow along below to see how.
Enable VNC Screen Sharing via Command Line
Start by opening a terminal and opening the raspi-config utility with root permissions by executing this command:
On the next menu, we have several different options for technologies we can enable or disable. Move down to the โVNCโ option and select it.
๐ Selecting VNC out of the Interface Options menu Selecting VNC out of the Interface Options menu
The utility will ask you to confirm that you want to enable VNC. Select โYesโ to proceed with enabling it.
๐ Enabling VNC from the raspi-config utility menu Enabling VNC from the raspi-config utility menu
If successful, the utility will let you know that the VNC server is now enabled. The changes will take effect right away and you can now use VNC to remotely control the Raspberry Pi.
๐ Confirmation dialog that VNC has been enabled on the Raspberry Pi Confirmation dialog that VNC has been enabled on the Raspberry Pi
Once the VNC server has been enabled, there are many VNC clients which can be used to connect to it. A free, open source one that we recommand is Tiger VNC. It can be installed with these commands:
In this tutorial, we saw how to enable VNC on a Raspberry Pi system, which facilitates remote desktop connections. This allows users to administer their Pi device from another computer or even mobile phone.