Last active
August 29, 2015 14:15
-
-
Save oeeckhoutte/9e30fb554a81cfa9c0eb to your computer and use it in GitHub Desktop.
[Ubuntu 14,04 Gnome] Setup VNC server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install tightvncserver | |
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak | |
vi ~/.vnc/xstartup | |
----- Enter -- | |
#!/bin/sh | |
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup | |
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources | |
xsetroot -solid grey | |
vncconfig -iconic & | |
x-window-manager & | |
gnome-panel & | |
gnome-settings-daemon & | |
metacity & | |
nautilus -n & | |
gnome-terminal & | |
-------------- | |
sudo chmod +x ~/.vnc/xstartup | |
sudo vi /etc/init.d/vncserver | |
-------- Enter ---- | |
#!/bin/bash | |
PATH="$PATH:/usr/bin/" | |
export USER="olivier" | |
DISPLAY="1" | |
DEPTH="16" | |
GEOMETRY="1280x768" | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment