IGEL Thin client: redirection of removable USB mass storage in Citrix

IGEL is a german manufacturer of thin client who begin to be famous in Europe since 2 years. IGEL provides several thin client (Linux, Windows) and a solution for converting standard PC in thin client (Universal Desktop Converter 2).  The advantage of IGEL is to provide a powerful management console to configure devices.

The problem…

During a PoC of thin client (UD3-LX and UDC2), i found a bad thing in Citrix session. My local USB stick don’t appear in session. After few investigations i found that a Citrix policy blocked the redirection of local storage.

Contrary to others manufacturers, IGEL don’t redirect USB Mass storage like « removable storage » but like « local storage ».

After several hours of reverse engineering, i found that the IGEL system mounts USB stick in « /media/ » with « ln » command. In this case, the Citrix Receiver isn’t capable to redirect the device like « removable device ».

… and the solution

The solution is to write a little bash script to automatically mount USB mass storage in « /media/ » with the command « mount » (Thanks to UDEV rules). This script must to enable the parameter « CDMAllowed » in wfclient.ini (Citrix Receiver configuration file).

For applying this script on your thin client, you have to create a profil and add the script in « System / Firmware Customization / Custom commands / Reconfiguration commands ». This script is executed after local and UMS configurations.

System / Firmware Customization / Custom commands / Reconfiguration commands:

# UDEV rule for automounting USB with « mount »
if [ ! -f /etc/udev/rules.d/11-media-by-label-auto-mount.rules ] ; then
touch /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘KERNEL!= »sd[a-z]* », GOTO= »media_by_label_auto_mount_end »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘IMPORT{program}= »/sbin/blkid -o udev -p %N »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘ENV{ID_FS_LABEL}!= » », ENV{dir_name}= »%E{ID_FS_LABEL} »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘ENV{ID_FS_LABEL}== » », ENV{dir_name}= »usbhd-%k »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘ACTION== »add », ENV{mount_options}= »noatime »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘ACTION== »add », ENV{ID_FS_TYPE}== »vfat|ntfs », ENV{mount_options}= »$env{mount_options},rw,nodev,nosuid,utf8,fmask=0111,dmask=0000″‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘ACTION== »add », RUN+= »/bin/mkdir -p /media/%E{dir_name} », RUN+= »/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name} »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘ACTION== »remove », ENV{dir_name}!= » », RUN+= »/bin/umount -l /media/%E{dir_name} », RUN+= »/bin/rmdir /media/%E{dir_name} »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
echo ‘LABEL= »media_by_label_auto_mount_end »‘ >> /etc/udev/rules.d/11-media-by-label-auto-mount.rules
fi
# Reload UDEV rules
udevadm control –reload-rules

# Enable CDMAllowed in wfclient.ini
if [ ! -f /etc/udev/rules.d/setDynamicCDMOn.sh ] ; then
touch /etc/udev/rules.d/setDynamicCDMOn.sh
echo ‘#!/bin/sh’ >> /etc/udev/rules.d/setDynamicCDMOn.sh
echo ‘if grep -q « DynamicCDM=Off » /usr/lib/ICAClient/nls/en/wfclient.ini; then’ >> /etc/udev/rules.d/setDynamicCDMOn.sh
echo ‘cat /usr/lib/ICAClient/nls/en/wfclient.ini | sed « s/DynamicCDM=Off/DynamicCDM=On/g » >> /usr/lib/ICAClient/nls/en/wfclient.temp’ >> /etc/udev/rules.d/setDynamicCDMOn.sh
echo ‘mv /usr/lib/ICAClient/nls/en/wfclient.temp /usr/lib/ICAClient/nls/en/wfclient.ini’ >> /etc/udev/rules.d/setDynamicCDMOn.sh
echo ‘fi’ >> /etc/udev/rules.d/setDynamicCDMOn.sh
chmod +x /etc/udev/rules.d/setDynamicCDMOn.sh
fi
/etc/udev/rules.d/setDynamicCDMOn.sh

This script is not perfect. It’s free to use and improve!

In this profil you have to enable this others options:

  • Devices / Storage devices / USB Storage Hotplug –> Set the maximum number of USB Stick (different to 0!)
  • Devices / Storage devices / USB Storage Hotplug –> enable read and write ICA redirection
  • Sessions / Citrix / ICA Standard / Native USB Redirection –> Enable and Allow

Be careful, don’t apply two differents profils which use « Reconfiguration commands » on the same thin client. One of the two profils will not apply! (Add all « reconfiguration commands » in one profil)

January 2015: IGEL registered a request to add new feature for native redirection of removable USB mass storage… Wait and see.