From ArchWiki
Revision as of 11:25, 11 July 2008 by Gerbra (talk | contribs) (created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

x2go Server and Client

With x2go you can access your desktop using another computer -- that means both using LAN or internet connections. The transmmission is done using ssh protocol, so it is encrypted. By relying on the free nx libraries (nomachine) a very acceptable permformance in both speed of the transmission and reaction on user's input is archieved. Also a ISDN-connection allows to work satisfyingly.

So it is possible to connect with your laptop to your desktop at home, with all the environments, applications and performance of the remote desktop. Also it is possible to have a bunch of computers to connect to one computer (terminal-server, thin-client).

The package includes a server (x2goserver together with x2goagent) and the client software. On the server the postgresql SQL-server has to be up and running. Clients are available for Linux (at the moment a QT4-based one, another one for GTK is supposded to follow) and Windows, the latter can be downloaded at the x2go homepage.

Last but not least an SSH daemon has to be installed and must be available from the clients.

x2go and Archlinux

Alle needed packages are available in AUR. At the moment the needed libraries, the server/agent and the qt based client available. Not yet finished is the LDAP based usermanagement suite.

Also not finished are packages for some tools, that make x2go more convenient for use in schools and thin client environments. But work is going on.

Installation and configuration

Packages needed from AUR: x2goserver and x2goclient and their dependencies, the latter (nxcomp, nxproxy) have to be build first.

  • Hint for nxcomp: Due to a bug in AUR this package is not available on the normal way via AUR. The PKGBUILD code has to be pasted from the AUR comment page of nxcompext.
  • Hint for x2goagent: This package builds from the complete xorg sources, but uses only parts of them. The build process lasts long.
  • Another hint for x2goagent: A build time the sources of the dependencies nxcomp, nxcompext and nxcompshad have to be accessible in a local directory tree. As these are dependencies, they are already there at build time, but you may not delete the trees afterwards, using makepkg or the like. x2goagent's PKGBUILD creates symbolic links to the required directories. Therefore the following directory structure is needed:
./x2goagent (this is the one you build at the moment)

If all packages are successfully built, you install the following:
on the server(ex. your pc at home): x2goserver (plus dependencies)
on the client, e.g. laptop: x2goclient (plus dependencies)

Configuration Server
Given a working X-server plus Desktop-Environment (e.g. KDE) or window manager, you have to do the following:

a) Install the ssh-daemon using

pacman -Sy openssh
/etc/rc.d/sshd start

If the TCP-wrapper is active (see /etc/hosts.deny or /etc/hosts.allow), you have to include sshd there. To have sshd started at boot time, you also have to put it into the daemeons line in /etc/rc.conf, e.g.

DAEMONS=(... network ... sshd ...)

b) Load the fuse modul to let the client access the directory in read and write mode on the server.

modeprobe fuse

To have this module loaded at boot time, you also have to put it into the MODULES line in /etc/rc.conf, e.g.

c) Some users or groups have to get the right to run a program as root.

pacman -Sy sudo

An example for an entry in this file for all members of the group users:

%users ALL=(ALL) NOPASSWD: /usr/bin/x2gopgwrapper

d) Initialize the SQL database and start the SQL server

/etc/rc.d/postgresql start

This creates internally used tables of PostgreSQL. Now the x2go database and its tables are created this way:

cd /usr/lib/x2go

The SQL-server and the x2goserver have to be restarted:

/etc/rc.d/postgresql restart
/etc/rc.d/x2goserver start

And again: If you want to have this services started at boot time,, include them in the DAEMONS line in /etc/rc.conf

DAEMONS=(... network ... sshd ... postgresql ... x2goserver)

Configuration of the Client
Convince yourself that you can open a ssh-session from the client to the server (host).

ssh YourUsername_onServer@yourhost_or_ip

Within the local network this should not be a problem. The way you connect from beyond your network, lets say the internet, to your comuter at home is a question of how your network is build up. This would go beyond the scope of this article. Therefore here only a few items:

  • A port has to be opened at the router resp. gateway which forwards requests to your server, and there especially to the sshd-port (which normally is 22). To prevent a big part of the portscan attacks it is probably better to have 222 as publicly reachable port.
  • To prevent you from having the need to keep your public IP address in mind (especially if this changes dynamically) it is advisable to use a dynamic DNS-Service (DynDNS, DynIP). Many routers are preconfigured to be reachable under a name rather than an IP address.

Enough preliminaries! Now to the x2goclient. Run


This opens the client application. Now you can create several sessions, which then appears on the right side and can be selected by a mouseclick. Each entry consists of your username on the server, hostname and IP and the port for ssh-connection. Furthermore you can define several speed profiles (coming from modem up to LAN) and the desktop environment you want to start remotely.

Easy made mistakes: Do not simply choose the defaults of KDE or Gnome, since the executables startkde or startgnome are usually not in the PATH when logging in using ssh. Use full paths to startkde or startgnome. You can also start openbox or another window manager.

You should be asked for your password for your user at the server now and after login you will see the x2go logo for a short time, and -- voila -- the desktop.

Exchange data between client and server(desktop)

On the x2goclient (e.g. laptop) a lacal directory will be created and opened for to be accessed by the server. The server will use fuse and sshfs to access this directory and mount it to a subdirectory media of your home directory on the server. This enables you to hav access to laptop data using your server. It is also possible mount them automatically at each session

To leave a session temorarily

Another special feature of x2go is the possibility of suspending a session. This means you can leave a session on one client and reopen it even from another client at the same point. This can be used to to start a session in the LAN and to reopen it later on a laptop. The session data are stored and administrated in a potges databse on the server in the meanwhile. The state of the sessions is protocolled by a process named x2gocleansessions.


At the moment the package consists mainly of the x2goserver and the x2goclient. It is planned to add in near future:

  • LDAP-Integration. This allow the administration of users, sessions and logins using LDAP. This is an interesting feature for schols or companys. For this purpose there are control programs which integrate themselves into the KDE Control Center.
  • The GTK-x2goclient and the client for the command line. Furtermore the option to use x2goclient as an login screen for thin clients.
  • the possibility to use locale devices (CD, floppy, USB-stick) remotely and transparently.

Questions and problems? You could contact me also directly. GerBra

(Many thanks to Stefan Husmann for translation from archlinux.de wiki)


Screenshot KDE-Session

Screenshot configuration dialog

Project page