Configuring and using X2go
- X2go is a remote desktop client-server application very similar to Windows Remote Desktop, allowing full access to a desktop environment (DE) on a remote Windows, Linux, UNIX or Mac computer. Using only ssh as the network transport, it does not require a VPN connection nor does it use any special or additional ports that might be blocked by firewalls or by a broadband ISP's security policies; it just uses the single ssh port which can be either the standard port 22 or some other port that the remote system is using instead, perhaps for security reasons.
Why would I want to use X2go?
- Although X2go can be used with just about any computer system including Windows, these notes are intended mainly for Linux/UNIX users and in particular, for off-campus Mac users wishing to access internal College services that normally require a VPN connection. Windows users already have access to the Remote Desktop Gateway service as well as Windows Remote Desktop/Windows Terminal Services over VPN so are unlikely to benefit as much from using X2go.
- Linux users who are not really very comfortable with using Linux on the command line via a ssh/terminal session will welcome X2go since it brings the remote system's full - and possibly very familiar - graphical Linux desktop environment to the user's local machine, whether that be KDE, gnome, Unity, cinnamon, mate, xfce, lxde or whatever is installed on the remote system. At the same time, experienced users and diehard command line junkies will find the ability to use a browser on a remote machine in College useful to access web-based services on internal networks, web pages whose access is restricted to College network connections only, or to run software that is either not network-aware, or can only interact with 'localhost' via a UNIX socket, for example.
- Mac users - ever since Mac OS X dropped support in OS X 10.2 (Sierra) for the College's primary Microsoft PPTP-based VPN service, VPN access has been a big problem for some Mac users since the alternative OpenVPN-based service offered by the College is often unusable owing to problems external to College caused by broadband provider policies, ISP's port filtering and modem/router/firewall configurations, etc. X2go allows these users to either access their own desktop systems within College without having to use any VPN service or, instead, to access one of the X2go gateways that are being introduced in Maths.
- With the majority of the College now working off-campus, connectivity that works is increasingly very important so X2go is an additional route to internal services. Unfortunately, Android and IoS devices are currently not supported - some initial work was done on both about 6 years ago but it has now petered out owing to lack of demand and in the case of Android, periodic updates to Android had a habit of making older versions of X2go unusable.
X2go gateways in Maths
- X2go facilities have been added to some externally accessible systems in Maths including the systems cfm-ic1.ma.ic.ac.uk and cfm-ic2.ma.ic.ac.uk and more will follow shortly. Please note that for security reasons these two systems use the same non-standard network ports for external ssh/X2go logins as the aachen and cathedral ssh gateways and for obvious reasons these port numbers will not be stated here (if you need to know, ask!) These gateways have a simple LXDE desktop environment which is a reasonable trade-off between user-friendliness and resource consumption when multiple users are using them and both Firefox and Chromium browsers are installed. (If you install an X2go server on your own College desktop system, you can use any desktop environment you like although do remember that some use an awful lot of CPU and bandwidth resources which could be an issue if you have a slow remote network connection).
Installing and configuring X2go
- The X2go client is freely available as an installable package for most modern Linuxes and also for Windows, Macs and UNIX systems. Similarly, the X2go server software can be installed by adding the X2go repository for your chosen Linux distribution or you can build it from source and install it yourself. If you have a desktop PC in College with external ssh access and want to use a rich desktop environment, you can always install the X2go server on your own system - if there is demand, this will be documented separately.
- In the configuration example below, we configure and use the popular Ubuntu Linux desktop edition on a desktop PC or laptop to connect to the cfm-ic2 compute system in Maths. LXDE was chosen as the desktop environment for this server since its resource usage is low compared with Unity, gnome or KDE; cfm-ic2's primary role is as a compute server and if many users started using resource intensive DE's like gnome and KDE, it would soon get bogged down just dishing up a lot of 'eye candy' to these users at the expense of traditional compute users.
- Using the package management system appropriate for your Linux or UNIX distribution, or for your Windows or Mac computer, install the X2go client as described here. For Ubuntu users this is as simple as typing:
- sudo apt-get install x2goclient
and, depending on which desktop environment you are using on your system, this will add a shortcut to the 'Internet' applications group or to your panel (if any). If not, typing x2goclient in a terminal will always start it and you should see the main X2go screen below, ready for you to create your first connection:
- Click on the Session tab and then select New Session ... to bring up the 'New Session' dialog screen shown below.
- You can use any name you like for the Session name but for this example, cfm-ic2 might be a good choice. Leave the Path at the default / setting (this option in conjunction with whatever is put into the Command box is used for starting a specific application when you connect to your remote system, instead of launching the default desktop screen). Now put cfm-ic2.ma.ic.ac.uk into the Host box followed by your college username in the Login box and change the SSH port from its default setting, port 22, to 10022 since this particular system is using the 'obfuscated' ssh port 10022 for external connections coming in from outside the College network. Finally, for the Session type at the bottom left corner of this screesn, select LXDE from the dropdown list. The screen should now look similar to the one below except for the username:
- Completing the Session screen as described above will finalise the basic configuration and allow you to connect to cfm-ic2 right away but it is worth taking the time to configure at least the Connection, Input-Output and Media screens before you connect for the first time. The network speed in the Connection screen defaults to ADSL but most users might want to move the slider to the faster WAN (wide area network) setting if you are using a 'fibre' (sometimes called a Superfast or FTTC/Fibre To The Cabinet connection) or a cable broadband connection; the LAN setting is useful if you are connecting to another system on a fast wired network at home or in college.
- There is a vast range of Compression algorithms to choose from but the default 16m-jpeg setting appears to work well.
- Moving on to the Input/Output tab you will see a number of display-related items. Probably the most important thing here is not to choose a screen resolution greater than the resolution you are currently using on your local machine otherwise panels, etc typically at the bottom of the remote screen will be out of sight off the edge of your screen and inaccessible! If this happens, you can disconnect from the remote system and regain control of your local desktop by pressing the Ctrl+Alt+T keys. For this reason the X2go client defaults to 800x600 which is fairly low by today's standards and therefore results in a smaller remote screen but once you have got the system up & running you can then play around with the resolution and choose what's best for your own setup. Support for dual screens and even 3 or 4 screen setups is good.
- The Media tab allows you to configure forwarding for sound and printing on the remote system to be redirected to your own sound and printing systems. These features have not been tested yet on Maths servers since they lack audio hardware and are not configured for printing (but they will be tested on non-Maths desktop systems soon and reported on here).
- Now click on OK to save all your settings and the completed configuration screen should appear as shown in this example:
- Now you are ready to connect - just click on Hoca (the little furry seal mascot) and the login screen should appear where you can type in your college password:
- Now click on Ok and X2go will initiate the connection; if this is the first time you have connected to cfm-ic2 using X2go, you will be greeted by the standard ssh 'unknown host key' warning so just click on Yes to trust the key presented and proceed:
- All being well and having typed your username and password correctly, you will be connected with a screen like the one shown below. Don't panic! The error dialog 'No session for pid 58891'is appearing since you are connecting to a system (cfm-ic2) that started life as a server not set up as a desktop system, with desktop-style GUI login components retro-fitted at a later date. Clicking on OK will make this error message go away.
- Note: if you decide to install X2go server on your own desktop system you will not see this message since it will have been set up from the beginning as a desktop system.
- The screenshot below shows a remote LXDE desktop on cfm-ic2 being accessed from a Debian Linux system at home that is running the XFCE desktop environment that is popular in the Physics department. Now you can use the remote computer just as if you were sitting in front of it with the keyboard, mouse & screen on the desk in front of you.
- Finally, to illustrate just how agnostic X2go is regarding the operating systems, desktop environments and monitor resolutions of the systems at each end of a X2go session, the screenshot below is from a FreeBSD desktop system using the fvwm2 window manager with dual 27 inch 3840 pixel (4k) monitors side-by-side, using X2go to connect to an OpenSUSE Linux system in College for a Gimp graphical editing session. The very wide (7680 pixel) image spread across two monitors on the local system is heavily compressed here to fit into a reasonably-sized web page, hence the lack of fine detail, but this screenshot serves to emphasise the flexibility of X2go; the desktop environment on the remote OpenSUSE system is IceWM, by the way and is normally viewed in College on a 1600x1200 pixel 20 inch screen.
- Hopefully these introductory notes will be of use to those who need or prefer to use a complete Linux desktop environment instead of using X forwarding to run a single GUI application remotely; you can add additional configurations for other systems and there are many other options available in the X2go client that are not covered here.
Research Computing Manager,
Department of Mathematics
last updated: 30.11.20