Xpra for Graphical Applications (Linux)

Tags linux xpra

Using a program called Xpra, you can run graphical applications on a remote Linux machine through an SSH connection from all major platforms. In order to do this, you will need to have SSH access to a machine with Xpra installed, as well as the Xpra client installed on your machine.

Please note that many applications may not launch at all, while others may work perfectly out-of-the-box or once launched with certain arguments (e.g. --no-remote --no-xshm for Firefox).

Xpra has many additional features, which can be viewed here: Xpra Features

Installing the Campus VPN Client

Please note that you must have the VPN installed and connected in order to start an SSH connection and use X forwarding to many fully managed Linux systems. Please visit the articles below for information about connecting to the VPN.

XPRA from a Linux Computer

Install Xpra from your distribution’s repositories or from its download page. Xpra is already installed on all fully-managed Linux campus computers.

Once installed, follow the instructions to start and attach to the Xpra session:

  1. SSH into the remote machine and start the Xpra session for the application you are trying to use
    1. To SSH into the machine, run the following command after you connect to the campus VPN. Your username is your Michigan Tech account name if you are trying to connect to an on-domain machine.
      ssh <username>@<hostname>
    2. Choose an application that you would like to use Xpra with. Run the following command to start an Xpra session with the application or command:
      xpra start --exit-with-children --start-child=”<application>”
    3. Exit out of your SSH session using the exit command.
  2. On your local machine, run the following command to attach to the remote machine’s Xpra session
    xpra attach ssh:<username>@<hostname>
    1. You will be prompted to input your password for this machine for the username you provided. Enter in the password into the terminal where you ran the command. Please note that there may be extra information outputted along with this prompt, so look at the bottom of the prompt for the password prompt.
    2. A window should appear with the application that you started on the remote machine.
    3. If you receive an error message that states Error: failed to receive anything, you will need to SSH back into the remote machine and run the xpra stop all command to stop all Xpra sessions (and go through the steps again.

Xpra’s wiki notes that audio forwarding constantly uses CPU and network bandwidth, if you do not require it you may experience better results by disabling it by adding: --pulseaudio=no

See the Windows/macOS instructions below for suggestions on a more convenient way to use Xpra and find applications’ commands.

Xpra from a Windows / macOS Computer

Install Xpra from the Xpra download page.  You may receive warnings due to Xpra not currently being a Windows verified publisher and Xpra moving to https from http rather slowly. Xpra is not currently installed on fully-managed Windows / MacOS campus computers.

  1. SSH to the remote Linux machine and start the Xpra session with the Step 1 instructions from above. The “Start” button on the graphical user interface will not function, and you must perform this step before connecting. Once installed, opening Xpra will bring up a window similar to the one below. Select Connect.Xpra dialog window
  2. Change the dropdown that says “TCP” to say “SSH”. Enter your MTU account name and the remote machine to connect to, and leave the display section blank. The port number should remain 22. Afterwards, type your account’s password into the box labeled “Server Password:” below. After selecting Connect, a progress bar will appear and the machine will take a minute or two to show the graphical window coming from the Linux machine.
    Session launcher
  3. Once you close the window, the Xpra session will automatically close based on the command that was run in Step 1.

Some applications’ commands do not match up perfectly with their names, such as Google Chrome being google-chrome-stable or VSCode being simply code, and others are inconsistent across Linux distributions, such as IntelliJ being either intellij or intellij-idea-ultimate-edition. For more information about the proper names of applications, see the specific documentation pages for each application you would like to run.

Application launch example

 

Print Article

Details

Article ID: 144168
Created
Tue 6/14/22 11:27 AM
Modified
Thu 5/2/24 3:39 PM