X2Go - ArchWiki

# X2Go

X2Go enables you to access a graphical desktop of a computer over the network. The transmission is done using the Secure Shell protocol, so it is encrypted.

Note: X2Go isn't compatible with all desktop environments. You can check X2Go desktop environment compatibility first, especially if you want to shadow your current desktop.

## Installation

Two parts are available in official repositories. They can be installed with the following packages:

- x2goserver - X2Go server
- x2goclient - X2Go client based on Qt4

## Server configuration

### Configure Secure Shell daemon

X2Go uses Secure Shell in order to work, so you need to configure sshd daemon to allow X11 forwarding and then start it first. Follow the instructions at Secure Shell#X11 forwarding and Secure Shell#Managing the sshd daemon.

If you are using other than POSIX (C) locale, you may want to add the following line to configuration file

    # Allow client to pass locale environment variables
    AcceptEnv LANG LC_*

### Load fuse kernel module

In order for the server to be able to access files on the client computer you should load a `fuse` kernel module.

### Setup SQLite database

This article or section needs expansion.

Reason: What is it used for? Why do we need it? (Discuss in Talk:X2Go#)

Run the following command to initialize SQLite database

    # x2godbadmin --createdb

### Start X2Go server daemon

Now all you need to do is start `x2goserver.service`.

## Desktop Shadowing

To gain access to the "local desktop" (as opposed to a unique session/desktop environment) you need to install x2godesktopsharingAUR from the AUR. Then, launch `x2godesktopsharing`.

Note, you do not need x2godesktopsharing to access "local desktop" of user "foo" by user "foo". x2godesktopsharing is for accessing "foo"'s desktop by "foo2" user. Just choose "Connection to local desktop" in "session type" in x2goclient.

## Client configuration

Make sure you can open a ssh-session from the client to the server

    ssh username@host

Then run X2Go client itself

    x2goclient

You can now create several sessions, which then appear on the right side and can be selected by a mouse click. Each entry consists of your username, hostname, IP, and 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.

Common 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) local directories could be shared. 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 have access to laptop data on your server or to exchange files. It is also possible to mount these shares automatically at each session start.

To leave a session temporarily 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 administered in a postgres database on the server in the meanwhile. The state of the sessions is protocolled by a process named x2gocleansessions.

## Various

Workaround for failing compositing window manager for remote session

This is useful for situations, when the computer running x2goserver is used also for local sessions with e.g. compiz as the window manager. For remote connections with x2goclient, compiz fails to load and metacity should be used instead. The following is for GNOME, but could be modified for other desktop environments. (Getting compiz ready is not part of this how-to.)

Create /usr/local/share/applications/gnome-wm-test.desktop:

    [Desktop Entry]
    Type=Application
    Encoding=UTF-8
    Name=gnome-wm-test
    Exec=/usr/local/bin/gnome-wm-test.sh
    NoDisplay=true

Create script /usr/local/bin/gnome-wm-test.sh:

    #!/bin/sh
    # Script for choosing compiz when possible, otherwise metacity
    # Proper way to use this script is to set the key to mk-gnome-wm
    # /desktop/gnome/session/required_components/windowmanager
    xdpyinfo 2> /dev/null | grep -q "^ *Composite$" 2> /dev/null
    IS_X_COMPOSITED=$?
    if [ $IS_X_COMPOSITED -eq 0 ] ; then
        gtk-window-decorator &
        WM="compiz ccp --indirect-rendering --sm-client-id $DESKTOP_AUTOSTART_ID"
    else
        WM="metacity --sm-client-id=$DESKTOP_AUTOSTART_ID"
    fi
    exec bash -c "$WM"

Modify the following gconf key to start the session with gnome-wm-test window manager:

    $ gconftool-2 --type string --set /desktop/gnome/session/required_components/windowmanager "gnome-wm-test"

## Troubleshooting

### Authentication error

If the following error appears:

    Authentification Failed:
    The host key for this server was not found but an othertype of key exists.
    An Attacker might change the default server key to confuse
    your client into thinking the key does not exist

Delete the servers entry from `~/.ssh/known_hosts` file and retry to authenticate.

### No selection screen in x2goclient

A regression in iproute2 causes ss to show no result when specifying the `-u` flag, as done in `/usr/bin/x2golistdesktops`. [1]

See [2], [3] for more information.

## Links

- Screenshot KDE-Session
- Screenshot configuration dialog
- Project page

Category:

- Remote desktop