1 year ago

VNC: Remote access a Raspberry Pi

Remote control your Raspberry Pi from another computer with VNC Server and Viewer

VNC (Virtual Network Computing) is a great technology included with Raspbian. With this tech, you can remotely control your Raspberry Pi from another computer, such as a PC or Mac, or even another Raspberry Pi board.

Sometimes it’s not convenient to work directly on a Raspberry Pi. This can be because it’s not easy to access, or because your keyboard and monitor are being used on your main computer.

Using remote networking, you can open the Raspbian desktop interface from your Raspberry Pi inside a window on your computer.

After you have set up the software, apps on your smartphone or tablet can be used to control aRaspberry Pi.

Set up VNC Remote Networking on your Raspberry Pi

By default, VNC Server from RealVNC gives you direct control over your Raspberry Pi, just as though you were sitting in front of it.

This is great for controlling lightweight Raspbian projects, such as IoT builds. As we’ll see in the steps, Raspbian Jessie with PIXEL includes Server by default. However, you will need to enable it yourself. From then on, Server will be loaded every time you switch on your Raspberry Pi.

Step 1. Enable VNC

VNC Raspberry Pi

Start with a fresh build of Raspbian Jessie with PIXEL. Choose Menu > Preferences > Raspberry Pi Configuration. Click on Interfaces and set VNC to Enabled. Click OK.

Step 2. Network

VNC Raspberry Pi

You’ll need to know which IP Address your Raspberry Pi is using to connect to it remotely. Open a Terminal window and enter ifconfig. Check for the four numbers next to “inet addr”. They’ll be under eth0 if you’re connected using an internet cable. Or wlan0 if you have connected to a wireless network. It’ll look like this: 192.168.0.5.

Step 3. Download VNC Viewer

VNC Raspberry Pi

Download and install  Viewer on your computer from RealVNC. Open the app and enter the IP Address from the previous step into the VNC Server field. Ensure Encryption is set to “Let VNC Server choose” and click Connect. OK. The first time you connect it will display a “VNC Server not recognized” alert. Click Continue.

Step 4. Desktop window

VNC Raspberry Pi

Enter Pi into the Username field, and “raspberry” (or your Raspbian password) in the Password field. Click The Raspbian PIXEL interface will appear inside a window on your computer. You can click on the Menu, open programs and run Terminal commands on your Raspberry Pi. If you have your Raspberry Connected to a monitor, you’ll see it move as you remote control it.

Step 5. Toolbar Settings

VNC Raspberry Pi

At the top of the virtual window is a small white strip. Hover the pointer over it to reveal a set of control icons, known as the Toolbar. Full-Screen Mode is one of the most immediately useful. Click Settings to the left to access options (the Advanced button near the bottom expands the list of settings).   

Step 6. Using Server

VNC Raspberry Pi

Another set of options is found inside the Server app on your Raspberry Pi. Click on the Server icon to view the server window. Next, Click on Details to see which users are connected (normally this will be just one). Finally, click More > Option to view detailed settings for the Server software.

Subscribe and never miss an issue

Get a free Pi Zero W with every twelve-month print subscription

Get a a brand new Raspberry Pi Zero W, a case for it, and a selection of adapter cables with a twelve-month print subscription to The MagPi!