Connect to Ubuntu 20.04 Remote Desktop using X2Go

Linux servers are cheap and more secure than Windows servers, then why aren’t they popular with some Windows users?

I’ll give you one word: GUI (Graphical User Interface).

The basic problem with the

Linux

servers is that they don’t come with a pre-installed GUI (Graphical User Interface). This makes Windows servers the top choice for remote desktop connections.

To run GUI applications, you may have tried VNC (Virtual Network Computing) or xRDP to remotely connect with your Ubuntu server just to realize that it’s not the smooth computing experience you came for!

A great alternative to the typical VNC network is X2Go.

In this article, we’ll discuss the step-by-step process of connecting to an Ubuntu 20.04 remote desktop using X2Go. We’ll also explain why X2Go is a much better option compared to other remote desktop solutions like VNC.

What is X2Go?

X2Go is a remote desktop solution that lets you connect with another computer and control it remotely. A few keys features of X2Go are:

  • It supports all operating systems including, Linux, Ubuntu, Windows, CentOS, Fedora, and Mac OS.
  • It supports voice transmission to the connected systems.
  • Multiple users and individual desktop sessions can connect with a single X2Go server at the same time.
  • It provides a smooth experience even over low bandwidth.

When and How is X2Go Helpful?

X2Go can prove to be useful in a variety of scenarios:

  • You need to access a Linux-based operating system such as Ubuntu complete with a desktop environment and can’t install it locally.
  • You need more resources than your personal computer can provide. For instance, you want to compile a file that’ll take hours making your PC unavailable for long periods of time. Running it on a remote desktop will leave your PC to do whatever you want!
  • You want your team to be able to access the resources and benefit from a common computer.
  • You want to use the same desktop environment with the same setup, tools, file, and performance from anywhere in the world.

Prerequisites

Before setting up X2Go we recommend you have:

  • A server running Ubuntu 20.04 with at least 2GB RAM.
  • A user with
    sudo privileges

    and SSH key (you can either use SSH keys or set up a password). We recommend a non-root sudo user instead of acting as root. This is because when you’re loggen in as root you can do everything and the system won’t ask, so you won’t get to think twice. You could mistakenly run a command that would destroy your system and you’ll wish that the system asked you if you’re sure so you could’ve thought twice.

So, let’s begin.

Step 1 – Install X2Go on the Server

The first step is to install X2Go on the server. X2Go basically comes with two components:

  1. Server: start and manages the graphical session on the remote computer
  2. Client: installed on your local computer to view and control the remote desktop

To install the X2Go server on Ubuntu 20.04, you’ll need to add the X2Go PPA (Personal Package Archive) repository for Ubuntu first. Your server may not have the add-apt-repository command available. To fix that, run the following command:

sudo apt install software-properties-common

Next, add the X2Go’s PPA:

sudo add-apt-repository ppa:x2go/stable

Now, update the software package database:

sudo apt update

Finally you can install the X2Go server:

sudo apt install x2goserver x2goserver-xsession

During the installation you’ll be asked to select your preferred Language and Keyboard Layout. Input the number corresponding to your preference and hit ENTER when you’re prompted to do so.

Step 2 – Install Your Preferred Desktop Environment

In this tutorial, we’ll be installing the XFCE, LXDE and MATE minimal desktop environments for X2Go.

XFCE doesn’t use fancy graphical effects like composting which makes it light-weight, hence more compatible with X2Go. LXDE and MATE also work well with composting disabled.

Minimal Desktop Environment

The minimal desktop environment is used if you want to utilize fewer resources. In minimal desktop environments, we install a small, core set of packages and add whatever is needed as we go.

Installing XFCE

To install XFCE run:

sudo apt install xfce4

How XFCE looks like:
XFCE Session - X2Go

Installing LXDE

To install LXDE run:

sudo apt install lxde

How LXDE looks like:
LXDE Session - X2Go

Installing MATE

To install MATE run:

sudo apt install mate-core mate-desktop-environment mate-notification-daemon

How MATE looks like:
MATE Session - X2Go

Installing KDE Plasma

To install KDE Plasma Desktop first add the Kubuntu PPA repository to your system:

sudo add-apt-repository ppa:kubuntu-ppa/backports

Press

[ENTER]

when prompted to continue.

To install the minimal version of KDE Plasma run:

sudo apt install kde-plasma-desktop

To install the full KDE Plasma Desktop environment run:

sudo apt install kubuntu-desktop

Press

Y

and

Enter

when prompted to proceed with the installation.

Choose the one that you prefer out of gmd3, lightdm or sddm.

Fix KDE Plasma Install Issue: error: unable to execute: startkde

After the installation is finished we have one last thing to do. At the time of writing, X2Go tries to run the /usr/bin/startkde command when launching a KDE session. But in Kubuntu 20.04 there is no startkde command, and it has been replaced by startplasma-x11, and X2Go returns

