Skip to content

Instantly share code, notes, and snippets.

@MohamedKari
Last active Nov 22, 2020
Embed
What would you like to do?
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