A remote Raspberry Pi can be accessed from anywhere, even if it’s far away. You can use VNC to access a Raspberry Pi remotely from a Windows PC or an Android phone. This tutorial shows how to set up VNC on both sides.
What Is VNC?
VNC stands for Virtual Network Computing. It’s a remote desktop protocol (see also ‘What Is AnyDesk Used For?‘) that allows you to access your Raspberry Pi from another computer or device over the internet.
You can think of it as essentially the same thing as screen sharing – but you also get to control the computer on the other side too, not just look at what’s on-screen!
There are many other ways of doing this, of course – but VNC is one of the oldest ways to remotely control a computer’s desktop environment that’s still in use. It’s robust, simple, and it’s easy to set up on the Raspberry Pi!
What Operating Systems Can I Use VNC On?
You can run VNC on practically any modern operating system as a server. Whether it’s Windows, Linux, or Mac, there are a number of VNC servers that you can use. This means that VNC is versatile enough to be used for practically anybody!
You can get clients for these operating systems and more, too – meaning that pretty much no matter what type of computer you own, you’ll be able to use VNC to remotely connect to and use it.
What’s more, you can even connect to computers through VNC using your tablet and smartphone!
What Is VNC Used For?
The most common way people use VNC is to connect their Raspberry Pi to a monitor and keyboard when they’re away from home. They then use a VNC client app, or even a web browser (like Chrome) to log into the Raspberry Pi and do whatever they want with it.
You could also use VNC to allow yourself to access your Raspberry Pi while you’re out and about.
For example, you might have a Raspberry Pi running a server that provides you with an online backup service. Then, instead of having to plug it back into your router every time you need to make changes to your files, you could simply connect to your Raspberry Pi using VNC and make any changes you like.
When you’re done, you can disconnect again and leave the Raspberry Pi alone until you need it next.
How To Update The Raspberry Pi
First, for ease of use, you’ll want to be running the latest version of Raspberry Pi OS. This comes with a VNC server installed and configured already, meaning you’ll have to do a lot less setup than using other VNC servers.
Of course, if you want to get a bit more advanced – or you have a preferred VNC server application – then there’s nothing to stop you installing and using a different one.
To make sure that your system is up-to-date, open a terminal so that you can access the command line. Run this command first:
sudo apt update
Typing this tells your system to run the program “apt”, which is the software manager for the Raspberry Pi OS. The “update” part of the command means that you’re asking it to check for updates – but not to actually install any yet.
And, finally, the “sudo” part at the start is telling the system that you want to be allowed to run the program with administrator access.
This will prompt you for your password. You need to put this in, as you won’t be able to run any updates to your system without administrator access.
This is why you use the sudo command.
It gives you the ability to run a command with more privileges than a standard user account, for purposes of things like this – but without the extra security risk of permanently giving your account the ability to make changes that could damage the system without careful use.
After you’ve entered your password, and pressed enter, the system will connect to online servers and check for updates to anything you’ve installed through apt. This could take a few seconds, to a minute or so. Be patient – it’ll be done soon, as long as your internet connection is working!
Once you’ve done this, now it’s time to actually install the updates! This is done with the following command:
sudo apt upgrade
Now, the system will come up with a list of installed software that it has found updates for.
It’ll ask you for permission to update them. It’ll also tell you how much will have to be downloaded, and how much more disk space (if any) is going to be used after the upgrade.
In most circumstances, it is probably ok to accept this. The app updates are monitored and are considered safe to install in almost all circumstances.
In fact, they often add security fixes, and sometimes performance enhancements too. So, it’s usually a good idea to keep your Raspberry Pi up to date by running these commands every few weeks or so.
Check for any error messages, or apps you don’t want to update before accepting. If there aren’t any error messages, then you can type y, and then press enter.
The Raspberry Pi will download the software updates, and install all of them automatically! If there are any programs that need to be installed to make a program work correctly, it’ll install them for you too.
How Do I Enable VNC On My Raspberry Pi?
The easiest way to enable VNC on the Raspberry Pi is in the graphical desktop.
Click the Raspberry icon that’s in the bottom left of the screen. if you’re used to Windows, you’ll notice that it’s in the same place that the Start/Windows button would be.
Go to Menu > Preferences > Raspberry Pi Configuration > Interfaces. Enable VNC here, along with any other extra interfaces you might like to use, such as SSH.
Once you’ve done that, the software will start every time you boot. There you go – it couldn’t be simpler! You might have to check port settings on your networking equipment in order to make a connection, but the setup on the Raspberry Pi is done (see also ‘How To Set Up Raspberry Pi Remote Desktop On Windows/ Linux/ Mac‘)!
Enabling VNC Through The Command Line
To enable the VNC server in the command line, you need to run raspi-config. You can then choose to enable a VNC server on your Raspberry Pi.
First, start a Terminal window. Type the following command in the Terminal window:
From the first menu, select Interface Options. Then select VNC. When you do so, raspi config prompts whether to enable VNC. Choose yes to enable VNC! Once you’ve done this, and you’ve returned to the main menu, select finish. VNC should be up and running!
Connect To VNC To Control Raspberry Pi
To connect to your Raspberry Pi remotely you need to install RealVNC viewer software. It’s not too complex to install the RealVNC viewer on your computer.
Go to the official website of RealVNC and download the version corresponding to your OS (Linux, Mac, or Windows).
Once you have downloaded and installed the program, you only need to launch it and connect the Raspberry Pi by IP address. You are now connected, and you can control the Raspberry Pi!
VNC is a great way to control your Raspberry Pi remotely – and hopefully, this guide has helped you to learn how to set it up!
- The Best Raspberry Pi Christmas Gifts - December 2, 2023
- Introducing The Raspberry Pi 5 – Everything We Know So Far - October 6, 2023
- Connecting A Color Sensor To A Raspberry Pi Or Arduino - September 21, 2023