Remote Desktop (VNC) in a batch job

Creating a VNC server inside a batch job

Available queues: general_gpu_k40, general_gpu_k80

The preferred method is to start an interactive job on a GPU node and then once your job starts, you can start the VNC server.

On Mac, you will need the TurboVNC Viewer client (https://sourceforge.net/projects/turbovnc/)

On Windows, you will need the TurboVNC Viewer client (https://sourceforge.net/projects/turbovnc/) and PuTTY (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)

Starting the VNC server

First, load the TurboVNC and VirtualGL modules:

module load turbovnc

module load virtualgl

Next, submit an interactive job to the cluster by using the salloc command and specifying one of the available GPU queues (general_gpu_k40 or general_gpu_k80):


salloc --partition=general_gpu_k80 srun --pty /bin/bash

Once you are granted the job allocation, start your VNC server:

vncserver

On the first time that you run the vncserver command, you will be prompted to enter a VNC password to secure your VNC session. This password can be set to any strong password as desired.

The output of the vncserver command is important: it tells you where to point your client to access your desktop in format hostName:displayNumber

Desktop 'TurboVNC: ssrde-c-408:1 (sscf-silas)' started on display ssrde-c-408:1

In this above example, the hostName is ssrde-c-408 and the displayNumber is 1

Because the compute nodes of our cluster is not directly accessible, you must log in to the headnode (SSRDE) and allow your VNC client to "tunnel" through SSH to the compute node. We will use the obtained hostName and port number (5900 + displayNumber) to create the SSH tunnel.

Creating an SSH tunnel

On Mac, use Terminal to create the SSH tunnel by following this format:

ssh -L <port>:<hostName>.ucsd.edu:<port> <username>@ssrde.ucsd.edu

Using the above example, the command would be:

ssh -L 5901:ssrde-c-408.ucsd.edu:5901 sscf-silas@ssrde.ucsd.edu

On Windows, open PuTTY. For hostname, enter: ssrde.ucsd.edu

Navigate to Connection->SSH->Tunnels

Source port: <port>

Destination: <hostName>.ucsd.edu:<port>

Using the above example, the source port would be 5901 and the destination would be ssrde-c-408.ucsd.edu:5901

Connecting to VNC desktop session

Open the TurboVNC Viewer client, and connect to localhost:<displayNumber>, which will tunnel to the correct node on the SSRDE cluster. The TurboVNC viewer client will prompt you for your VNC password.