Saturday, May 12, 2018

Remote Desktop to AWS GPU instances

If you are looking to run Jupyter notebooks from AWS and leverage their EC2 instances which are compatible for GPU computing then you will invariably try to do a remote desktop connection to their Ubuntu instances using RDP or VNC viewer

1. Install VNC viewer on your windows host
2. On the EC2 GPU instance install the following:

sudo apt-get install ubuntu-gnome-desktop tightvncserver xtightvncviewer tightvnc-java  xfonts-75dpi xfonts-100dpi gnome-panel  metacity light-themes ubuntu-settings indicator-applet-complete gnome-session-flashback indicator-applet-appmenu

sudo locale-gen de_DE.UTF-8 && touch ~/.Xresources && vncpasswd

3. Ensure that the contents of your ~/.vnc/xstartup file look like this below:

################### CONTENTS OF ~/.vnc/xstartup  #######################
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
export XKL_XMODMAP_DISABLE=1
export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME"
export XDG_MENU_PREFIX="gnome-flashback-"
/etc/X11/Xsession


gnome-session --session=gnome-flashback-metacity --disable-acceleration-check &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus --force-desktop --no-default-window

Then you are all set!

-----------------------
When you use tightvnc client on Windows ensure that you enter the IP address of your AWS host with the server instance as suffix. Also ensure that the GPU server instance has the tightvncserver instance started as follows:
$ tightvncserver -geometry 1920x1200