How To Use XPRA

You can run graphical programs on the RCC Spear servers.

In order to display these programs on your desktop or laptop computer, you need some way to redirect the graphics from Spear to your computer.  XPRA provides a way to remotely display the graphical programs from Spear on your local computer. 

Below we provide instructions for how to download the XPRA client and use it to connect to Spear.

Getting Client Software

The XPRA client software is available for Windows, Mac, and Linux.  You can find it here:
For Windows and Mac, the installation is straightfoward.  Just download, install, and run.
For Linux, you may be able to install using your native package manager (like  dnf or apt).  You may need to add the XPRA repository to your system.  This is dependant on which Linux distribution you are using.  Please see the Linux-specific directions on the download link above.
# Download and install XPRA on Ubuntu/Debian
$ sudo apt install xpra

# Download and install XPRA on Fedora/RedHat/CentOS
$ sudo dnf install xpra

Connecting to SPEAR with XPRA

Setting up an XPRA session on Spear is a 3 part process:
  1. Launch the XPRA server on Spear.
  2. Configure and run the XPRA client on your local computer.
  3. Run graphical programs on Spear, via a terminal and watch them display on your computer.

Let's go over each step in detail:

Launch XPRA Server on Spear

  • Log in to Spear via SSH using a terminal program on your computer. 
  • Run rccxpra at your command prompt on Spear.  You should see output similar to:
[joe@spear-1]$ rccxpra
XPRA started on Display  :2
Commands to attach to this display are:

xpra attach

Windows XPRA Client:
Mode:         [SSH]
[joe] @  []  22 : [2]

Mac OSX XPRA Client:
Mode:  [SSH]
[joe]  @  [] 22 :  [2]

Launch X programs from the terminal window that appears on your XPRA
client.  Or set your DISPLAY variable on this terminal to :2
For example:  export DISPLAY=:2

Configure and run your local XPRA Client

Use the output from the rccxpra command to configure your XPRA client.  For Linux, just cut and paste the command into a new terminal window on your computer (not on Spear). 

For Windows or Mac, use the values provided in the output of rccxpra to set up your client.  Items in square brackets [Like This] show you where to fill in those values on the XPRA client.  See the images below showing the Windows and Mac clients and where to fill in values.

Windows XPRA Client

Windows XPRA Client Configuration

Mac XPRA Client

Mac XPRA Client

What to fill in:

  1. Choose SSH here for the protocol.
  2. Fill in your username.  In the example this is joe .
  3. The hostname goes here.  In our example it's
  4. The display number goes here.  This is 2 in our example.

Notice that all of these values are provided for you in the terminal window where you ran rccxpra.

Once you have the values entered, press the connect button to start the XPRA client and attach to your XPRA session on spear.

Run graphical programs on Spear

Once you run the XPRA client on your computer, you should see a new terminal window appear with the spear prompt in it.  Use this terminal to launch graphical programs on Spear for display on your computer.  For example, you can run matlab or gedit.

Cleaning Up Your XPRA Session

After you're finished using programs on Spear and you don't need XPRA any more, you should clean up so that your XPRA session does not continue to use resources on the system.

Disconnect your XPRA client and XPRA on Spear will clean itself up:

  • On Linux, press Control-C in the terminal window where you ran the xpra attach command.
  • On Windows or Mac, click on the XPRA client icon and select disconnect or quit.

If you want to be extra sure that your client is disconnected, go to your Spear terminal window and type:

$ xpra stop

That will cleanly shut down your XPRA session.