This is an old revision of the document!
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
.
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 (squeeze) or Ubuntu GNU/Linux (lucid/maverick). 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 (squeeze) 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: adding the X2go repository (Debian) or alternatively: adding the X2go repository (Ubuntu).
The X2go Server installation is described in detail on this wiki page. Please follow instructions there first, then proceed below.
Basically you have to install the x2goserver
package and your preferred desktop environments (e.g. GNOME, KDE4):
$ apt-get install x2goserver gnome-desktop-environment kde-plasma-desktop
x2go-keyring
installed first.x2gothinclientmanagement
. Please, install this package by typing the first line shown below (the rest is the command's output that will be seen after pressing enter): $ apt-get install x2gothinclientmanagement Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: atftpd debootstrap inetutils-inetd libcrypt-passwdmd5-perl libdigest-sha1-perl libfile-copy-recursive-perl nfs-kernel-server syslinux syslinux-common update-inetd Suggested packages: dosfstools mtools dhcp3-server dnsmasq isc-dhcp-server Recommended packages: inet-superserver The following NEW packages will be installed: atftpd debootstrap inetutils-inetd libcrypt-passwdmd5-perl libdigest-sha1-perl libfile-copy-recursive-perl nfs-kernel-server syslinux syslinux-common update-inetd x2gothinclientmanagement 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Need to get 1855 kB of archives. After this operation, 5353 kB of additional disk space will be used. Do you want to continue [Y/n]?
The installation will drag 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:$ editor /etc/x2go/x2gothinclient_settings
and apply changes required for your local site setup to the X2go TCE configuration.
$ x2gothinclient_create
root@pxeserver:/opt# tree -L 3 . └── x2gothinclient ├── chroot │ ├── bin │ ├── boot │ ├── dev │ ├── etc │ ├── home │ ├── initrd.img -> boot/initrd.img-<kernel-version> │ ├── lib │ ├── media │ ├── mnt │ ├── opt │ ├── proc │ ├── root │ ├── sbin │ ├── selinux │ ├── srv │ ├── sys │ ├── tmp │ ├── usr │ ├── var │ ├── vmlinuz -> boot/vmlinuz-<kernel-version> │ └── x2go_tc_install.sh └── etc ├── x2gothinclient_init ├── x2gothinclient_sessions └── x2gothinclient_start
/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 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, another option is using the x2goclient
application on your local computer to create such a set of session profiles for your X2go Thin Client Environment. Simply configure your x2goclient
in a way that want it to look on your X2go Thin Clients. When done, 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:$ 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).
As we do not want our software to interfere with other PXE bootable systems (like LTSP for example) we only ship an exemplary TFTP/PXE configuration in the doc section of the x2gothinclientmanagement
package. You may take a look at the shipped files with these commands:
$ cd /usr/share/doc/x2gothinclientmanagement/examples/tftpboot $ ls -al
— WORK IN PROGRESS —
Debian lenny currently is Debian's »oldstable« version. Do not use it anymore!
X2goclient can be used as a display manager. If you combine this feature with a boot environment, you'll get an easy manageable solution for your whole network. Please read the manual carefully, because some of the commands could harm your system if executed within the wrong context. The boot environment used by x2go will be able to recognize USB mass storage and CD-ROM devices automatically. Global preferences can be edited inside the KDE Control Center. You'll need 300 MB of free disk space for this installation. First of all you'll need the network services:
# apt-get install dhcp3-server atftpd nfs-kernel-server debootstrap
You'll need a directory to install the boot environment. You can choose a directory of your choice, but this manual will describe the installation inside “/opt/x2gothinclient”. This directory is also defined within some configuration files:
# mkdir /opt/x2gothinclient
You can populate the directory by running the command “debootstrap”:
# debootstrap --arch i386 lenny /opt/x2gothinclient/ http://ftp2.de.debian.org/debian
Adding a name server entry will help you accessing the Internet inside the chroot environment:
# cp /etc/resolv.conf /opt/x2gothinclient/etc/resolv.conf
You'll also need some network device:
# vi /opt/x2gothinclient/etc/network/interfaces:
auto lo iface lo inet loopback
And a host name as well as an entry of your system inside /etc/hosts:
# echo x2gothinclient > /opt/x2gothinclient/etc/hostname # echo "127.0.0.1 localhost" >>/opt/x2gothinclient/etc/hosts
You also need the x2goserver inside /etc/hosts:
# echo "192.168.1.1 x2goserver.planetexpress.de x2goserver" >>/opt/x2gothinclient/etc/hosts
and access to the x2go repository:
# echo "deb http://x2go.obviously-nice.de/deb/ lenny main" >>/opt/x2gothinclient/etc/apt/sources.list
Warning!
Please make sure that you continue working inside the boot environment. If you execute commands inside your real system, you may make it inaccessible!
The following command will take you inside the boot environment
# chroot /opt/x2gothinclient /bin/bash
To get things working you'll need /proc and /dev directories. You may also use hardlinks created outside the chroot environment:
# mount -t proc none /proc # mount -t devpts none /dev/pts/
Debootstrap didn't install a kernel, which is needed to start the boot environment:
# aptitude update # aptitude install syslinux locales linux-image-486
If you would like to use a keymap other than us_US, you'll need to reconfigure the locales:
# dpkg-reconfigure locales
The system will be started via network, so it is necessary to tell the initramfs about your plans:
# vi /etc/initramfs-tools/initramfs.conf
Modify to : BOOT=nfs
The new configuration needs to be applied and the initramfs needs to be newly generated:
# update-initramfs -u -v
The package x2gothinclientsystem will install a system daemon which will start x2goclient as a display manager. It will further start a deamon which will be responsible for mounting local mass storage devices automatically.
# apt-get install x2gothinclientsystem # cd /usr/share/x2gothinclientsystem/script # ./x2gothinclient_install.sh
This will finish the installation of the boot environment. Before exiting the chroot environment, you'll need to umount the /proc and /dev directories:
# umount /proc/ # umount /dev/pts/
Set a root password. You can change this again later by entering the chroot environment.
# passwd
The command “exit” will leave the chroot boot environment. If you discover any problems, you can always go back inside the boot environment by using “chroot” as described (for example for system upgrades):
# exit
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 an own network for your thin client system. The following example assumes that you are running the DHCPD and the ATFTPD on the same system.
# vi /etc/dhcpd/dhcpd.conf
option domain-name "planetexpress.de"; option domain-name-servers 192.168.1.1; # 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 to apply the new configuration:
# /etc/init.d/dhcp3-server restart
After receiving a network address from the DHCP daemon, a kernel will be deployed using the tftp protocoll. For this purpose, you'll need to configure the atftpd, so that the kernel can be found. Please make sure, that atftp ist started by an init script and not via inet.d.
# vi /etc/default/atftpd
USE_INETD=false OPTIONS="--daemon --port 69 --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /tftpboot"
You'll need a directory to store the necessary kernel which should be world readable (=public).
# mkdir /tftpboot # chmod 755 /tftpboot
If inet.d was installed and used on your system, please make sure that it is not starting or runnig atftp when you start it directly:
# /etc/init.d/atftpd restart
If you don't want to make copies of the kernel and initrd files, just use symbolic links – that is a good idea, if you plan to maintain the boot environment:
# ln -s /opt/x2gothinclient/vmlinuz /tftpboot/ # ln -s /opt/x2gothinclient/initrd.img /tftpboot/
The configuration file of atftp needs to be created and edited. Please change the IP address if necessary!
# mkdir /tftpboot/pxelinux.cfg # touch /tftpboot/pxelinux.cfg/default # cp /opt/x2gothinclient/usr/lib/syslinux/pxelinux.0 /tftpboot/
# touch /tftpboot/pxelinux.cfg/default # vi /tftpboot/pxelinux.cfg/default
label linux kernel vmlinuz append root=/dev/nfs nfsroot=192.168.1.1:/opt/x2gothinclient ro initrd=initrd.img ip=dhcp
The root file system of the boot environment is mounted using NFS (so it can be accessed over the network). You'll need to export the needed directory by editing the NFS configuration file:
# vi /etc/exports
/opt/x2gothinclient 192.168.1.0/24(ro,async,no_root_squash)
Finally restart the NFSD:
# /etc/init.d/nfs-kernel-server restart
Please also edit the command line options used by the x2goclient running in display manager mode (for example: change the IP address).
# vi /opt/x2gothinclient/etc/default/x2gothinclient
x2goclient --pgp-card -ldap="192.168.1.1:389:o=planetexpress,c=de" --external-login=/ramdrive/logins --no-menu --maximize --link=lan --kbd-layout=de --kbd-type=pc105/de --set-kbd=1 --geometry=fullscreen --add-to-known-hosts --read-exports-from=/ramdrive/export –add-to-known-hosts
This is an optional setup if you want to avoid the needed LDAP server configuration. Please choose only one of the two display manager mode options!
You should start by creating a session with a x2goclient. You should only create the needed session if you want to deny users to choose between different sessions. If you don't use the x2goclient user inside the boot environment, please make sure to copy it inside the required directory. The created file should look like:
$ cat ~/.x2goclient/sessions
[20070226145202980] host=x2goserver command=KDE fullscreen=true layout=de name=X2Go Session pack=16m-jpeg quality=9 sound=true speed=2 sshport=22 type=pc105/de usekbd=true rootless=false soundsystem=pulse startsoundsystem=true soundtunnel=true fstunnel=true defsndport=true sndport=4713
x2goclient --no-session-edit --session="X2Go Session" --pgp-card --external-login=/ramdrive/logins --no-menu --maximize --link=lan --kbd-layout=de --kbd-type=pc105/de --set-kbd=1 --geometry=fullscreen --add-to-known-hosts --read-exports-from=/ramdrive/export –add-to-known-hosts
There are two commandline arguments you should be aware in this configuration. –no-session-edit will deny any manipulation of the session by the user. –session=“X2Go Session” needs to be identical to the name inside the x2go session file created above. Don't use the LDAP argument with this setup.
You are done!
PXE Boot enabled devices should now boot into the configured environment and show the x2goclient in display manager mode. If there are problems to start x.org, you may need to add missing drivers to the boot environment.