How do I install a VNC server?

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.


Solution 1:

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.

Solution 2:

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.

Solution 3:

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
    

    Output:

    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.