apt-get install tightvncserver
vncserver :1
#!/bin/sh
# The username VNC will run as
export USER="joeblow"
# The display that VNC will use
DISPLAY="1"
# Color depth (value between 8 and 32)
DEPTH="16"
# The Desktop geometry to use.
#GEOMETRY="x"
GEOMETRY="1024x768"
# The name that the VNC Desktop will have.
NAME="vnc-server-1"
OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
case "$1" in
start)
echo "Starting vncserver as user '${USER}' on :${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
stop)
echo "Stoping vncserver as user '${USER}' on :${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 [start|stop|restart]"
exit 2
esac
exit 0
|
chmod +x /etc/scripts/vnc-server
/etc/scripts/vnc-server start
No questions yet.