Sub topic 11
VNC: cross-platform screen sharing
This chapter assumes you know what an IP address, a port and a firewall are. It also assumes you have used RDP, which the previous chapter covered.
What VNC is
Virtual Network Computing (VNC) is a remote access system that shares a computer's screen over the network. The remote user sees the same screen as the person at the machine, and can move the mouse and type on it.
VNC uses the Remote Frame Buffer (RFB) protocol. RFB sends pictures of the screen, plus mouse and keyboard events. It does not care what operating system sits underneath. A VNC viewer on Windows can control a Linux desktop, and a viewer on macOS can control a Windows PC. That cross-platform reach is the main reason to choose VNC.
How it works
A VNC setup has two parts:
- VNC server: software on the computer being controlled. It captures the screen and accepts input.
- VNC viewer: software on the technician's computer. It displays the remote screen and sends input.
The server listens on TCP port 5900 by default. Extra displays use the next ports: 5901, 5902 and so on. Some web-based viewers use port 5800.
VNC compared with RDP
RDP and VNC both give you a remote desktop, but they work differently.
| Feature | VNC | RDP |
|---|---|---|
| Default port | TCP 5900 | TCP 3389 |
| What you see | The shared physical screen | Usually a separate session |
| Platforms | Windows, Linux, macOS and others | Built into Windows, with clients elsewhere |
| Built-in encryption | Often none in the basic protocol | Yes |
With RDP, a Windows machine normally locks the local screen while you work in your own session. With VNC, you share the screen that the local user sees. That is useful when you need to watch what a user is doing, and it is a poor fit if you want a private session.
Security
Basic VNC passwords are weak, and the traffic is often not encrypted. Anyone who can capture the traffic may see the screen. Take these steps:
- Use a VNC product that supports encryption, or tunnel VNC through SSH or a VPN.
- Set a strong password and do not reuse it.
- Do not forward port 5900 from the internet to a computer. Exposed VNC servers are scanned for constantly.
- Allow connections only from known addresses with firewall rules.
Choosing VNC on the exam
Pick VNC when a scenario mentions several operating systems, such as a Linux or macOS machine that needs remote desktop control. Pick RDP when the target is a Windows PC and you want a separate session. Pick SSH when only a command line is needed.
Exercise
A technician must see and control the desktop of a Linux workstation from a Windows laptop. Which protocol fits, what is its default port, and what should be done to protect the connection?
Show answer
VNC fits because it works across operating systems. Its default port is TCP 5900. Protect it by tunneling it through SSH or a VPN, using a strong password, and restricting access with a firewall instead of exposing the port to the internet.
Exercise
Name one difference between a VNC session and an RDP session on a Windows PC.
Show answer
VNC shares the screen the local user sees, so both people view the same desktop. RDP normally opens a separate session, and the local screen is locked.