Raspberry Pi is small and requires very little power, making it a great choice if you need an always-on device such as a file server or media player. In these cases, you may not necessarily want to have a monitor, keyboard, and mouse always attached to your Raspberry Pi.
Running a computer without a monitor, keyboard, or mouse is often called running it headless, and uses a set of rules known as a communication protocol that allows two or more computers to communicate with each other. The two main protocols that you are likely to use to control your Raspberry Pi from another computer (such as your laptop, phone, or tablet) are VNC and SSH. VNC allows you to access the Raspberry Pi Desktop remotely, whereas SSH just allows you to access the command line.
In this step, I’ll show you how to use VNC from a Windows, MacOS, or Linux computer, or a device running Android or iOS.
VNC is an acronym for Virtual Network Computing, and it allows your Raspberry Pi to send its screen to another device, as well as allowing your laptop, phone, or tablet to send keyboard, mouse, and touchscreen commands to your Raspberry Pi.
As VNC can potentially be a security risk, especially on open networks, it is not enabled by default. Before you enable VNC, you should make sure that your home network router has an enabled firewall and a secure password, and that any wireless connections are using WPA2, as earlier security methods are insecure. If you’re unsure about how to do this, you or whoever looks after your router and network should visit the website of your internet service provider (ISP) to find out how to access these settings (it’s usually done through your web browser).
Open the Raspberry Pi Configuration menu from the Preferences option in the main menu, and set VNC to Enabled.
Click on the OK button, and a new VNC icon should appear in the top right-hand corner of the screen. Click on this to open up VNC Connect. This window will provide some important information on your Raspberry Pi, including the Internet Protocol (IP) address. This will probably be something similar to 192.168.1.xxx, where xxx is replaced by a number between 0 and 255 inclusive.
Now that VNC is enabled, you can connect to your Raspberry Pi using another device. You’ll need VNC Viewer software running on that device.
VNC Viewer installation and set-up for Windows, Linux, or MacOS
Switch to the device that you want to use to remotely access your Raspberry Pi. The screenshots in this section are from a computer running Windows 10, but the process is very similar for other operating systems.
Go to the VNC Connect downloads page and download the VNC Viewer for your operating system.
Install the application once it has downloaded. You may need to allow the installation of untrusted software for your OS.
Open the VNC Viewer and dismiss any opening message you receive.
Enter the IP address of your Raspberry Pi (the address you found in VNC Connect) into the bar at the top.
A warning dialog box will appear. Check that the Signature and Catchphrase shown are the same as those displayed on the VNC Connect application on your Raspberry Pi, to ensure you are connecting to the correct device. If they are, click on Continue.
Enter your Raspberry Pi username and password into the fields provided and click on OK.
You should now see the Raspberry Pi Desktop in a window. You can use your keyboard and mouse to control your Raspberry Pi. Everything inside the window is remotely controlling your Raspberry Pi. Click outside the window to use your Windows or Mac as normal.
Android and iOS
You can find the RealVNC Viewer for Android in the Google Play store and the RealVNC Viewer for iOS in the Apple App Store.
Install the app, open it, and click on the + icon to add the Raspberry Pi that you wish to connect to. You’ll have to enter the IP address of your Raspberry Pi, check the signature and catchphrase, and sign in to your user account in much the same way as was shown for Windows, Linux, and Mac OS X.
The touchscreen works to move a mouse cursor around the screen, and tapping the screen works as a mouse left-click. For other options and information on using special keys, check the help included in the app.
VNC is useful if you want to access the graphical desktop and use applications remotely. If you just need to be able to type commands remotely, then SSH (Secure Shell) is much faster and more secure. I’ll show you how to use it in the next step.