0% found this document useful (0 votes)
5 views

Slides

The document provides a guide on using Virtual Network Computing (VNC) to connect to a Raspberry Pi's graphical desktop from a remote device. It outlines the steps to enable the VNC server on the Raspberry Pi and configure the VNC client on a desktop. Additionally, it explains how to start the GUI in headless mode and connect to the Raspberry Pi's desktop using RealVNC Viewer.

Uploaded by

Mohamed Elsafany
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Slides

The document provides a guide on using Virtual Network Computing (VNC) to connect to a Raspberry Pi's graphical desktop from a remote device. It outlines the steps to enable the VNC server on the Raspberry Pi and configure the VNC client on a desktop. Additionally, it explains how to start the GUI in headless mode and connect to the Raspberry Pi's desktop using RealVNC Viewer.

Uploaded by

Mohamed Elsafany
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Beginning Custom Projects with

Raspberry Pi
Connecting to a Remote GUI Desktop with VNC
What is Virtual Network Computing?

Keyboard, Mouse

Screen

▪ Graphical desktop sharing via network


▪ Keyboard, mouse → Raspberry Pi
▪ Raspberry Pi screen → your computer
▪ GUI access to remote/embedded device
(Wikipedia; RealVNC Ltd; Raspberry Pi Foundation, 2019)

5
VNC Server and Client

VNC VNC
Client Server

▪ Client/Server architecture (like SSH)


▪ VNC Server runs on your Raspberry Pi
▪ VNC Client runs on your desktop, phone, etc
▪ Need to enable server (like SSH, raspi-config)
(Wikipedia; RealVNC Ltd; Raspberry Pi Foundation, 2019)

6
Enabling the VNC Server
Step 1
▪ SSH to your Raspberry Pi
▪ Use the IP address as we determined it in Module 1
▪ Don’t forget to specify the user “pi” (if using default username)

Step 2
▪ Run raspi-config
▪ raspi-config needs “sudo” because it requires root privileges

7
Enabling the VNC Server
Step 3
▪ Select item #3 “Interface Options”
(as we did for enabling SSH in Module 1)

8
Enabling the VNC Server
Step 4
▪ Select item P3 “VNC”

9
Enabling the VNC Server
Step 5
▪ Confirm that you would like to enable the VNC Server

10
Enabling the VNC Server
Step 6
▪ The VNC Server is enabled, immediately and for future reboots.

11
VNC Client

VNC VNC
Client Server

▪ We have our VNC server running


▪ Now we configure the VNC client
▪ VNC is an open protocol
▪ Many clients to choose from
▪ Some offer extended features or interoperability
(Wikipedia; RealVNC Ltd; Raspberry Pi Foundation, 2019)

12
Many VNC Clients Available

TightVNC
▪ Free and open-source ▪ Free and open-source
▪ Available via Flatpack and Snap ▪ Cross-platform
▪ Claims good Windows support

TigerVNC
▪ RealVNC’s “VNC Connect” product
▪ Free and open-source
▪ Raspberry Pi OS ships with
▪ Split from TightVNC project RealVNC server
▪ Accelerated encoding when used with ▪ RealVNC Viewer has the best
TightVNC server compatibility with RealVNC server
13
Downloading RealVNC Viewer
https://www.realvnc.com/download/viewer/

14
Starting RealVNC Viewer
▪ Example below is on Ubuntu Linux (similar on Windows)
▪ Download the file
▪ Allow “execute” permissions (see Module 1 bonus lessons if you’re unfamiliar)
▪ Run it by specifying the fully-qualified path in the form ./[filename]

15
Using RealVNC Viewer
▪ Must specify which GUI desktop
▪ Format is [ip]:[display number]
▪ Default display number is “1”
▪ However, currently this will fail
No GUI is currently running
(GUI automatically starts when
monitor is connected)
We must manually start GUI

16
Manually starting GUI
▪ “headless” mode (no monitor attached) means GUI
doesn’t automatically start
▪ We must manually start GUI as a “virtual desktop”
▪ SSH to Raspberry Pi
▪ issue command: vncserver

(Raspberry Pi Foundation)

17
Manually starting GUI
▪ Note IP and display number at the bottom as [IP]:[display number]

18
Connecting with RealVNC Viewer
▪ Now display #1 is running
▪ Connect string is [IP]:[display]

19
Authenticating with RealVNC Viewer
▪ Authenticate using normal
username and password

20
Accessing the GUI with RealVNC Viewer
▪ This is the Raspberry Pi OS
graphical desktop
▪ This is the same desktop that you
would see with a directly connected
monitor, keyboard, mouse
▪ You can access this from any
device on your local network
▪ RealVNC offers a cloud service
which allows worldwide internet
access to your Raspberry Pi

21
Summary

VNC VNC
Client Server

▪ VNC server is running, virtual desktop is started


▪ VNC viewer client connects to the virtual desktop
▪ Destroy a virtual desktop with vncserver -kill :1
▪ Next: Exploring the graphical desktop

(Wikipedia; RealVNC Ltd; Raspberry Pi Foundation, 2019)

22
© The Johns Hopkins University 2021, All Rights Reserved.

You might also like