Using a Raspberry Pi as a standard PC — with a monitor and keyboard — is one way of interacting with the device. But often, you may not need these items. Your USB ports may be too busy to connect a keyboard and a monitor may be too unwieldy for your project. While a compact, portable, touchscreen display is an option, you could abandon the idea of a dedicated display entirely in favor of accessing your Pi remotely.
SSH is a popular means of doing this, but without additional software and configuration, this is limited to command line access. VNC is a strong alternative for remote desktop access, and now comes built into the main Raspberry Pi operating system, Raspbian Jessie with the PIXEL desktop.
What Is VNC?
Virtual Computing Network is a means by which you can connect remotely to a second computer. It uses the Remote Frame Buffer protocol to allow desktop access and control, and it can be used across operating systems too.
We’ve previously looked at how you can connect to your Raspberry Pi from a Windows, Mac or Linux PC using VNC, but the integration of RealVNC with Raspbian Jessie and the PIXEL desktop update means that much of the process has been streamlined.
Now the onus is on making sure you have the RealVNC server software configured on your Raspberry Pi, and a VNC viewer on your main or controller device.
Configure VNC on Raspbian Jessie
The easiest way to get started with RealVNC on your Raspberry Pi is to use the latest Raspbian Jessie with the PIXEL desktop.
You however need to enable the VNC server before you can connect to it. You could do this by booting up your Pi as a desktop, complete with keyboard, mouse, and display, and navigating through the preferences… but that’s not needed. To do everything headless (i.e. from another PC), you should first enable SSH.
Do this by switching off your Pi, removing the microSD card and inserting it into your computer. In the boot partition, create a blank file called SSH, with no extension. Safely eject the card and re-insert into your Pi. When booted, SSH will now be enabled. Login over a SSH connection, either by using the direct IP address or the Bonjour address raspberrypi.local:
(The default password is “raspberry”.)
Finally, you’ll need to enable VNC. To do this, run:
And browse with the arrow keys to Interfacing Options > VNC, then select Yes.
VNC is now enabled, and you’ll be able to remotely connect to a virtual desktop on your Raspberry Pi, via the RealVNC software.
If you’re not using Raspbian Jessie with the PIXEL desktop, you’ll need to manually install the latest RealVNC software from the Raspbian repositories. Run:
sudo apt-get update sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer
To enable, use raspi-config as described above.
VNC Server will now launch automatically each time the Pi is booted.
Remotely Control Your Raspberry Pi With VNC Connect
RealVNC can also be used to remotely control your Pi from anywhere in the world as long as you have an internet connection! VNC Connect is a free cloud service (for Home use, but Professional and Enterprise options are also available) that offers simple connection management and cloud-brokered secure connections.
This removes the need to create proxies or static IP addresses, and streamlines true remote access in a way that has not been seen before. Also, VNC Connect has improvements in desktop rendering speed and accuracy, which should make remote control even better than before.
Note: If you’re currently running TightVNC, it’ll need to be removed before using VNC Connect. They aren’t compatible. Don’t worry, though, as it will be automatically removed for you when you install RealVNC’s VNC server.
Create a RealVNC Account
With RealVNC server running on your Pi, you should create an account on your PC. Head to www.realvnc.com/download/vnc to grab a copy of the VNC Viewer app from RealVNC, and follow the steps during the initial launch to create an account with their service. Once this is done, remote connect to your Raspberry Pi desktop via VNC Viewer. You’ll need to enter the credentials created earlier. To access the VNC Connect service, click on the RealVNC icon in the desktop panel, click Sign In and follow the instructions, making sure to select the Direct and Cloud connectivity option.
Follow the on-screen instructions to complete setup of your account. By the end of this, you should have two computers in your “Team”: your Pi and your desktop. With five slots in the team, you’ll have space to add a mobile device or two!
As long as your Raspberry Pi is online, you’ll now be able to access it from anywhere via a RealVNC app with support for VNC Connect. That has the potential to make things a lot easier for many existing Raspberry Pi projects, and might just inspire something new!
Control Your Raspberry Pi From Mobile With RealVNC
Simply install and launch the app, click the + symbol and enter the IP address and screen number. With the password entered, you’ll be able to Connect.
RealVNC Viewer has a well-considered user interface, giving you the ability to accurately move the mouse with your fingertip and tap or double-tap on tools and icons in the PIXEL desktop environment. It’s one of the most effortless remote desktop experiences we’ve ever seen!
VNC and the Raspberry Pi
If you need to access your Raspberry Pi desktop remotely, VNC is perhaps the most flexible option. SSH is certainly faster, and RDP might offer some competition in the performance stakes, but VNC is cross platform with full graphical streaming.
We’ve looked at two VNC services here. If you’re new to the Pi, it makes sense to stick with the built-in Raspberry Pi option from RealVNC where possible, unless you prefer TightVNC and have been using it previously. While we’ve found that TightVNC is a little faster than RealVNC, it doesn’t offer anything like the VNC Connect cloud service.
What do you think? Do you use VNC or do you prefer to rely on SSH? Have you tried TightVNC and RealVNC, and perhaps have a different opinion on them to us? Tell us in the comments.