Install and Configure TigerVNC server on Ubuntu 18.04

How do I install and configure TigerVNC server on Ubuntu 18.04 for remote desktop access? How to enable Remote Desktop connection between two Ubuntu Linux systems (server and client) to access GUI? How to configure Virtual Network Computing (VNC) in Ubuntu Linux 18.04 LTS or 18.10 server?

Introduction: VNC is an acronym for Virtual Network Computing. It is nothing but a Linux desktop sharing system or set of protocols for sharing desktop. One can use VNC to control or access Linux based desktop remotely. VNC works on client-server principal. There are many implementations of the VNC protocol for Linux or Unix like systems. Some typical examples are TigerVNC, TightVNC, Vino (default for Gnome desktop), x11vnc, krfb (default for KDE desktop), vnc4server and more. This page shows how to install and configure TigerVNC on Ubuntu 18.04 LTS Linux based system to get access to full Gnome 3 desktop.

Sample setup for installation of VNC server on Ubuntu

Sample setup for installation of VNC server on Ubuntu Linux
A VNC server located at shares a desktop with other client computers or mobile devices over the Internet or LAN. You must install TigerVNC server on Ubuntu server.

Most common VNC application

  • Remote technical support
  • Access files from home computer or work computer stored on a remote server
  • Access remote Linux desktop stored in the cloud-based system
  • Troubleshooting server issues. One can control Linux server or desktop when networking service is down. All you need is out of band management with an embedded VNC server in BMC.

How to install and configure TigerVNC server on Ubuntu 18.04 LTS

The procedure to install and configure VNC server on Ubuntu Linux is as follows:

  1. Login to remote Ubuntu server using ssh command
  2. Install the desktop environment such as Gnome or XFCE4 using apt command
  3. Install and configure the TigerVNC server
  4. Connect to VNC server from your desktop using SSH and vnc client

Let us see all steps in details.

How to Install and Configure VNC on Ubuntu 18.04 or 18.10

Type the following command to install tigervnc vnc server on your server:
$ sudo apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer

Install Gnome 3 desktop

Type the following command to install Ubuntu Linux desktop:
$ sudo apt install ubuntu-gnome-desktop
$ sudo systemctl enable gdm
$ sudo systemctl start gdm

How to configuring the VNC service

Login to user account, say vivek:
$ su - vivek

A sysadmin can create a new VNC user account too for the new desktop user using the useradd command and passwd command. For example, create a VNC user account nixcraft that will need to access the system via VNC:
$ sudo useradd nixcraft
$ sudo passwd nixcraft

Next setup a password for vnc login:
$ vncpasswd
$ ls -l ~/.vnc/

How to configuring Gnome 3 Desktop environment to use with VNC

You need to create a file name ~/.vnc/xstartup using a text editor such as vim command or nano command:
$ vi ~/.vnc/xstartup
Append the following:

# Start Gnome 3 Desktop 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

How to start TigerVNC server

$ vncserver
One can setup desktop bit depth such as 8, 16, 24, 32 and Desktop geometry in {width}x{height} as follows:
$ vncserver -depth {8|16|24|32} -geometry {width}x{height}
$ vncserver -depth 32 -geometry 1680x1050

Verify it with the ss command and pgrep command/egrep command:
$ pgrep Xtigervnc
$ ss -tulpn | egrep -i 'vnc|590'

How to stop TigerVNC server

To lill a VNC server running at desktop at :1
$ vncserver -kill :1
Sample outputs:

Killing Xtigervnc process ID 9523... success!

VNC server to kill all, *
$ vncserver -kill :*

How to list VNC server sessions on Ubuntu Linux

$ vncserver -list
Sample outputs:

TigerVNC server sessions:

:1		5901		9523

Note down the port # 5901. We are going to use that one with the ssh command.

How to connecting with a VNC client and ssh session

VNC is a clear text and insecure network protocol. To make the communication secure, you must encrypt your server-client connection by using an SSH tunnel between the VNC server and the client. Type the following ssh command to setup SSH tunnel from your Linux or Unix desktop:
$ ssh user@remote-server -L 5901:
$ ssh vivek@power9 -L 5901:

Open a local vnc client and type url

Once connected you can see the desktop:


You just learned how to install and configure TigerVNC server on Ubuntu 18.04 LTS or 18.10. You need to make the communication secure using ssh. Finally, you connected to VNC server using SSH tunnel. For more info see TigerVNC home pager here.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Yuri Fontoura Nov 13, 2020 @ 14:15

    If you want to access by all local network, not only in localhost, you need to type:

    vncserver -localhost no -geometry 800x600 -depth 32
    Geometry is optional anyway you have to input “-localhost no”..

    Another good practice is to create a routine to start the tigerVNC on system startup.
    Hope it helped!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum