[root tip] [How To] TigerVNC over SSH

Difficulty: ★★☆☆☆

VNC

VNC is a protocol where you use your keyboard/mouse/screen to monitor or control a remote system.

This document is from my notepad and a real-world implementation of the document(s) found at Archlinux Wiki - TigerVNC.

NOTE: The setup is not implementing any VNC encryption so SSH will be used to establish the connection. See [root tip] [How To] Set up your own SSH service.

The benefit of using SSH is that you can easily adapt this to target any remote server without sacrificing security.

Target system

On the system to be controlled install package tigervnc

VNC password

Create a password for your login

vncpasswd

Config

Replace the phrase $USERNAME with the username of the actual user you want to configure.

List the available sessions

ls /usr/share/xsessions

Create the file /home/$USERNAME/.vnc/config with content (replace $SESSION according to your installation e.g. openbox)

session=$SESSION
geometry=1280x720
localhost
dpi=96

Allow user on specific display

Edit /etc/tigervnc/vncserver.users and append e.g. :2 - which in turn will correspond to port 5902 - replace $USERNAME with the user you just created the password for.

:2=$USERNAME

Start a vncserver at the selected display

systemctl enable vncserver@:2

Reboot the device

reboot

Controlling system

Install the package tigervnc

Connect to target system

SSH provides a secure channel and using key based authentication is the recommended method.

Open a ssh connection using port mapping

ssh $USERNAME@ip.x.y.z -L 9902:localhost:5902

Then launch the VNC viewer and input the following connection details and click connect

localhost:9902

Input the password created earlier (ignore the warning as we are using an encrypted connection) and you will see the remote system - which could just be a Raspberry Pi sitting next to you on the desk.

Connected to Pi using TigerVNC on MacBook Pro M1

11 Likes
RealVNC Issue at Login Screen
How to use remmina or other easy way to perform a remote desktop access?
Remote desktop Mac to Manjaro
Xrdp and polkit
TigerVNC Server setup fails
How to connect vnc ( server and viewer or tigervnc) manjaro OS for raspberry pi?
VNC cannot currently show desktop
VNC Server Setup
How do I relinquish my laptop screen and keyboard to a Raspberry-pi?
[root tip] [How To] Install Raspberry Pi - VNC over SSH
Setting up SSH for incoming logins
Manjaro Settings Manager, Locale Settings goes back to original values when Applying
How to control one computer from another visually?
VNC Server + X11 forwarding
Access Manjaro RPI through internet
Cannot successfully SSH to Raspberry Pi 4
Tigervnc is starting and stopped immediately on a service restart
Resize of remote TigerVNC session doesn't work (RANDR extension not present)
[root tip] [How To] Hacking the ARM desktop installer
Creating virtual monitor for teamviewer?
Unable to boot to desktop after latest update
Raspberry Pis will not connect via SSH
Getting VPS vnc working
Remote Access to home machine?
TigerVNC Server setup fails
Stupidly basic: how to deal with "Unit file vncserver.service does not exist"?
X11vnc service is slow
Manjaro minimal on rpi4 - is there a simple graphical interface to use with it?
RealVNC "administrative privileges needed"
Accessing manjaro gnome from a windows machine by using remote desktop control
How to change "either VNC or SSHD" to "VNC and SSHD"
I can't configure XRDP it instanly shut itself after login
X11vnc extremely slow in headless mode
Using Remmina to RDP from Manjaro on one machine to Manjaro on another machine