error: unable to execute: startkde

when we try to connect.

We can solve this in 2 ways. We’re mentioning both just in case it’s useful to someone, but you can choose whichever solution you prefer.

  1. The first solution is to configure the session in the X2Go client.Instead of selecting Session type: KDE, select Session type: Custom desktop and next to it, in the Command field, fill in
    /usr/bin/startplasma-x11

    .

    Custom desktop - startplasma-x11

  2. The second solution is to is create a symbolic link from
    /usr/bin/startkde

    to

    /usr/bin/startplasma-x11

    . To do this run the command:

    sudo ln -s /usr/bin/startplasma-x11 /usr/bin/startkde

    When you connect using the second solution set the session to have Session type: KDE.

    Session type: KDE

How KDE Plasma looks like:
KDE Session - X2Go

Installing GNOME (Doesn’t work with X2Go)

If you’d still like to install GNOME on Ubuntu 20.04, run the following command:

sudo apt install gnome-session gdm3

Step 3 – Install X2Go Client Locally

Once the desktop environments have been installed, the next step is to download the X2Go client for your chosen OS.

Install the X2Go Client on Windows

To install X2Go client on Windows, go to https://wiki.x2go.org/doku.php and download the Windows Installer.

Once you’ve installed the X2Go client on your Windows machine, open the installer and select your preferred language, agree to the terms and conditions, and the install wizard will guide you through the rest of the process. In nearly all cases, we go with the default settings.

Install the X2Go Client Debian/Ubuntu

You can install X2Go client on Ubuntu and Debian by running:

sudo apt install x2goclient

Install the X2Go Client CentOS/RHEL

To install X2Go client on the CentOS, run the following command:

sudo yum install x2go client

Install the X2Go Client Fedora 22

X2Go client is a part of Fedora 19 and the later versions. You can install it with a software installer or the following command:

sudo yum install x2go client

Install the X2Go Client on OSX

For Mac OS, find Mac OS 10.xx and higher DMG and download the X2Go client according to your Mac OS version from the X2Go website.

Now that the X2Go client has been installed, all you need to do is to configure the settings and connect the X2Go server to your remote desktop.

Step 4 – Connecting to the Remote Desktop

With the desktop environment in place and the X2Go server and client installed, you can run the X2Go client on your machine.

The first time you run X2Go you’ll be prompted with a dialogue to configure a

new session

.

If the window doesn’t open automatically, then locate the Session tab on the upper left side of the screen and click on it. Then go to Session -> New session to open the session dialogue to configure a new session.

Configuring a New Session

Sessions are basically connection configurations, and you can have one for each server you want to connect to.

In this tutorial we’ll fill in the minimal information required to connect. Also we’ll use password authentication, and not SSH-Key Based Authentication.

X2Go Ubuntu 20.04 New Session Configuration

Session name: The name of your session should be unique so you can easily tell different servers apart.
Host: your server’s IP address or hostname goes here.
Login: enter the username you used with your SSH connection.
SSH port: The default port number is 22. You can change it as per your SSH config file settings (/etc/ssh/sshd_config).
RSA/DSA Key: It’s optional to use RSA/DSA keys. To use a private key, click on the folder next to the ‘Use RSA/DSA key for ssh connections’ and browse to your private key. You can leave it blank if you didn’t opt to use the secure SSH keys, in which case, X2Go client will ask for a password each time you log in.
Session type: select your desktop environment (for e.g. XFCE) in the dropdown.

Disable Client-side printing support

By default the session is configured to enable X2Go Client-Side printing. For the purpose of this tutorial we’ll disable it, because we may get a warning if it’s left enabled. If you’d like to know more about this feature, then you can read more about it here X2Go Documentation — X2Go Client-Side Printing.

To disable client-side printing go into the Media tab, and uncheck Client-side printing support.

Client-Side Printing X2Go

You can leave the rest of the settings to default until you get more familiar with the software. Click OK to save the session.

To start the session, click on the white box that’s labeled with your session name on the top-right side of the screen.

X2Go Select Session

You’ll then be prompted to fill in your username and password, with your username already filled in.

Fill them in and click

Connect

. Your remote desktop will show up in a few seconds and you can interact with it.

How to End the Remote Session?

There are two ways you can end a remote session:

  1. Log off
  2. Click the button marked with a circle and a small line (similar to the standby/power button) at the bottom-right corner of the main X2Go screen.

The first method is quick and clean but there’s a catch! It leaves applications like the session management software running. The second method closes everything (even forcefully) if it doesn’t close directly. In either case, I recommend saving everything before exiting.

Conclusion

Congratulations! You’ve successfully connected with Ubuntu 20.04 using X2Go. Now you have a working Remote Desktop which will always be online! Let us know if it helped and your experience with X2Go!

Close Menu