Tuesday, April 6, 2010

How to make the Citrix ICA client work on 64-bit Linux

Time to dust off this old blog...

I wasted a couple of hours yesterday to make the Citrix client work on Fedora Core 12 64-bits. Unfortunately I need to use Citrix to access my company's network. I hate Citrix with a passion. If by any chance you find this page with Google, hopefully it will save you a couple of hours.

Citrix does not provide a 64-bit version of their client for Linux, only a 32-bit version. That means you need to find the libraries it needs and install the 32-bit versions of these libraries on your system. Most modern distributions ship with a kernel that can execute both 64-bit and 32-bit applications, and unless you explicitly recompiled your kernel to disable this support you should be fine. On Fedora, the 64-bit shared libraries are in different directories than the 32-bit versions, like for instance /usr/lib64 and /usr/lib (I have been told that Debian and Ubuntu use exactly the opposite).

Note: you do NOT need to install a 32-bit version of Firefox on your system. I have Citrix working fine with the default 64-bit Firefox.

Here is how to proceed. First, download the Citrix ICA client tarball from http://www.citrix.com . Untar it and install it as root like so:

$ tar xzf linuxx86.tar.gz
$ su
# ./setupwfc

Follow the instructions of the script. If you decide to install it in a different directory than the default, remember to add "export ICAROOT="install dir" in your .bashrc file.

That was the easy part. Now you can check if it works by going to your company's web site and clicking on the link for remote connectivity, and chances are - it will not. If you start Firefox in a terminal you will see errors complaining about missing libraries, like for instance libXaw.so.7, libXmu.so.6 or libXpm.so.4.

You can actually use the ltrace tool to see what libraries it is trying to load and from where. Instead of clicking on the link in your browser, save the .ica file somewhere (right click and "save as..."). Mine was called launch.ica. Then try to open this file directly with the Citrix client prefixed by ltrace:

$ ltrace -S ./wfica -file ~/Downloads/launch.ica

It will show you all the shared libraries it is trying to load, with full paths. You can then add the missing 32-bit libraries by copying them from another machine that runs a 32-bit Linux, or you can install them with your favorite package manager. On Fedora, use "yum provides" to get the name of the package that provides a library, and "yum install" to install the missing package. Note that for 64-bit Fedora it will give you 2 versions of the same package, a 64-bit one and a 32-bit one. For example:

# yum info PackageKit-gtk-module
Loaded plugins: presto, refresh-packagekit
Installed Packages
Name : PackageKit-gtk-module
Arch : i686
Version : 0.5.7
Release : 2.fc12
Size : 228 k
Repo : installed
From repo : updates
Summary : Install fonts automatically using PackageKit
URL : http://www.packagekit.org
License : GPLv2+
Description: The PackageKit GTK+ module allows any Pango application to install
: fonts from configured repositories using PackageKit.

Name : PackageKit-gtk-module
Arch : x86_64
Version : 0.5.7
Release : 2.fc12
Size : 229 k
Repo : installed
From repo : updates
Summary : Install fonts automatically using PackageKit
URL : http://www.packagekit.org
License : GPLv2+
Description: The PackageKit GTK+ module allows any Pango application to install
: fonts from configured repositories using PackageKit.

In the example above, the first one is 32-bit (arch = i646) and the second one is 64-bit (arch = x86_64). Both are installed, but if the 32-bit version was not, you could force the 32-bit installation with "yum install PackageKit-gtk-module.i686" (notice the .i686 extension for 32-bit).

Once you have all required libraries installed (it may take a few iterations), you may still face a problem: Citrix complains about missing fonts. Again you need to start Firefox from a terminal to see this:

Warning: Missing charsets in String to FontSet Conversion
Warning: Unable to load any usable fontset
Error: Aborting: no fontset found

Of course it doesn't tell you much about what the problem really is. Some people have been able to fix it as follow:

# cd /usr/share/fonts/cjkuni-uming/
# mv fonts.dir fonts.dir.old
# mv fonts.scale fonts.scale.old

In my case that did nothing. The problem was that by default the shell LANG variable was set to "en_US.UTF-8". Doing simply this fixes the problem:

$ export LANG=C
$ # restart firefox
$ firefox&

Alternatively you can export LANG=C in your .bashrc to make Citrix work even if you don't start Firefox from a shell. Remember to log off and back on to make this take effect.

Hope this helps! Here is the Bloomberg terminal in Citrix on Fedora Core 12.