User Tools

Site Tools


Build X2GoServer for GNU/Linux

… esp. applies to installation on the Linux-From-Scratch distribution.

General Information

Make sure you have read these wiki pages / installed recommended software / development libraries:

  • non-X2Go runtime dependencies:
    • lsof
    • openssh-client
    • openssh-server
    • libconfig-simple-perl
    • makepasswd
    • libdbd-pg-perl
    • libdbd-sqlite3-perl
    • xauth
  • X2Go runtime dependencies:
    • x2goagent
    • NX libraries

Note: X2GoServer is not dependent on perl-suid anymore (as Perl SUID has been removed from Perl >=5.12.x).

Installation: For an insight in basic post-installation procedures please take a look at the INSTALL file in the base directory of the x2goserver code project. The latest version of this INSTALL file can be found in our Git repository.

Deinstallation: For deinstallation please refer to the UNINSTALL file in the base directory of the x2goserver code project. The latest version of this UNINSTALL file can also be found in our Git repository.

Build Recipes

Run the following commands as a regular, non-root user. You'll need the root password to install them.

1. Create the necessary group and user

Make sure you already have a group called fuse

$ su -c "groupadd --system x2gouser && groupadd --system x2goprint &&
useradd --system --no-create-home --shell /bin/false --home /var/lib/x2go -g x2gouser x2gouser &&
usermod -a -G fuse <each user who'll connect to this x2go server>"

2. Install makepasswd

$ wget
$ tar xf makepasswd-0.5.0.tar.gz
$ cd makepasswd-0.5.0
$ make
$ su -c "make PREFIX=/usr install"

3. Install man2html

$ wget
$ tar xf man2html3.0.1.tar.gz
$ cd man2html3.0.1
$ su -c "sed 's,/local,,g' man2html > /usr/bin/man2html &&
sed 's,/local,,g' man.cgi > /usr/bin/man.cgi &&
cp doc/man2html.1 /usr/share/man/man1/ &&
chown root:root /usr/bin/man2html /usr/bin/man.cgi /usr/share/man/man1/man2html.1 &&
chmod 755 /usr/bin/man2html /usr/bin/man.cgi"

4. Install perl module Config-Simple

$ wget
$ tar xf Config-Simple-4.59.tar.gz
$ cd Config-Simple-4.59
$ perl Makefile.PL
$ make
$ su -c "make install"

5. Install perl module DBI

$ wget
$ tar xf DBI-1.615.tar.gz
$ cd DBI-1.615
$ perl Makefile.PL
$ make
$ su -c "make install"

Here you need to decide if you need a single-server or multiple-server setup.

If you pick a single-server setup, you need to install sqlite. Follow the installation instructions at BLFS.

If you pick a multiple-server setup, you need to install postgresql. Follow the installation instructions at BLFS.

6. Install perl module DBD-SQLite (for a single-server setup)

$ wget
$ tar xf DBD-SQLite-1.33.tar.gz
$ cd DBD-SQLite-1.33
$ perl Makefile.PL
$ make
$ su -c "make install"

7. Install perl module DBD-Pg (for a multiple-server setup) (TODO: Someone please verify this)

$ wget
$ tar xf DBD-Pg-2.18.1.tar.gz
$ cd DBD-Pg-2.18.1
$ perl Makefile.PL
$ make
$ su -c "make install"

8. Install NoMachine's NX libraries, described here.

9. Install x2goagent from git

$ su -c "rm -fr /usr/lib/x2go &&
mkdir -p /usr/lib/x2go"
$ git clone git://
$ cd x2goagent
$ make World
$ su -c "cp -a lib/Xext/* /usr/lib/x2go/ &&
cp -a lib/X11/* /usr/lib/x2go/ &&
cp -a lib/Xpm/* /usr/lib/x2go/ &&
cp -a lib/Xrender/* /usr/lib/x2go/ &&
cp -a lib/Xfixes/* /usr/lib/x2go/ &&
cp -a lib/Xtst/* /usr/lib/x2go/ &&
cp -a lib/Xdamage/* /usr/lib/x2go/ &&
cp -a lib/Xrandr/* /usr/lib/x2go/ &&
cp -a lib/Xcomposite/* /usr/lib/x2go/ &&
chown -R root:root /usr/lib/x2go &&
install -m755 programs/Xserver/x2goagent /usr/bin/x2goagent.original"

Use make -j <number of cpus> World to speed up the build

Now create a wrapper to call the actual x2goagent binary with the correct LD_LIBRARY_PATH

$ su -c "echo '#\!/bin/bash' | sed 's,\\\,,g' > /usr/bin/x2goagent &&
echo 'X2GO_LIBS=/usr/lib/x2go LD_LIBRARY_PATH=/usr/lib/x2go exec /usr/bin/x2goagent.original \$@' >> /usr/bin/x2goagent &&
chmod 755 /usr/bin/x2goagent"

12. Install x2goserver from git

$ git clone git://
$ cd x2goserver
$ sed -i "s,/local,,g" x2goserver-compat/Makefile
$ sed -i "s,/local,,g" x2goserver-extensions/Makefile
$ sed -i "s,/local,,g" x2goserver/Makefile
$ make
$ su -c "make install &&
chown root:x2gouser /usr/lib/x2go/x2gosqlitewrapper &&
chmod 2755 /usr/lib/x2go/x2gosqlitewrapper
rm -fr /var/lib/x2go/x2go_sessions &&
/usr/sbin/x2godbadmin --createdb"

13. Install a boot script

Copy this text into /etc/rc.d/init.d/x2goserver:


. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
                boot_mesg "Starting x2go server..."

                boot_mesg "Stopping x2go server..."
                killall x2gocleansessions

                boot_mesg "Restarting x2go server..."
                ${0} stop
                sleep 1
                ${0} start

                boot_mesg "Checking x2go status..."
                statusproc /usr/sbin/x2gocleansessions

                echo "Usage: ${0} {start|stop|restart|status}"
                exit 1

# End $rc_base/init.d/x2goserver

su -c "chmod 755 /etc/rc.d/init.d/x2goserver &&
ln -sf ../init.d/x2goserver /etc/rc.d/rcsysinit.d/S92x2goserver &&
ln -sf ../init.d/x2goserver /etc/rc.d/rc0.d/K28x2goserver &&
ln -sf ../init.d/x2goserver /etc/rc.d/rc6.d/K28x2goserver"
wiki/development/build-howto-linux/x2goserver.txt · Last modified: 2013/03/08 13:31 (external edit)