In the following article we will explain how to set up an X2Go Thin Client environment. In the following we will use three technical terms that we want to define/explain before we start:
x2goclient
software. X2Go servers can be situated in the LAN (local area network) or WAN (wide area network, i.e. the internet).x2goclient
software and provide access to one (or more) X2Go Server(s).x2goserver
package is available for the server's distro). The boot environment for the X2Go PXE Server has been developed on Debian GNU/Linux and also been tested on Ubuntu GNU/Linux. The X2Go Thin Client chroot can be configured to use Ubuntu GNU/Linux, but it is highly recommended to leave the defaults and use Debian GNU/Linux for creating the X2Go TCE chroot.
X2Go TCE requires a local area network (LAN) that is at least switched at 100MB/s. The X2Go Thin Client chroot distribution is not designed to work over the internet or on low bandwidth connections, but the X2Go Thin Client can possibly give access to X2Go servers outside of your LAN infrastructure that is: X2Go Thin Clients can be used to work on X2Go servers on the WAN (e.g. on the internet, in a public cloud, etc.).
You can combine X2Go Server and X2Go PXE Server functionality on one system. However, for production setups we highly recommend that you dedicate a separate server as the PXE boot server for the X2Go TCE. If you have the chance of splitting these two functionalities up into two, this is a recommended way of setting up your X2Go Thin Client Environment.
A normal/recommended setup for testing/deploying X2Go TCE then is:
packages.x2go.org
. The latest test against Debian jessie have been performed around Nov 2013.
In the following description we will describe a simple X2Go TCE installation, using two separate hosts as X2Go Server and X2Go PXE Server. The explanation presumes that you either install on Debian GNU/Linux or Ubuntu GNU/Linux. If you (for testing purposes) use the same machine as X2Go Server and X2Go PXE Server, please perform described steps for either of the machines on the same system.
The resulting X2Go Thin Client chroot will be a Debian GNU/Linux (bullseye) system by default.
Before you continue!
Please make sure that you have added the X2Go repository to your package management system (on X2Go server and on X2Go PXE server). The required steps are described here (Debian) and here (Ubuntu).
The X2Go Server installation is described in detail on this wiki page. Please follow instructions there first, then proceed below.
In a nutshell, you have to run the following commands from a terminal on the X2Go PXE Server (or X2Go Server if combining both systems in one):
$ sudo aptitude install x2gothinclientmanagement # take a look at the X2Go TCE config and modify to your needs $ sudo editor /etc/x2go/x2gothinclient_settings $ sudo x2gothinclient_create # now you have to wait for some time, a lot of text will pass through your terminal window $ sudo x2gothinclient_preptftpboot # follow the instructions being shown at the end of the x2gothinclient_preptftpboot script run...
Now a bit more in detail…
x2gothinclientmanagement
package.$ sudo aptitude install x2gothinclientmanagement
The installation will pull in some other required packages onto your system, please confirm with Yes, to start the installation.
x2gothinclientmanagement
package (and required dependencies), please edit/introspect the following file with your favourite editor:$ sudo editor /etc/x2go/x2gothinclient_settings
and apply changes required for your local site setup to the X2Go TCE configuration.
$ sudo x2gothinclient_create
/opt/x2gothinclient/chroot
) you will find a complete and minimal X2Go TCE GNU/Linux system at the aforenamed chroot location./opt/x2gothinclient/etc/
:x2gothinclient_init
: No customizations should be necessary for this file. Modify at your own risk… If a modification is necessary here, please report it as a bug/enhancement to the X2Go developers.x2gothinclient_start
: This file is responsible for actually launching x2goclient
as a login manager on your thin client. The default setting is to start in non-LDAP mode. In non-LDAP mode the x2gothinclient_sessions
file contains the thin clients' list of available X2Go session profiles. For LDAP mode there is a commented out stanza that shows possible LDAP options to pass on to the x2goclient
application. Note: If you edit this file, please make sure that all applications you call from this file are sent to background with the ampersand (»&«) operator, e.g.: x2goclient <options> &
x2gothinclient_sessions
: This file contains a list of session profile configurations for your thin clients' x2goclient
(running in non-LDAP logon manager mode). Surely, you can edit/customize the examplary session profiles file that comes with the x2gothinclientmanagement
package in your favourite text editor. — However, you can also use the x2goclient
application on your local (GNU/Linux) computer to create a set of session profiles for your X2Go Thin Client. Start x2goclient
locally, create a set of session profiles and then copy your local x2goclient
session profile configuration to the X2Go PXE server:$ scp ~/.x2goclient/sessions root@<pxeserver.hostname.domain>:/opt/x2gothinclient/etc/x2gothinclient_sessions
x2gothinclient_update
script. This script will incorporate your changes applied the /opt/x2gothinclient/etc/x2gothinclient_*
files into the X2Go Thin Clients' chroot environment. Whenever you customize anything in /opt/x2gothinclient/etc/
make sure your run the update command:$ sudo x2gothinclient_update
With this last step your X2Go Thin Client's chroot environment is basically ready for being booted. The last step, however, is to configure the PXE boot manager itself (PXE, TFTP).
Debian does not ship so-called non-free firmware in its main package archive area. However, several network cards (and other TCE relevant devices) require the installation of a firmware package from Debian non-free.
Run the command x2gothinclient_shell
and edit /etc/apt/sources.list
in your TCE chroot (nano, vim and mcedit should be installed in your TCE chroot):
deb http://ftp.debian.org/debian <distro-codename> main contrib non-free
Then run (in your X2Go TCE chroot):
$ apt-get update $ apt-get install firmware-linux-nonfree firmware-bnx2 firmware-bnx2x firmware-myricom firmware-netxen firmware-qlogic firmware-ralink firmware-realtek intel-microcode amd64-microcode
If this command fails, please check if packages have been removed from your Debian version or if they are not yet available for your version. Also scan for other firmware packages:
$ apt-cache search firmware
Also, there is a fine tool that you can run on normal Linux systems that helps with the package installation for several special hardware devices: Isenkram by Petter Reinholdtsen from the Debian Edu team.
With the x2gothinclient_preptftpboot
script you can simply set up a PXE boot environment using the syslinux
package. Please take a look at the /etc/x2go/x2gothinclient_settings
configuration file for customization first, then run this script:
$ x2gothinclient_preptftpboot
If there already is a PXE boot environment installed at the configured location, the script will abort with a warning. If you want to combine X2Go PXE with other boot environments (e.g. LTSP), please customize your system manually. Templates for X2Go PXE can be found at /usr/share/x2go/tce/tftpboot
.
Note: At the end of the x2gothinclient_preptftpboot
script some further instructions (DHCP setup, NFS setup, etc.) of final configuration steps will be shown. Please follow these last steps to complete your X2Go TCE setup.
You should now be able to start your office PCs as X2Go Thin Clients. To do this, configure the computer's BIOS to boot via network (PXE, Etherboot). You will know that you setup has been successful, if a boot menu appears on your computer's screen that shows the X2GO banner that also appears when starting X2Go sessions.
It is also possible to test the X2Go TCE in qemu. Read the documentation shipped with the X2Go TCE sources.
To get rid of all files related to X2Go TCE, please run this script:
$ x2gothinclient_cleanup
If you already have an DHCP server in your network, please make sure that you are able to setup an own range of IP addresses for the boot environment. Because of the conflict between devices that should access the boot environment and normal network nodes (MAC address binding), it is much easier to setup a separate network sub-LAN (in the example below: 192.168.0.0/24) for your thin client systems:
$ sudo editor /etc/dhcp3/dhcpd.conf
option domain-name "<your-localdomain.org>"; option domain-name-servers <ip-of-dns-server>; # x2go thin client range/group subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.199; filename "/pxelinux.0"; next-server 192.168.0.250; }
Restart the DHCPD server to apply the new configuration:
# /etc/init.d/dhcp3-server restart
The root file system of the boot environment is mounted using NFSv3 (so it can be accessed over the network). You'll need to export the needed directory by editing the NFS configuration file:
$ sudo editor /etc/exports
/opt/x2gothinclient/chroot 192.168.0.0/24(ro,async,no_root_squash)
Finally restart the NFS daemon:
$ sudo /etc/init.d/nfs-kernel-server restart
Please feel free to customize the command line options used by the x2goclient
running in display manager mode. For example you can enable LDAP mode:
$ editor /opt/x2gothinclient/etc/x2gothinclient_start
The below example uses LDAP-mode for x2goclient
:
x2goclient --pgp-card \ --ldap="192.168.1.1:389:dc=<domain>,dc=<tld>" \ --external-login=~x2gothinclient/logins \ --no-menu \ --maximize \ --thinclient \ --haltbt \ --link=lan \ --kbd-layout=us \ --kbd-type=pc105/us \ --set-kbd=1 \ --geometry=fullscreen \ --read-exports-from=~x2gothinclient/export \ --add-to-known-hosts &
After modifying the x2gothinclient_start
file, update the X2Go Thin Client configuration:
$ x2gothinclient_update
Please feel free to customize the command line options used by the x2goclient
running in display manager mode. For example you can enable LDAP mode:
$ editor /opt/x2gothinclient/etc/x2gothinclient_start
The below example uses LDAP-mode for x2goclient
:
x2goclient --pgp-card \ --broker-url=https://<broker-server>:<port>/plain/<backend> \ --broker-cacertfile=<path-to-your-self-signed-rootca-file> --external-login=~x2gothinclient/logins \ --no-menu \ --maximize \ --thinclient \ --haltbt \ --link=lan \ --kbd-layout=us \ --kbd-type=pc105/us \ --set-kbd=1 \ --geometry=fullscreen \ --read-exports-from=~x2gothinclient/export \ --add-to-known-hosts &
After modifying the x2gothinclient_start
file, update the X2Go Thin Client configuration:
$ x2gothinclient_update
The Debian GNU/Linux X2Go TCE uses non-LDAP mode as default. Edit the default sessions file in /opt/x2gothinclient/etc/x2gothinclient_sessions
.
There are two extra commandline arguments that you should be aware in the below configuration.
–no-session-edit
will deny any manipulation of the session by the user.–session=“X2Go.EXAMPLE
needs to be identical to the name inside the X2Go session file.x2goclient --no-session-edit \ --session="X2Go.EXAMPLE" \ --pgp-card \ --external-login=~x2gothinclient/logins \ --no-menu \ --maximize \ --thinclient \ --haltbt \ --link=lan \ --kbd-layout=us \ --kbd-type=pc105/us \ --set-kbd=1 \ --geometry=fullscreen \ --read-exports-from=~x2gothinclient/export \ --add-to-known-hosts &
After modifying the x2gothinclient_start
file, update the X2Go Thin Client configuration:
$ x2gothinclient_update