Skip to content

Instantly share code, notes, and snippets.

@MohamedKari
Last active November 22, 2020 12:35
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 MohamedKari/9d3982f70849f273d51a3c86126ddb41 to your computer and use it in GitHub Desktop.
Save MohamedKari/9d3982f70849f273d51a3c86126ddb41 to your computer and use it in GitHub Desktop.
Setup VNC on EC2
# bash <(curl -s https://gist.githubusercontent.com/MohamedKari/9d3982f70849f273d51a3c86126ddb41/raw/c827f74257f847f352b1f489fc970381cec626db)
sudo apt -y update
sudo apt -y install ubuntu-desktop
sudo apt -y install tightvncserver
sudo apt -y install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
mkdir -p ~/.vnc
cat <<EOF > ~/.vnc/xstartup
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
EOF
chmod +x ~/.vnc/xstartup
sudo reboot
# vncserver -geometry 1600x1200 :1
# vncserver -kill :1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment