How to do it...

  1. First, we need to install the TightVNC server on Raspberry Pi with the following commands. It is advisable to run an update command first to get the latest version of the package you want to install, as follows:
sudo apt-get update
sudo apt-get install tightvncserver  
  1. Accept the prompt to install and wait until it completes. To start a session, use the following command:
vncserver :1  
  1. The first time you run this, it will ask you to enter a password (of no more than eight characters) to access the desktop (you will use this when you connect from your computer).

The following message should confirm that a new desktop session has been started:

New 'X' desktop is raspberrypi:1  

If you do not already know the IP address of ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.