Running Ubuntu Desktop GUI (AWS EC2 Instance) on Windows

Apr 27, 2016 · 2 min read

In order to run Ubuntu GUI (hosted on AWS EC2) on your Windows host, follow these instructions to install Ubuntu desktop & TightVNC server on Ubuntu:

[ubuntu] sudo apt-get update
[ubuntu] sudo apt-get install ubuntu-desktop
[ubuntu] sudo apt-get install tightvncserver
[ubuntu] sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

Launch VNC server to create an initial configuration file:

[ubuntu] vncserver :1

Open the configuration file in nano:

[ubuntu] nano ~/.vnc/xstartup

Edit the configuration file to look like this. After you’re done, enter Ctrl + X and ‘Y’ to save it.



[ -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 &

Kill and restart the VNC server to apply the settings. This needs to happen each time the VNC / X-Windows configuration is updated.

[ubuntu] vncserver -kill :1
[ubuntu] vncserver :1

After setting up the VNC server, you need to create an SSH tunnel to it. Open up your PuTTy client which you will be authenticating with your private key. You will need to port forward from your host to VNC server port 5901 with the following settings under “Tunnels”.

Note: Replace with your AWS instance IP address

Remember to add an exception in your AWS Instance Security Group in order for tunneling to work.

Add ‘Custom TCP Rule’ for TCP 5901

If you’re on Windows, download Tight-VNC to install VNC. Connect to localhost::5902 and use the password you gave above. You should now see your new shiny Ubuntu desktop.

TightVNC Welcome Window
Use the password you provided during the installation of VNC server
Ubuntu Desktop on AWS EC2 Instance

Your Ubuntu desktop GUI is now ready!


232 claps

Written by