User Tools

Site Tools


This is an old revision of the document!

Building X2Go Client on Mac OS

Build X2Go Client using Mac Ports

As X2Go Client is already in Mac Ports (thanks to Clemens Lang) it is possible to install all dependencies via Mac Ports.

Steps summarized:

  1. Install Mac Ports on your Mac OS system
  2. Take a look at the dependency list (in a terminal shell)
  3. And install those dependencies
  4. Install dylibbundler
  5. Get X2Go Client from X2Go Git
  6. Build X2Go Client

So, first install the X2Go Client dependencies:

$ port echo depof:x2goclient
$ sudo port install depof:x2goclient

Then install dylibbundler:

$ sudo port install dylibbundler

Once the dependencies are installed, tweak some file permissions:

$ sudo chmod u+w /opt/local/lib/libcrypto.1.0.0.dylib /opt/local/lib/libssl.1.0.0.dylib

If you omit the file permission tweak, dylibbundler will fail to build/bundle X2Go Client.

At last, checkout X2Go Client from Git:

$ git clone git://

If you want to build a specific version of X2Go Client, select that version with git checkout <version>. If you want to look around what versions are available, use git tag which will present you a list of valid version tags to use for checkout.

In the X2Go Client source directory, simply run the script:

$ ./

Build X2Go Client from Scratch (w/o Mac Ports)


This document makes use of several variables to address paths in a generic, but distinct way. They are not meant to be used via shell, but for human parsing. No program of the x2go suite actually uses them for anything. You may “set” them to whatever value you want to (in your head), just don't change them half-way through the building process. The “default value” is merely a suggestion.

Name Description Default value
$X2GO_BASE_DIR Parent directory of the x2goclient source tree /usr/src
$X2GO_CLIENT_DIR Directory containing the x2goclient source tree $X2GO_BASE_DIR/x2goclient-git
$X2GO_DIST_SRC Directory containing x2goclient dependencies source trees $X2GO_CLIENT_DIR/dist
$X2GO_DIST_INST Installation directory of x2goclient dependencies $X2GO_DIST_SRC/inst
$NX_BASE_DIR Common NX directory /usr/src/NX
$NX_LIBS_SRC Directory containing the NX libs source tree $NX_BASE_DIR/nx-libs-src
$NX_DIST_SRC Directory containing NX libs dependencies source trees $NX_BASE_DIR/dist
$NX_DIST_INST Installation directory of NX libs dependencies $NX_DIST_SRC/inst

Get the sources


Prepare $X2GO_BASE_DIR if need be.

# mkdir -p "$X2GO_BASE_DIR"
# cd "$X2GO_BASE_DIR"

Fetch the x2goclient sources.

# git clone git:// x2goclient-git

Prepare the dependencies directories.

# mkdir "$X2GO_DIST_SRC"
# mkdir "$X2GO_DIST_INST"

NX libraries

Prepare $NX_BASE_DIR.

# mkdir -p "$NX_BASE_DIR"
# cd "$NX_BASE_DIR"

Fetch the NX libraries sources.

$ wget<version>-lite.tar.gz
$ tar xzf nx-libs-<version>-lite.tar.gz
$ mv nx-libs-<version> nx-libs-src

Prepare the dependencies directories.

# mkdir "$NX_DIST_SRC"
# mkdir "$NX_DIST_INST"


  • for optional sound support: PulseAudio
  • build dependencies:
    • Apple Developer SDK
    • Qt 4
    • libssh >= 0.4.7
    • libjpeg or libjpeg-turbo
    • libpng
    • nx-binaries


Qt4 is a hard dependency. You can either download and install the SDK package for Mac OS X provided by Nokia, or, if you want to redistribute/deploy x2goclient on other machines, build your own version from source.

If you decide to build from source, follow these instructions, else skip to the NX part.


Download the source package from the official Qt site (.tar.gz recommended.)

Put it into $X2GO_DIST_SRC.

Unpack it.

# cd "$X2GO_DIST_SRC"
# tar -xzvf qt...tar.gz
# cd qt-...

Configure the qt source tree. We will disable unused stuff and build universal (for deployment.)

If you don't intend to deploy x2goclient, you can remove all -arch parameters and further speed up compilation.

If you don't want to debug x2goclient, replace -debug-and-release with -release for added speed.

Remember to substitute the variables with the correct path values!

# CXX="g++-4.2" CC="gcc-4.2" OBJC="gcc-4.2" PKG_CONFIG="/usr/bin/pkg-config" ./configure -prefix "$X2GO_DIST_INST/qt" -prefix-install -debug-and-release -opensource -shared -fast -largefile -no-exceptions -no-xmlpatterns -accessibility -stl -no-sql-psql -plugin-sql-sqlite -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -no-javascript-jit -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug -platform macx-g++ -graphicssystem raster -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -openssl-linked -rpath -v -no-optimized-qmake -no-nis -cups -iconv -no-pch -no-dbus -cocoa -framework -dwarf2 -arch "x86_64 x86 ppc" -confirm-license -nomake demos -nomake examples -nomake docs -sdk /Developer/SDKs/MacOSX10.5.sdk

If everything went through cleanly, proceed to the next step.


Run make and pray. Pray strongly. To whomever or whatever you want, just pray.

# make

If everything went through without errors, install Qt.

# make install



libssh uses CMake to configure the source build. Please download and install CMake from the official CMake repository.


Download the source package from the libssh repository. Note that currently 0.5.2 is buggy, at least on Mac OS X. Please use 0.5.1 for now.

Put it into $X2GO_DIST_SRC.

Unpack the source.

# tar -xzvf libssh-...tar.gz
# cd libssh-...

Create a build subdir.

# mkdir build
# cd build

Configure libssh.

Again, substitute variables. If you don't need multiarch support, replace “CMAKE_OSX_ARCHITECTURES:STRING=i386 -arch x86_64 -arch ppc” with “CMAKE_OSX_ARCHITECTURES:STRING=”.


Build the source.

# make

Install libssh.

# make install

Remove the shared libraries (we only need the static one.)

# rm "$X2GO_DIST_INST/lib/"libssh*.dylib

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

1. Install nxproxy from the nx-libs-lite tarball

$ wget<version>-lite.tar.gz
$ tar xzf nx-libs-<version>-lite.tar.gz
$ cd nx-libs-<version>
$ PREFIX=/usr make
$ su -c "make install"

2a. Install x2goclient from git

$ git clone git://
$ cd x2goclient
$ export PREFIX=/usr
$ make build_client && make install_client

2b. Also build+install x2goplugin

$ make build_plugin && make install_plugin
wiki/development/build-howto-macos/x2goclient.1380185844.txt.gz · Last modified: 2013/09/26 08:57 by sunweaver