Ubuntu TightVNC Server
This guide intends to show you how to build a headless server with tightvnc, such that you can remotely access the server’s gui using any vnc client. I’m still working on it, so if you have any comments or questions, please feel free to let me know.
Type:
sudo apt-get install tightvncserver
Then create and edit: /etc/init.d/vncserver in your favorite text editor. Copy and base the contents between the ——, then modify the variables up top as necessary.
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: networking
# Default-Start: S
# Default-Stop: 0 6
### END INIT INFOPATH=”$PATH:/usr/X11R6/bin/”
# The Username:Group that will run VNC
export USER=”username”
#${RUNAS}# The display that VNC will use
DISPLAY=”1″# Color depth (between 8 and 32)
DEPTH=”16″# The Desktop geometry to use.
#GEOMETRY=”x ”
#GEOMETRY=”800×600″
GEOMETRY=”1024×768″
#GEOMETRY=”1280×1024″# The name that the VNC Desktop will have.
NAME=”desktopname”OPTIONS=”-name ${NAME} -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)
echo “need to implement”
;;
esacexit 0
Save the file and make sure the permissions are as follows:
-rwxr-xr-x 1 root root
Update your rc.d by running:
update-rc.d vncserver defaults
Reboot and you should be good to go.