I want to install some VNC server on my ubuntu 12.04. which one is the best / recommended? how do i configure it?

all i want is to be able to connect my desktop computer through my laptop. i want something simple like connecting with RDP protocol between windows computers.


5 Answers 5


To install VNC just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo apt-get update

This updates the package list for apt.

Then you'll need to install the Gnome components using Software Center:

Install via the software center

Or Using Terminal:

sudo apt-get install gnome-core

To install VNC server using Software Center:

Install via the software center

Or Using Terminal:

sudo apt-get install vnc4server

For more info just take a look at Complete VNC Server Setup.

  • I just wanted to add that I've followed that guide myself, which helped a lot. However, perhaps due to things changing, an issue of a grey screen showing up was addressed in this forum topic, and the answer is to use gnome-session & instead of what the blog author uses.
    – gcode
    Commented Feb 13, 2014 at 23:44

Another option, if you're using Microsoft's Remote Desktop Connection client:

sudo apt-get install xrdp

That's it, no additional configuration needed! Now you can connect from your Windows or Mac laptop using Microsoft Remote Desktop Connection client. I was actually quite surprised how simple it was.

Edit: This doesn't seem to work out-of-the-box with anymore with 16.04.

  • 1
    Note that RDP (Microsoft Remote Desktop Protocol) is a different kind of protocol from VNC--this is not actually VNC. It is, however, an excellent solution for many of us! Commented Aug 12, 2014 at 9:26
  • @wesbucky, Tab does not work inside the remote session for some reason. Any suggestions?
    – DaSh
    Commented Feb 11, 2015 at 21:59
  • A few questions - "no additional config needed" - will this automatically run at startup? Will this automatically set my user's password as the RDP password?
    – user423626
    Commented Apr 14, 2016 at 17:49
  • 2
    As of 2017 xrdp is not supported with Ubuntu Unity - Ubuntu default desktop environment Commented Feb 16, 2017 at 13:44
  • I got this working out of the box on Ubuntu 18.04.3 LTS. If your client system is Windows then this is the easiest solution.
    – CJ7
    Commented Jan 9, 2020 at 23:20

Here I am going to show you that how to install vnc server and configure it. We use VNC package to Remote Graphical Access. I will tell you the configuration of VNC for Linux on Ubuntu Platform.

There are the 4 easy steps to install and configure the VNC.

On Server:

  1. Install the required x11vnc package in ubuntu.

    sudo apt-get install -y x11vnc

    If headless server (EC2 aws Instance) install gnome packages.

    sudo apt-get install gnome-core

  2. Create a password for a user.

    x11vnc -storepasswd


    Enter VNC Password:
    Verify password:
    Write password to /home/user/.vnc/passwd? [y]/n y
    Password written to: /home/user/.vnc/passwd
  3. To run the vnc server on every start automatically. We have to open /etc/rc.local file.

    sudo nano /etc/rc.local

    Copy the below line to start vnc session automatically with system startup, paste it the line before the exit 0.

    sudo x11vnc -xkb -noxrecord -forever -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -usepw &

For more details see My Article.

  • sudo x11vnc -xkb -noxrecord -forever -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -usepw & seems to fail on Ubuntu 16.04 because it asks for the password from terminal, but it cannot be given because it is on background? Removing & seems to work. Commented Aug 21, 2016 at 10:30
  • And then from the client, sudo apt-get install vinagre && vinagre $IP. Beauty!! Commented Aug 21, 2016 at 10:31

I found that I had to make some changes to my Ubuntu box after installing xrdp per this article, How to use xRDP for remote access to Ubuntu 14.04.

The basic procedure was to install and set up xrdp and xfce4:

sudo apt-get update    
sudo apt-get install xrdp
sudo apt-get install xfce4 xfce4-terminal
echo xfce4-session >~/.xsession

Then modify the last line of the file /etc/xrdp/startwm.sh to start startxfce4 rather than what is there, I think it was originally a path to Xsession.

After modifying the file use the command sudo service xrdp restart to restart xrdp so that it will have the changes.

See also this article, How do I get xrdp to work form windows to linux on Ubuntu forums which describes modifying the /etc/xrdp/startwm.sh file as well though the procedure is a bit different by creating a configuration file in the user's root directory.

In the Remote Desktop Connection application in Windows I set the Colors to be High Color (16 bit).

  • using xfce, ubuntu comes with unity already
    – None
    Commented Aug 11, 2019 at 3:40

Vino "Desktop Sharing" pre-installed VNC server

Desktop Ubuntu comes with a server pre-installed called Vino from the GNOME project.

It is hidden behind the "Desktop Sharing" application name in dash, even the executable is not in the path!

Once you launch it check:

  • Allow other users to [view | control] your desktop
  • Require the user to enter this password
  • Automatically configure UPnP router to open and forward ports

And then from the other computer, connect as:

sudo apt-get install vinagre
vinagre host-name:0

There is however a protocol incompatibility problem with the encryption of major Windows clients like TigerVNC and RealVNC: Gnome 3.10 sharing desktop --- how to configure the security type for VNC? Disabling encryption is a possible workaround in some cases.

I could only configure the port with dconf... the default is port 5900 which means :0. sudo netstat -tupan | grep vino may also help.

To shutdown the server, just uncheck "Allow other users to [view | control]" and that kills the server process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .