User Tools

Site Tools


wiki:development:build-howto-mswin:x2goclient

Build X2GoClient and 3rd-party programs for MS Windows

This howto explains how to build the MS Windows version of X2Go Client. This howto explains how to build the 32-bit version of X2Go Client on MS Windows. If someone successfully attempts a 64-bit (which should work, but needs to be tested), please contribute to this wiki page.

Overview of third-party components

X2Go Cltient for Windows needs several 3rd-party programmes for being able to run on MS Windows:

  • PuTTY for Kerberos 5 (GSSAPI) authentication

All these programmes can be built from source, downloaded from our server or from their project sites. You can also copy the 3rd-party components from X2Go Client installation (on MS Windows) directory.

Build Utilities

For building X2Go Client, we highly recommend to install MSysGit and Notepad2.

MSysGit provides a Unix-like shell (bash) environment, so that you can use Git easily from the command line.

Notepad2 is a freeware alternative to Notepad shipped with Microsoft Windows. Notepad2 understands UTF-8 text formats (and others) and can handle Unix-style line endings. In case you want to introspect a code file, this tool is very handy.

Build X2Go Client

Installing MinGW

MinGW is a gcc compiler for Windows. You need it to build X2Go Client. For the time being, X2Go Client uses Qt 4.8.5 specifically. Qt-4.8.5 for Windows should be used with MinGw-4.4. Unfortunately, you can not download binaries for this version from MinGW project site any more. You can build it from source or download it from X2Go Site

Extract it to your disk (D:\mingw in this example).

Finally, you have to add these MinGW executable directories to your PATH environment variable: D:\mingw\bin, D:\mingw\libexec\gcc\mingw32\4.4.0.

Installing Qt

You need Qt to build X2Go Client from source. Qt-4.8.5 is tested and recommended for current version of X2Go Client.

Download and install the MinGW version of Qt-4.8.5 for Windows from here

In this example D:\Qt will be chosen as installation directory

Configuring Qt

Providing OpenSSL support in Qt

As X2Go Client needs a Qt with SSL support you must install OpenSSL for MS Windows. OpenSSL depends on the Microsoft Visual C++ 2008 Redistributables. Get that (32-bit version, x86) from the Microsoft site and install it prior to installing OpenSSL.

Download the OpenSSL installer for Windows by browsing here and selecting “Win32 OpenSSL v1.0.1*” where “1.0.1*” s the current version. You can also download it from our site, but only do so if we have the current version. Install it on your build system (for example to directory d:\OpenSSL-Win32).

After installation, copy OpenSSL header files into MinGW's include directory:

d:\OpenSSL-Win32\include\openssl -> d:\mingw\include\openssl

Static builds of Qt with SSL support

It is recommended to configure Qt to build statically linked applications. It will take some time to reconfigure Qt for static builds. You surely can skip this step, but in this case you must provide Qt libraries with your X2Go Client binary.

Open Qt Command Prompt and start configuration script

$ configure -release -static -openssl

Rebuild Qt

$ make sub-src

Dynamically linked builds of Qt with SSL support

If you choose to build dynamically linked applications with Qt, you still have to rebuild Qt in order to get OpenSSL support into Qt.

Open Qt Command Prompt and start configuration script

$ configure -release -openssl

Rebuild Qt

$ make sub-src

Installing libssh

You need libssh to build X2Go Client.

Get libssh library package built with MinGW from here on our site.

Prior versions can befound here the KDE Windows project and here on our site.

Extract files from archive.

Copy headers files in “include” directory of MinGW

libssh\include\libssh → d:\mingw\include\libssh

Copy library files in “lib” directory of MinGW

libssh\lib\*.* → d:\mingw\lib\

Build X2Go Client from source

Open Qt Command Prompt, change to your build directory and get X2Go Client sources from git

$ git clone git://code.x2go.org/x2goclient.git

Build X2Go Client

$ cd x2goclient
$ PATH=%PATH%;D:\MinGW\libexec\gcc\mingw32\4.4.0\
$ config_win.bat
$ mingw32-make

X2Go Client (x2goclient.exe) binary is in d:\build\x2goclient\release directory

Pack/Compress X2Go Client

You may want to pack X2Go Client to reduce it size. You can do it with upx, which is available for Windows, Linux and Cygwin.

X2Go Client package folder

To make X2Go Client usable on Windows, you must put X2Go Client binary and all libraries and components in one directory.

All of the files referenced below (apart from x2goclient.exe) can be obtained from x2goclient-contrib.git on http://git.x2go.org

In the base directory of your X2Go Client source tree create a folder named dist/. To this folder you have to add the following components:

  • X2Go Client with libraries
  • nxproxy with libraries
  • Open SSH Server with libraries (optional)
  • VcXsrv
  • PulseAudio (optional)

