UKCA Chemistry and Aerosol Tutorials: Configuring X2Go for AWS


UKCA Chemistry and Aerosol Tutorials at UMvn13.0

For instructions on using the VMs on the JASMIN Unmanaged Cloud please see here.

Difficulty EASY
Time to Complete Under 1 hour
Video instructions

To use the UKCA Tutorials on AWS you first need to download and install X2Go client. This is available for Windows, macOS, and GNU/Linux.

You will be provided with connection details to your personal VM and the required SSH key file that you will need.

Note that the username on these VMs will be ubuntu and you will be provided a unique IP address to use to connect to the VM (labelled as YOUR.ASSIGNED.IP.ADDRESS below).

If you are unable to use X2Go, you can also connect via a Terminal on GNU/Linux & macOS, and via MobaXTerm on Windows.

SSH key file

Before you set up X2Go, you need to be sure that your SSH-key file is in the correct format. There will be a single text file, which look like:

  • ukca_key_trXX.pem: This is your private key and you should not share this file with anyone. It is this file that you need to use to connect using X2Go, MobaXTerm, or SSH. It will have a large block of random text in between the following lines:


Setting up X2Go

When first starting X2Go, you should be presented with a new session dialog box to complete. If this doesn't appear, press the "New Session" button (which looks like a piece of paper with a star on it). Once this is open, fill in the details below.

When setting up an X2Go session, the exact value of “session name” is not important. The key details are the settings under “server” and “proxy server”. You will also need to set the “session type” to LXDE.

Option Setting
Session name e.g. ubuntu@ukca_vm_trXX
Login ubuntu
Use RSA/DSA key for ssh connection The path to your ukca_key_trXX.pem key file (navigate via button)
Session type Select LXDE from drop-down menu

Note: On macOS you may need to maximise the Session Preferences window (using the green + marker in the top left corner) to allow you to set the session type and press the OK button, as this panel is quite long and these buttons will then become lost below the screen.

When you have completed everything, press OK. The first time you connect you will be asked if you which to accept the host key. Click yes. Once you have set the preferences you should get a grey box representing your session, e.g.

X2Go session box AWS.png

You should double-click at the top of the box (i.e. over the session name or on the icon) to start the connection. If you have closed a session down but left X2Go running you may instead see a grey box with the login field as ubuntu and the password field blank - to connect in this case just press OK.

When you connect to your VM using X2Go you will be presented with an open Linux terminal which is asking for your MOSRS password. Once you have entered it, the first time you login you will also be asked for your MOSRS username. Subsequently, you will just be asked for your MOSRS password.

When you have finished for the day you can close the connection by closing the X2Go window using the X in the corner. When you reconnect you will find the windows exactly as you left them. You can also resize the X2Go window using the maximize button or by dragging the corners with your mouse.


You may find that you cannot copy and paste between your personal computer and the VM.

  • On Windows you should follow these instructions:
    • Open X2GO Client application
    • Click "Options" menu --> Settings
    • Select "X. Org Server Settings" tab
    • Select "do not use primary clipboard" (make sure its checked)
    • Click OK
    • Restart your X2Go client
  • On macOS you will need to follow these instructions:
    • In a Terminal, enter the following command
echo "*VT100.translations: #override Meta <KeyPress> V: insert-selection(PRIMARY, CUT_BUFFER0) \n" > ~/.Xdefaults

Virtual Machine Environment

You will be using X2Go to connect to a Virtual Machine (VM) hosted on the AWS cloud, which has been specially set-up to be able to run the UKCA Tutorials. All the relevant files and settings have already been installed, all you need to do is to enter your MOSRS credentials when you first connect, and then cache your MOSRS password once a day or in a new terminal as required.

The VM you are connecting to uses the Ubuntu 18.04 operating system, with the LXDE desktop. While you have access to the full desktop, you should be comfortable using a GNU/Linux operating system, including using and navigating around using a terminal. You should also be familiar with programming, ideally Fortran.

MOSRS Password

You will need to enter your MOSRS password each day, and for each terminal that you open on the VM when using X2Go that you wish to commit changes or run suites from.

If you leave your terminal open overnight, in the morning you should use the command


to cache your password for the day.

If you do not do this each morning you may get some strange errors when committing changes or when running suites.

Connecting via a Terminal (GNU/Linux & macOS)

It is also possible to connect via a terminal with an X11 connection (XQuartz is also required when using macOS). The command to use in this case would be

ssh -X -i /path/to/ukca_key_trXX.pem ubuntu@YOUR.ASSIGNED.IP.ADDRESS

where /path/to/ukca_key_trXX.pem is the full path to your SSH private key file.

It is also possible to define a .ssh/config file entry with the necessary information if desired:

Host ukca_vm_trXX
       User ubuntu
       IdentityFile /path/to/ukca_key_trXX.pem

so that you could then just connect using the command

ssh -X ukca_vm_trXX

When you connect via a terminal you won't have a full desktop environment - you will need to navigate around the VM from the command line in the usual way.

If you have any issues authenticating to MOSRS or using Rose you could also try using -Y instead of -X.

Connecting via a MobaXTerm (Windows)

If you are unable to use X2Go, it is also possible to connect from Windows via a Terminal client such as MobaXTerm

To get started, you should click on Session and then SSH to create a new SSH session with the following equivalent settings:

Option Setting
Basic SSH settings (top row)
Specify username Tick checkbox
Advanced SSH settings Tab
X11 forwarding Ensure that the checkbox is ticked (default)
Use private key Tick checkbox
The path to your ukca_key_trXX.pem key file (navigate via button)
Advanced SSH settings Tab - optional choices
Remote environment (drop-down menu) Interactive shell to connect via the MobaXTerm terminal
LXDE to connect with a grahpical environment

Once you have connected you will need to navigate around and open files using terminal commands.

Copying data back

If you are using a GNU/Linux or macOS system and you have set up the .ssh/config file as above, you can pull data from the VMs using the following recommended rsync command, e.g.

rsync -auvv .

where is a file in your home/ directory to your current working directory on your local system. To copy from other directories you could use the command, e.g.

rsync -auvv ukca_vm_trXX:/home/ubuntu/cylc-run/SUITE-ID/work/1/atmos/atmosa.pa19810901_00 .

The following longer command also works:

rsync -auvv -e "ssh -i /path/to/ukca_key_trXX.pem" .

where /path/to/ukca_key_trXX.pem above means the full path to your SSH private key file, e.g. /Users/luke/ukca_key_tr01.pem etc.

You can also copy directories in a similar way, e.g.

rsync -auvv -e "ssh -i /path/to/ukca_key_trXX.pem" ubuntu@YOUR.ASSIGNED.IP.ADDRESS:/home/ubuntu/roses .

You could also use Firefox to log-in to your e-mail and e-mail the files to yourself, or log-in to a Cloud service, such as Google Drive and Dropbox, and upload the files there directly.

Make sure you fcm commit your suite(s) and branch(es) - this will allow you to use these later on a personal VM, although note that the paths within the suites will need to be changed later, as the username will be vagrant when using the Met Office Virtual Machine.

Further Information

For further information on how these VMs are set-up and run on AWS, please see the following GitHub repository containing all the scripts and instructions used to generate the environment.

Written by Luke Abraham 2022.