VNC Server Installation on Ubuntu 14.04.3

Install as ‘root’ user:
Login as root:
apt-get -y install ubuntu-desktop tightvncserver xfce4 xfce4-goodies
vncpasswd
#add this new file
vi /etc/init.d/vncserver
————
#!/bin/bash
PATH=”$PATH:/usr/bin/”
export USER=”root”
DISPLAY=”1″
DEPTH=”16″
GEOMETRY=”1024×768″
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 “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
———–
#add this new file
vi /root/.vnc/xstartup
———————
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
startxfce4 &
————————-
chown -R root. /root/.vnc && chmod +x /root/.vnc/xstartup
sed -i ‘s/allowed_users.*/allowed_users=anybody/g’ /etc/X11/Xwrapper.config
chmod +x /etc/init.d/vncserver && service vncserver start
update-rc.d vncserver defaultss
>> Connect from VNC client  [e.g. VNC viewer]
<Machine IP>:5901
>> Restart service whenever not able to connect
/etc/init.d/vncserver restart
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s