Add X2Go Client with libraries to package folder

  1. Add x2goclient.exe (from the release/ folder) to the dist/ folder.
  2. Add MinGW libraries (copy from D:\MinGW\bin)
    • libgcc_s_dw2-1.dll
    • mingwm10.dll
  3. Add OpenSSL libraries (copy from your OpenSSL installation directory)
    • libeay32.dll
    • ssleay32.dll
  4. libssh library (binaries originally from the KDE Windows project site
    • libssh.dll
  5. libzip library (binaries originally from the KDE Windows project site
    • libzip.dll
  6. zlib library (binaries originally from the KDE Windows project site
    • libz.dll
  7. If you want to use X2Go Client on older versions of Windows, you should put the “Microsoft Visual C\+\+ Redistributable 2008 Package”'s dll files into your X2Go Client package directory. (Originally downloaded from the Microsoft download site).
    • Microsoft.VC90.CRT.manifest
    • msvcm90.dll
    • msvcp90.dll
    • msvcr90.dll

Build/Add nxproxy with libraries

You can download nxproxy, and its libraries here or obtain them from x2goclient-contrib.git directly.

  1. Copy the nxproxy binaries directly into the dist/ folder (built from nx-libs.git on http://git.x2go.org):
    • cygXcomp.dll
    • cygjpeg-8.dll
    • cygstdc\+\+-6.dll
    • cygz.dll
    • cyggcc_s-1.dll
    • cygpng-3.dll
    • cygwin1.dll
    • nxproxy.exe

If you want to build nxproxy from source, you need install and configure Cygwin first.

Installing Cygwin

Download and start the Cygwin installer

Choose your cygwin directory. For example c:\cygwin. Follow installer instructions.

on installer page “Select Packages” you can select programs and libraries that should be installed in your cygwin environment. For building of nxproxy you will need:

  • autoconf
  • automake
  • gcc-core
  • gcc-g++
  • git
  • libX11-devel
  • libjpeg-devel
  • libmpfr4
  • make
  • mc
  • zlib-devel
  • wget

By installing the libjpeg-devel package, you are now installing libjpeg-turbo instead of the legacy libjpeg . The same applies for the dependency libjpeg8 package, which provides the cygjpeg-8.dll file that you will copy later.

If you are updating the X2Go Windows build VM, X2Go-WinBuilder, install these packages too:

  • bashdb
  • bash-completion
  • chere
  • colorgcc
  • colordiff
  • diffutils
  • dos2unix
  • cygcheck-dep
  • cygutils-extra
  • indent
  • renameutils
  • vim
  • git-completion
  • patch
  • patchutils
  • openssh
  • xz
  • unzip
  • nano
  • bzip2
  • time

Installing libpng

You will need a libpng12 to build nxproxy. This version of libpng is not available on current version of cygwin. You should install it manually.

  • Open a cygwin shell. Go to the src directory
$ cd /usr/src
  • Get a libpng12 from project site
$ wget http://downloads.sourceforge.net/project/libpng/libpng12/1.2.51/libpng-1.2.51.tar.gz
$ tar -xzvf libpng-1.2.51.tar.gz
$ cd libpng-1.2.51
  • Build and install libpng
$ ./configure --prefix=/usr/
$ make && make install

Building nxproxy

  • Open a cygwin shell and change to your build directory. In this example d:\Build will be used
$ cd /cygdrive/d/Build

Do not download and use the sources from git. Unlike the tarball, the git sources do not have the X2Go project's patches (debian/patches/) applied. (Technically, you could use the sources from git and apply the patches manually.)

$ wget http://code.x2go.org/releases/source/nx-libs/nx-libs-3.5.0.27-lite.tar.gz
$ tar -xvzf nx-libs-3.5.0.27-lite.tar.gz
$ cd nx-libs-3.5.0.27
  • Build nxcomp
$ cd nxcomp
$ autoconf
$ ./configure
$ make
$ cd ..
  • Build nxproxy
$ cd nxproxy
$ autoconf
$ ./configure
$ make
$ strip nxproxy.exe
$ cd ..

Copying the nxproxy binaries

Now the nxproxy binary (nxproxy.exe) is ready. You can copy it into the programme packaging folder (dist/) of X2Go Client. To be able to run nxproxy you must also copy required libraries into the dist/ folder:

  1. From nxcomp directory (d:\Build\nx-libs\nxcomp) - cygXcomp.dll
  1. From cygwin directory (c:\cygwin\bin):
    • cyggcc_s-1.dll
    • cygjpeg-8.dll
    • cygpng-3.dll
    • cygstdc\+\+-6.dll
    • cygwin1.dll
    • cygz.dll

Open SSH Server

X2Go Client for Windows using modified Cygwin Open SSH Server for file sharing. You can download it here

If you want to build it from source, you should install Cygwin first.

After that run Cygwin installer (setup.exe), navigate to “Select Packages” page and install additional packages, you need to build Open SSH Server:

  • libedit
  • libedit-devel
  • libkrb5-devel
  • libncurses-devel
  • openssl-devel
  • libwrap-devel
  • patch

For openssh you should install both, binary and source packages (toggle “Src” checkbox beside of package name). Source package will be installed in /usr/src directory in your Cygwin installation.

Copy the source folder (downloaded and extracted from a tarball by cygwin) to your build directory. In this example d:\Build will be used

$cp -pr /usr/src/openssh-6.1.1p1-3-src /cygdrive/d/Build/

cd to the openssh source directory, extract the upstream (openssh.com) tarball within, and cd to the lower-level source directory

$cd /cygdrive/d/Build/openssh-6.6.1p1-3
$tar -xzvf openssh-6.6p1.tar.gz
$cd openssh-6.6p1

Apply any patches that cygwin provides. For example, with 6.6p1-3:

$patch < ../curve25519-sha256.patch

Get and apply the X2Go patch, which enables use of the Open SSH Server with X2Go Client

$cd ..
$wget http://code.x2go.org/releases/source/openssh-cygwin/openssh-6.0p1-2.x2go.patch ../
$cd openssh-6.6p1
$patch.exe < ../openssh-6.6p1-1.x2go.patch

Build Open SSH Server

$./configure --libexecdir=/usr/sbin --with-kerberos5=/usr --with-tcp-wrappers --with-libedit --with-xauth=/usr/bin/xauth --build=mingw32
$make
$strip *.exe

Open SSH Server binaries are ready. Now you can copy them in to the installation directory of x2goclient:

  • sftp.exe
  • sftp-server.exe
  • ssh-keygen.exe
  • sshd.exe

To be able to run Open SSH Server you should also copy needed programs and libraries from cygwin directory (c:\cygwin\bin):

  • sh.exe
  • cygcom_err-2.dll
  • cygcrypt-0.dll
  • cygcrypto-1.0.0.dll
  • cygedit-0.dll
  • cyggcc_s-1.dll
  • cyggssrpc-4.dll
  • cyggssapi_krb5-2.dll
  • cygiconv-2.dll
  • cygintl-8.dll
  • cygk5crypto-3.dll
  • cygkadm5clnt_mit-9.dll
  • cygkadm5srv_mit-9.dll
  • cygkdb5-7.dll
  • cygkrad-0.dll
  • cygkrb5-3.dll
  • cygkrb5support-0.dll
  • cygncursesw-10.dll
  • cygreadline7.dll
  • cygsqlite3-0.dll
  • cygssp-0.dll
  • cygwin1.dll
  • cygwrap-0.dll
  • cygz.dll

Some of this libraries are also used by nxproxy. Open SSH Server and nxproxy should be built using same version of Cygwin.

PulseAudio

You can download PulseAudio 5.0 for Windows here.

Prior versions of PulseAudio are available from project site and the above link.

VcXsrv

you can download VcXsrv for Windows here or from project site. Building VcXsrv from source is not the part of this Howto

All official X2Go Project builds use the 32-bit builds of VcXsrv. 64-bit builds are probably compatible with the 32-bit X2Go Client, but have not been tested.

Also, you are doing an official X2Go Project build, use the latest version that is still compatible with Windows XP: 1.14.2.1

If you do download VcXsrv from the project site, deselect to install the fonts. They would more than double the size of the X2Go NSIS installer. Some legacy apps do need them, and users can install them if they'd like

Also, if you are doing an official X2Go Project build, remove these files that X2Go Client does not need and would take up extra space:

  • iconv.dll
  • libgcc-s-sjlj-1.dll
  • libiconv-2.dll
  • libwinpthread-1.dll
  • libxml2.dll
  • libxml2-2.dll
  • plink.exe
  • uninstall.exe
  • xauth.exe
  • XCalc
  • xcalc.exe
  • XCalc-color
  • XClock
  • xclock.exe
  • XClock-color
  • Xcms.txt
  • xhost.exe
  • xlaunch.exe
  • xrdb.exe
  • xwininfo.exe

Also, if you are doing an official X2Go Project build, create this file in the VcXsrv folder:

  • vcxsrv-version.txt

And specify the version string of VcXsrv in it. The version string should be the only contents of the file. For example:

1.14.3.1

PuTTY

you can download PuTTY for Windows from project site. Building PuTTY from source is not the part of this Howto

These are the only binaries you need from PuTTY. Copy them directly into the dist/ folder.

  • plink.exe
  • pscp.exe
wiki/development/build-howto-mswin/x2goclient.txt · Last modified: 2014/07/02 12:33 by mikedep333