# VNC on Arm Linux

## About this Install Guide

| Reading time:     | 15 min       |
|--------------------|--------------|
| Last updated:      | 22 Jun 2026  |
| Ecosystem dashboard:| [View](https://developer.arm.com/ecosystem-dashboard/linux?package=TurboVNC) |

| Author:            | Jason Andrews, Arm [GitHub](https://github.com/jasonrandrews) [LinkedIn](https://linkedin.com/in/jason-andrews-7b05a8) |
|--------------------|--------------|
| Official docs:     | [View](https://tigervnc.org/) |

This guide shows you how to install and use the tool with the most common configuration. For advanced options and complete reference information, see the official documentation. Some install guides also include optional next steps to help you explore related workflows or integrations.

Virtual Network Computing (VNC) is one of the common tools used to connect to a remote Linux desktop. During development, it can be useful to quickly create a remote desktop on an Arm server.

This guide provides information about how to set up VNC on a remote Arm Linux machine.

This installation only works on newer versions of Ubuntu and Debian. It was successfully tested on Ubuntu 22.04 and Ubuntu 24.04.

## What is VNC?

VNC is a client-server application. A VNC server runs on a remote machine. A VNC client runs on the local machine and connects to the remote server.

### How do I install the VNC server and xfce4 desktop?

To use VNC, you need to install a VNC server. There are multiple VNC servers you can use. This guide uses [TigerVNC](https://tigervnc.org/).

You also need desktop software. There are many options for this, but using [xfce4](https://www.xfce.org/) provides a minimal install with good performance.

Install the desktop software:

```
sudo apt-get install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils xfce4-terminal -y
```

Install the VNC server:

```
sudo apt-get install tigervnc-standalone-server tigervnc-common -y
```

### How do I set a VNC password?

Run the `vncpasswd` command to set a password for VNC. This is not the password for your user account, but for the VNC client to connect to the VNC server.

```
vncpasswd
```

Remember this password for later when you connect the client.

### How do I configure the desktop startup for VNC?

Create a file at `$HOME/.vnc/xstartup` with the following contents:

```
#!/bin/sh
# select your favorite windows manager here
/bin/bash -l <<EOF
exec /etc/X11/Xsession startxfce4
EOF
```

Make sure the `xstartup` file has executable permissions:

```
chmod +x $HOME/.vnc/xstartup
```

### How do I set up a systemd service to manage VNC?

To create a systemd service to start the VNC server, create the file `/etc/systemd/system/vncserver@.service`.

Use `sudo` or root privileges because this file is in a system directory.

If your username is not `ubuntu` change the `User` value to match your username after you create the new file.

```
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User=ubuntu
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :%i > /dev/null 2>&1 || : '
ExecStart=/usr/bin/vncserver :%i -localhost no -geometry 1440x900 -alwaysshared -fg
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target
```

The following commands are for any Linux distribution that uses `systemd`.

To start the VNC service:

```
sudo systemctl start vncserver@1.service
```

To stop the VNC service:

```
sudo systemctl stop vncserver@1.service
```

To restart the VNC service:

```
sudo systemctl restart vncserver@1.service
```

### How do I use port forwarding via SSH to connect to VNC?

The default port for the first instance of VNC is `5901`. SSH port forwarding is the recommended solution for accessing the Linux desktop on a cloud machine. This way, no additional ports need to be opened in the security group.

SSH to your remote Linux machine. See [SSH](https://learn.arm.com/install-guides/ssh/) for additional details.

Substitute your private key file and the public IP address of the remote machine in the following command:

```
ssh -i <private_key> -L 5901:localhost:5901 ubuntu@<public_ip_address>
```

Once connected via SSH, use a VNC client to connect. [Download](https://sourceforge.net/projects/tigervnc/files/stable/1.12.0/) and install a TigerVNC client for your computer.

Open the VNC client and enter the following for the VNC server:

```
localhost:5901
```

You will be prompted for the password you created earlier with `vncpasswd`.

A remote Linux desktop should appear on your local computer. When you are finished, close the VNC client first and then exit the SSH connection.

![Linux desktop](https://learn.arm.com/install-guides/_images/xfce4.webp)
