How to set up VNC server on Linux

Virtual Network Computing (VNC) allows you to share desktop environment on a local host with other remote users over network. To share desktop, a VNC server should be running on a local host, and remote users connect to the VNC server by using any VNC viewer client.

In this tutorial, I will explain how to configure VNC server on Linux. In this set up, I will use vino, VNC server software for the GNOME desktop environment.

To install vino VNC server on Debian, Ubuntu or Linux Mint desktop:

$ sudo apt-get install vino

To install vino VNC server on Fedora, CentOS or RHEL desktop:

$ sudo yum install vino

After installation, you can start vino, and enable VNC server by entering vino-preferences command.

$ vino-preferences

The above command will open up vino's desktop sharing preference window as shown below. On this window, click checkbox on "Sharing" to allow users to view and control your desktop. Optinally, set up VNC password. You can close the window after you are done with configuration.

The vino-preferences utility is then supposed to start vino VNC server automatically. If VNC server is not launched for whatever reason, you can start VNC server manually as follows.

$ /usr/lib/vino/vino-server &

You can check if vino is running by typing the following command.

$ sudo netstat -pl | grep vino
tcp        0      0 *:5900                  *:*                     LISTEN      6646/vino-server
tcp6       0      0 [::]:5900               [::]:*                  LISTEN      6646/vino-server
tcp6       0      0 [::]:5800               [::]:*                  LISTEN      6646/vino-server

As shown above, vino-server is running on TCP port number 5800 and 5900. You can use any VNC client software to connect to the VNC server.

If VNC server is configured such that you must confirm each VNC access on your desktop, you will see the following pop up message every time a VNC connection request is received. Only when you allow VNC access, will VNC client be able to access your desktop.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

2 thoughts on “How to set up VNC server on Linux

    • Yeah tightvncserver is also a solid lightweight VNC server. It's just that vino comes with Ubuntu or Fedora by default, so you don't need to install any other software.

Leave a comment

Your email address will not be published. Required fields are marked *

Current day month ye@r *