Step by step installing VNC Server on Ubuntu 14.04

Linux, Ubuntu, 2015-06-16 23:24:50 UTC

Server side 

1. Update Ubuntu

$ sudo apt-get update
$ sudo apt-get dist-upgrade

2. Install some package; Gnome, XFCE, Firefox and Nano

$ sudo apt-get install gnome-core xfce4 firefox nano

3. Installing VNC Server

$ sudo apt-get install vnc4server

4. Run VNC Server for the first time

$ vncserver

You will require a password to access your desktops.

Password too long - only the first 8 characters will be used
xauth:  file /home/your_name/.Xauthority does not exist

New 'your_name:1 (user_name)' desktop is your_name:1

Creating default startup script /home/your_name/.vnc/xstartup
Starting applications specified in /home/your_name/.vnc/xstartup
Log file is /home/your_name/.vnc/your_name:1.log

Above command create a file .vnc/xstartup and you need to terminate VNC Server

$ vncserver -kill :1

5. Open xstartup file

$ sudo nano .vnc/xstartup

xstartup look like below and you need to add startxfce4


# Uncomment the following two lines for normal desktop:
# exec /etc/X11/xinit/xinitrc

startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

6. Start your VNC Server

$ vncserver -geometry 1024x768

Client side

1. Start your client. For this example, I use SSL/SSH VNC Viewer

2. Don't forget to Use SSH option and click Connect

3.  Type your password in terminal shown

4. You can see the XFCE Desktop