Connecting to Linux servers with x2go

X2go is an alternative to "ordinary" X11-connections; it can be used on Windows, Linux og Mac clients.

What is x2go?

X2go enables an X11 session to a remote Linux machine from a local Linux, Windows or Mac machine. It's an alternative to Xwin32 or ssh -X, with some nice features.

  • You can suspend the connection to the remote machine, and bring it back later.
  • X2go is fast (relatively so).
  • X2go uses ssh as a transport mechanism. If ssh works, x2go should work too.
  • X2go is free and open software, so you don't have to mess with license files or arbitrary restrictions.
  • X2go can run "X in a window", similar to remote desktop solutions, as commonly used with Windows servers.

Note: X11 has its own idea about who is server and who is client. In this text, "client" is your local desktop or laptop computer (and the x2go program you run on it); while "server" is the remote machine you are connecting to.

Getting started

Installing the client

If you have a RHEL machine with Geo setup, the x2goclient is probably installed already.

Otherwise, you can ask your IT staff to do it. For RedHat/Fedora:

sudo yum install x2goclient

For Ubuntu-type distros:

sudo apt install x2goclient

For Windows, Mac or other Linux distros, download and install the client from the x2go homepage. (For temporary admin rights for Windows, please contact the IT staff.)

For Mac's, you most likely also will need to install XQuartz.

Defining a session

Start the client, either from the GUI or by giving the command "x2goclient" in a terminal window. Unfortunately, the configuration window looks a bit different for various versions of the client, so you might have to look around a bit for the options.

The client will offer to create a new session configuration:

Type in the following:

  • The Session name, this is just an arbitrary name.
  • The remote machine to connect to, is suggested.
  • Your username on the remote machine.
  • If you have set yourself up with ssh keys, you can check the box for "Try auto login".

For "Session types", this will depend on where you want to connect to:

For RedHat EL 7 servers (wessel), select Custom desktop and type
in /usr/bin/mate-session as "Command":

For RedHat EL 8 servers (pingo, mimi), select XFCE:
For RHEL8: Select XFCE

MATE is a clone of Gnome2, while XFCE is a lightweight desktop environment.

Screen size

Look around in the tabs, you should find a place to choose initial size of the display. 1000x800 is a good start, the size can usually be changed as the session is running.

To toggle fullscreen in a session, hit Ctrl-Alt-F, but you might be better off by simply maximising the x2go session window.


As for keyboard setting, try "Auto-detect" or "Keep current keyboard Settings". If you have an ordinary Norwegian keyboard and the default doesn't work satisfactory, try layout = no and model = pc105/no.

Display DPI

If you plan to use old-type X11 fonts, you may want to select "Set Display DPI" to 100 (dots per inch).


Under the "Connection" tab, you can set connection speed. ADSL seems to work fine.

Please uncheck "Sound support"! It's cool if it works, but it fills up the server logs with nonsense error messages.

Likewise, "Client side printing support" and "Shared folders" may or may not work. This depends (among other things) on your firewall settings.

You can change the "baby seal" image if you want to. Click it and select an image.

Remember to click OK.

Starting a session

You should now have a window similar to this:

Click the grey blob with your newly created session. A new blob will appear in the blue area as x2go tries to start your session. A few things may happen first:

On Windows, you will be prompted to open the firewall. Click cancel, or see below.

You will be asked to accept the server's host key. Do so.

Unless you have a functional ssh key live in the agent, you will be prompted for your password (or the key passphrase).

Then, the session should start. After a few seconds a new window will pop up, and Mate (or XFCE) will be launched in this window. You should be able to find a menu and start terminal windows and other applications on the remote machine. It could eventually look like this (a very tiny desktop):

Back in the local x2goclient window, it should look something like this:

At the bottom there are there buttons (icons).

The circular one to the far right will kill the session. All programs running on the remote machine (in this session) will be killed, and unsaved data will be lost.

The two vertical lines will suspend the session. The programs will continue running, and you can resume the session later – on the same or a different x2go client.

Share a folder. This didn't work for me.

The session can also be terminated by logging out of the remote session (i.e. Mate).

If you check the "show details" box, some text will appear. This can be useful for debugging problems.

Firewall settings (Windows)

Upon first start on a Window machine, the x2go client will open several windows asking for permission to adjust the firewall settings.

This is only necessary if you want to share a folder, play sound, and forward a local printer. If you have administrator rights on the machine you can enable this if you want, but it is not required for an ordinary connection.

You will only be prompted for this once. If you change your mind later on you'll probably have to adjust the firewall settings manually (google that).

Other connection types?

This guide outlines the connection types (Mate/XFCE) I have found most useful and least buggy. But you might want to experiment, or perhaps you have other needs.

For connecting to a RHEL6 server, try Custom desktop and /usr/bin/startkde as command.

I have had limited success with choosing the Mate desktop directly from the menu, so "Custom desktop" is recommended here. A single application (like /usr/bin/xterm) is also possible.

Bugs and limitations

According to the docs, Gnome itself will not work well (or at all).

A few things doesn't work, as already mentioned. Other quirks I have noticed are:

The x2goclient will confusingly prompt you for password after the session is suspended or terminated. Just press cancel.

In Mate, emacs sometimes dies a few seconds after start. I don't know how to fix this. Run emacs in a terminal (emacs -nw), or use some other editor, like pluma.

In KDE (if you use that) there is a bug that prevents emacs from running. A quick workaround is to run "xrdb -load /dev/null" in a terminal, or see this page.

You can't have more than one active session to the same remote host! If you try to start another, you will be reconnected to one that's already running (unless you kill it). If you try this from a different local machine, the new local machine can take over the session from the first (even if it's configured differently on the second machine).

If you start a session on a PC-type local machine, and move it to a Mac (or vice versa), the keyboard settings will probably be messed up.

Sometimes the session will get stuck and unavailable. You might have to kill the session in the session manager, or even ssh in to the remote machine and kill all your x2go-related processes (with something like pkill -u `whoami` x2go).

If the network is flaky (as when you carry your laptop around), the session could become lost.

The upshot of all this: Save your work often, and always before you suspend, terminate or move the session. If your applications support checkpointing, consider using it.

If you find the black XFCE desktop background a tad depressing, you can set a different colour (google rgb.txt to find a list of valid X11 colour names):

xsetroot -solid "Navajo White"

If you find other bugs or useful tips, please let us know!

The server pieces

Unless you are an administrator, you can probably skip this.

The server (ie. remote machine) software is installed with yum, it's in the EPEL repository for RHEL 7 & 8:

yum install x2goserver

There are other x2go server components too, feel free to install them all:

yum list "x2go*"

Install the font package xorg-x11-fonts-100dpi, and why not the 75dpi as well:

yum install xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi

Also, install X11 stuff, KDE and/or MATE:

yum groupinstall x11 mate-desktop  # RHEL7
yum install xfce4-session xfwm4 xfce4-settings # RHEL8
yum install xfce4-about xfce4-datetime-plugin \
  xfce4-panel xfce4-pulseaudio-plugin xfce4-screenshooter \
  xfce4-taskmanager xfce4-systemload-plugin xfce4-terminal\
  xfce4-whiskermenu-plugin  # Still RHEL8
yum groupinstall x11 kde-desktop   # RHEL6

And of course, install whatever applications the users will need. Matlab, firefox, thunderbird, eog, python, etc...

It is possible for a machine (say, a desktop workstation) to be both x2go server and client, but it will easily get confusing. I suggest you avoid that.

By Hans Peter
Published Mar. 9, 2015 4:58 PM - Last modified Aug. 24, 2021 11:13 AM