Hi

In this tutorial you will learn how to install VNC on a remote server, linux, ubuntu 14.04 (works with older versions).
We gona install and configure VNC and desktop.
What you need:
A Linux VPS
Nano - editing files, mostly VPS servers have it installed.
Ubuntu
SSH - to connect to server
VNC Client - to connect to desktop/vncserver
Lets start:
1:
Start with
sudo apt-get update Now install vncserver, I prefer tightvncserver for ubuntu, but wont say same for centos.
sudo apt-get install xfce4 xfce4-goodies tightvncserver Now test it,
vncserver :1It should look sth like this, but with a mouse icon
if its working, kill it
vncserver -kill :12:
Lets configure our VNC server
but lets make a backup of xstartup just incase
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak Open a new file with nano
nano ~/.vnc/xstartup insert
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 & Now save and exit by pressing
CTRL + X Grand permissions
sudo chmod +x ~/.vnc/xstartup 3:
Create service file
sudo nano /etc/init.d/vncserver insert
#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="user"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
. /lib/lsb/init-functions
case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
stop)
log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
CTRL + X grant permissions
sudo chmod +x /etc/init.d/vncserverCongratulations!
Start vncserver:
sudo service vncserver startor you can use
vncserver :1or even
vncserverFor security reasons, sometimes you will have problems installing things in VNC as a ROOT user.
I guess ill post more tuts for ubuntu on the future.
For any problems PM me.
I got some help from DIGITALOCEAN