Summary

In last lesson, we introduced how to config wifi for Raspberry Pi. In this lesson we will explain how to install and use VNC on your raspberry Pi. This will allow you to see your Raspberry Pi’s desktop remotely in a graphical way, using the mouse as if you were sitting in front of your Pi.

Connecting to a Pi like this can save on desktop clutter, and the problem of having multiple keyboards and mice all over the place. It also means you can put your Pi somewhere else on the network, but still control it.

Installing VNC

SSH or Console Cable is often all you need to control your Raspberry Pi, however sometimes it is useful to be able to remote control your Raspberry Pi using the mouse and seeing just what you would see on the screen of the Raspberry Pi.

VNC (Virtual Network Connection) is a standard for doing just this. To use it, you have to install some software on your Pi. There are a number of VNC server applications, and the one we are going to use is called “tightvnc”.

We can install the VNC server software using the Console Cable connection that we established earlier.

Enter the following command into your terminal:

sudo  apt-get  update

sudo apt-get  install tightvncserver

We now need to run the VNC Server, so enter the following command into your window:

vncserver :1

You will be prompted to enter and confirm a password. It would make sense to use “raspberry” for this, but passwords are limited to 8 characters, so I use “raspberr”. Note that this is the password that you will need to use to connect to the Raspberry Pi remotely.

You will also be asked if you want to create a separate “read-only” password – say no.

From now on, the only command that you need to type within your terminal to start the VNC server will be:

vncserver :1

Enter the following command into your terminal:

ifconfig  wlan0

Get Pi’s IP  and remember  it .e.g 192.168.1.120

Using a VNC Client

Again, there are many VNC clients, of which “VNCViewer” (http://www.realvnc.com) is available for most platforms and I have found it to work well with TightVNC.

When you first run VNCViewer, you will see the following:

Enter the IP address of your Raspberry Pi, append :1 (to indicate the port) and click on “Enter”. Please make sure that the PC which is installed VNC viewer is in the same lan of Pi.

You will then get a warning message. Just click ‘Continue’.

The following window will then popup for you to enter your password (“raspberr”).

Finally, the VNC window itself should appear. You will be able to use the mouse and do everything as if you were using the Pi’s keyboard mouse and monitor, except through your other computer.

As with SSH, since this is working over your network, your Pi could be situated anywhere, as long as it is connected to your network.