Tag Archives: TightVNC

How to Install and Configure VNC on Ubuntu 14.04

Step One — Install Desktop Environment and VNC Server

$ sudo apt-get update
$ sudo apt-get install xfce4 xfce4-goodies tightvncserver

Step Two — Configure VNC Server

$ sudo mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
$ sudo nano ~/.vnc/xstartup

----------------------------------------
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
----------------------------------------

$ sudo chmod +x ~/.vnc/xstartup

Step Three — Create a VNC Service File

$ sudo nano /etc/init.d/vncserver

------------------------------------------------------------------------
#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="user"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
. /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
------------------------------------------------------------------------

$ sudo chmod +x /etc/init.d/vncserver
$ sudo service vncserver start

PS:how-to-install-and-configure-vnc-on-ubuntu-14-04,