User Tools

Site Tools


wiki:development:build-howto-mswin:x2goclient

This is an old revision of the document!


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 (Current Version)

MinGW is a gcc compiler for Windows. You need it to build X2Go Client.

Since X2Go Client 4.0.3.0, X2Go Client uses Qt 4.8.6 specifically. Qt 4.8.6 uses MinGW 4.8.x. Qt 4.8.6 for Windows recommends this specific build of MinGW, so it is this specific build that you should use.

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z

Extract it to your disk (D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32 in this example).

Finally, you have to add these MinGW executable directories to your PATH environment variable: D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin, D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\libexec\gcc\i686-w64-mingw32\4.8.2.

Installing MinGW (Old Version)

Using Qt 4.8.5 + MinGW 4.4 is still an option for building X2Go Client 4.0.3.0 and later. It was how X2Go Client 4.0.2.1 and many prior versions were built. 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 (Current Version)

You need Qt to build X2Go Client from source.

Qt-4.8.6 is tested and recommended for X2Go Client 4.0.3.0 and later.

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

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

Installing Qt (Old Version)

Qt-4.8.5 was tested and recommended for X2Go Client 4.0.2.1 and earlier. It is still an option for X2Go Client 4.0.3.0 and later.

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

In this example D:\Qt\4.8.5 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:

For MinGW 4.4:

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

For MinGW 4.8:

d:\OpenSSL-Win32\include\openssl -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\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.

For Qt 4.8.5:

$ configure -release -static -openssl

For Qt 4.8.6, the command is different due to QTBUG-38706:

$ configure -release -static -openssl -qt-style-windowsxp -qt-style-windowsvista

For either version of Qt, 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.

For Qt 4.8.5:

$ configure -release -openssl

For Qt 4.8.6, the command is different due to QTBUG-38706:

$ configure -release -openssl -qt-style-windowsxp -qt-style-windowsvista

For either version of Qt, rebuild Qt:

$ make sub-src

Installing libssh

You need libssh to build X2Go Client.

X2Go Client 4.0.3.0 and later use libssh 0.6.3 with pageant support. Get the library package built with either MinGW 4.4.0 or MinGW 4.8.x (currently 4.8.2) from here on our site.

Extract files from archive.

Copy headers files in “include” directory of MinGW.

For MinGW 4.4:

libssh\include\libssh -> d:\mingw\include\libssh

For MinGW 4.8:

libssh\include\libssh -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\include\libssh

Copy library files in “lib” directory of MinGW

For MinGW 4.4:

libssh\lib\*.* -> d:\mingw\lib\

For MinGW 4.8:

libssh\lib\*.* -> d:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\i686-w64-mingw32\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
$ cd x2goclient

Generate the changelog, which x2goclient.exe –changelog will show:

$ copy debian\changelog txt\
git --no-pager log --since "2 years ago" --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%d%n" > ChangeLog.gitlog
$ copy ChangeLog.gitlog txt\git-info

Build X2Go Client:

$ cd x2goclient
$ PATH=%PATH%;D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin\
$ config_win.bat
$ mingw32-make
$ cd x2gohelper
$ mingw32-make
$ cd ..

X2Go Client binaries (x2goclient.exe & x2gohelper.exe) are in d:\build\x2goclient\release\ directory.

Build X2Go Client from source (debug build)

Repeat the instructions for “Build X2Go Client from source”, except

  1. Before running config_win.bat, edit x2goclient.pro so that “CONFIG += console” is uncommented
  2. Edit nsis\x2goclient.nsi so that the following lines:
  • CreateShortCut “$INSTDIR\X2Go Client.lnk” “$INSTDIR\x2goclient.exe”
  • CreateShortCut “$SMPROGRAMS\$STARTMENU_FOLDER\X2Go Client.lnk”
  • CreateShortCut “$DESKTOP\X2Go Client.lnk” “$INSTDIR\x2goclient.exe”

Are replaced with the following:

  • CreateShortCut “$INSTDIR\X2Go Client.lnk” “$INSTDIR\x2goclient.exe” “–debug”
  • CreateShortCut “$SMPROGRAMS\$STARTMENU_FOLDER\X2Go Client.lnk” “$INSTDIR\x2goclient.exe” “–debug”
  • CreateShortCut “$DESKTOP\X2Go Client.lnk” “$INSTDIR\x2goclient.exe” “–debug”

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. If you are using MinGW 4.4, add its libraries (copy from D:\MinGW\bin)
    • libgcc_s_dw2-1.dll
    • mingwm10.dll
  3. If you are using MinGW 4.8, add its libraries (copy from D:\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\mingw32\bin)
    • libgcc_s_dw2-1.dll
    • libstdc-6.dll * libwinpthread-1.dll - Add OpenSSL libraries (copy from your OpenSSL installation directory) * ''libeay32.dll'' * ''ssleay32.dll'' - libssh library ([[wiki:development:build-howto-mswin:x2goclient#installing_libssh
wiki/development/build-howto-mswin/x2goclient.1414721368.txt.gz · Last modified: 2014/10/31 02:09 by mikedep333