Skip to content

Instantly share code, notes, and snippets.

@kripul
Last active February 28, 2018 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kripul/5e34cd84f0591f3d13208c11ac9197a8 to your computer and use it in GitHub Desktop.
Save kripul/5e34cd84f0591f3d13208c11ac9197a8 to your computer and use it in GitHub Desktop.
ubuntuvnc.sh
#!/bin/bash
DEBIAN_FRONTEND=noninteractive sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get upgrade -y
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal unzip -y
DEBIAN_FRONTEND=noninteractive sudo apt-get install ubuntu-restricted-extras -y
DEBIAN_FRONTEND=noninteractive sudo apt-get install vnc4server -y
vncserver :1
vncserver -kill :1
cat > .vnc/xstartup <<END
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
END
vncserver :1
cat <(crontab -l) <(echo "@reboot /usr/bin/vncserver :1") | crontab -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment