Creating a DSL based ICA Thin Client CD


Forum: Other Help Topics
Topic: Creating a DSL based ICA Thin Client CD
started by: SCOEIT

Posted by SCOEIT on Dec. 29 2006,23:53
I apologize for the length of this post – but this is what it took to:

Creating a Linux based thin client for Citrix

I.  Purpose of the project:

This project grew out of a need to recycle 20-30 older classroom computer systems for use with a Citrix Presentation Server 4.0 server farm.  Citrix is a terminal server system, and a very cost effective way to provide stable ana easily managed computer systems to classrooms, while avoiding the costs of purchasing, managing and replacing 30 standalone computers.

II. Selecting the solution:

We wanted a CD based solution.  Some folks recommended simply stripping down Windows 2000 Pro or Windows XP pro, restricting access by the students via group policies, then imaging this onto multiple computers.  This is certainly a viable model; however it still leaves you with 20 computers with hard drives to manage.

Others recommend a Linux based system using a server and a PXE boot. This is also viable, however it requires a server, and its attendant hassles, and is a single point of failure.  CD’s are cheap, and once you have a working build you can duplicate CD’s as often as you need.  You can remove the hard drives from the student systems, and greatly reduce your management overhead.

III. Why DSL?

The first major challenge was finding a linux build that boot the majority of test computers without issues.  This means with little or no hassle the build had to boot the system, find and configure the network interface card, and allow full control of the video card and sound system.  Many versions of linux were tested, and Damn Small Linux < http://www.damnsmalllinux.org > was the only build to fire up the vast majority of systems it was tested on first time.

An additional challenge was my complete lack of experience with Linux.

Making this work is broken down into several phases.  I am very specific about how to do this.  I was completely dumb about Linux, and struggled to “read between the lines” in the DSL forums.  I tried to include all the things I learned to prevent confusion for beginners.

Phase 1.   Prep a system to do CD remasters.

Download and create a bootable CD of the base DSL version – This can be done at < http://www.damnsmalllinux.org. >  I used DSL-3.1-syslinux.iso.  I have since been asked why I selected this version, and the answer is I didn’t know any better.  I’ve been told that DSL-3.1.iso uses less memory.  I got the syslinux version to work and decided to stick with it.  You can download the iso of your choice and make a bootable CD with whatever your favorite package is.

If you want to skip the ICA Client install hassle you can download a working .iso from my Web site:  < http://www2.sutter.k12.ca.us/dsl/dsl.htm >.  Download the appropriate iso and burn it to a CD.

The system you remaster on will require someplace to store the remaster.  I used an old Gateway laptop with a 10 gb hard drive.  It was booted with the CD, and the internal hard drive was used to store the source files for the remaster.

Prep and mount the hard drive:

Open a shell window (Right click the desktop and select XShells, Root Access)
View the available drives:  
#fdisk –l  (the default for the first HD is hda)
Use cfdisk to create partitions to store your files:
#chdisk /dev/hda
I create multiple 1000mb partitions so I can store different images.  Once you have the partitions you want make sure you write the partition table before you exit cfdisk.

Format the partitions:  
#mke2fs /dev/hda1
Do this for all the separate partitions you created.
At this point you will have to reboot so the new partition table can be read and you can mount the partitions

Upon reboot open an XShell as superuser and mount the partition you want to use:  
#mount –rw /dev/hda1 /mnt/hda1

Phase 2A:  Install the ICAClient and its dependent packages from scratch.  If you download the iso from my site you can skip this step and go right to Phase 2B.

You can download the Citrix ICA Client for Linux version 9.0 from < http://www.citrix.com. >  However, that version needs Motif 2.2.x to run.  I could not figure out how to download and install Motif.  Thankfully SUNACK, a user on the DSL Forum discovered an older version ICA Client for Linux ver 8.6, that will work.  That thread can be found on the forum here: < http://damnsmalllinux.org/cgi-bin....+client > Thank you SUNACK.  To make sure that version stays available I also placed it on my Web site:  < http://www2.sutter.k12.ca.us/dsl/dsl.htm >

Open Firefox from your CD booted system, navigate to the link above and download the client.  The client will be stored in /ramdisk/home/dsl.

Installing the ICA Client:  (Thanks to FIRECAT53 for these instructions)

On the desktop click “MyDSL”, “System”
Select dsl-dpkg.dsl.info, then select “Download”, then “Download” again.
Select “System” again and select “gnu-utils.dsl.info and select “Download”, then “Download” again
This will download these two packages to /ramdisk/tmp
Load the gnu-utils locally:
MyDSL, Load Local, Select gnu-utils.dsl and select OK (Don’t worry about dsl-dpkg.dsl right now)

You then need to Enable Apt and update and install – you can Enable Apt by right clicking the desktop, selecting Apps, Tools, or you can run all three from a shell window as the super user:
# dpkg-restore
# apt-get update
# apt-get install cpio libxaw6

Install the ICA Client:
# cd /ramdisk/home/dsl
# tar –zxvf linux linuxx86.7.17.tgz
#./setupwfc (This installs the ICA Client.  Accept the defaults – don’t worry about the Netscape and Gnome warnings)

Test the ICA Client:
# /usr/lin/ICAClient/wfcmgr

This should open a client window.  You can now setup the connections to your Citrix system as you wish.  These settings are stored in /ramdisk/home/dsl/.ICAClient/appsrv.ini

You can also create a desktop icon to run the client by right clicking the desktop, selecting Icon Tool and setting up an icon.  This icon will be stored in /ramdisk/home/dsl/.xtdesktop (I called mine Citrix and its file name is Citrix.lnk)

Do the remaster:

Create directories on the hard driver for the source files (Thanks to MEO – this is lifted pretty much from his Remastering How To)

Quote

#mount -rw /dev/hda1 /mnt/hda1

Make the directories needed

#mkdir /mnt/hda1/source
#mkdir /mnt/hda1/newcd
#mkdir /mnt/hda1/newcd/KNOPPIX

Copy necessary files to directory /newcd

#cp -Rp /cdrom/autorun.bat /mnt/hda1/newcd (This file may not exist)
#cp -Rp /cdrom/autorun.inf /mnt/hda1/newcd (This file may not exist)
#cp -Rp /cdrom/index.html /mnt/hda1/newcd

Copy files to directory /newcd/KNOPPIX

#cp -Rp /cdrom/KNOPPIX/boot.cat /mnt/hda1/newcd/KNOPPIX
#cp -Rp /cdrom/KNOPPIX/boot.img /mnt/hda1/newcd/KNOPPIX

Copy the sources to the right directory

#cp -Rp /KNOPPIX/* /mnt/hda1/source
#cp -Rp /KNOPPIX/.bash_profile /mnt/hda1/source


Now you need to do some things to make sure APT-GET GNU-UTILS and DSL-DPKG are installed and working on the remaster, and your Citrix settings and icon are on the remaster.

Make sure the dsl-dpkg and gnu-utils make it to the remaster:
# mkdir /mnt/hda1/newcd/mydsl
# cp /ramdisk/tmp/dsl-dpkg.dsl /mnt/hda1/newcd/mydsl
# cp /ramdisk/tmp/gnu-utils.dsl /mnt/hda1/newcd/mydsl

Copy the Citrix icon to the remaster source:
# cp /ramdisk/home/dsl/.xtdesktop/Citrix.lnk /mnt/hda1/source/etc/skel/.xtdesktop

Copy the appsrv.ini to the source directory:
Right click the desktop, select Apps, Tools, Midnight Commander as super-user
In the left window navigate to: /ramdisk/home/dsl/.ICAClient/
Highlight appsrv.ini and click the VIEW icon to make sure your settings are in this file.
In the right window navigate to /mnt/hda1/source/usr/lib/ICAClient/config/
Highlight appsrv.ini (make sure it is the one in /mnt/hda1/source/usr/lib/ICAClient/config?) and tap F8 to delete the file
Go back to the left window where /ramdisk/home/dsl/.ICACLient/appsrv.ini should still be highlighted and tap the COPY icon to copy it to the source directory – highlight it in the right window and click VIEW to verify the changes made it over.
Repeat this for the /mnt/hda1/source/usr/lib/ICAClient/.config/appsrv.ini file

Make sure APT-GET runs on the remaster: (Again, thanks to MEO)

Quote

#chroot /mnt/hda1/source
#mount -t proc /proc proc
#dpkg-restore
#apt-get update
#apt-get install cpio libxaw6
#umount /proc


At this point you are ready to remaster.  I have found that I sometimes have to reboot to successfully create the compressed image.  If so, simply report, then remount the source drive:
#mount –rw /dev/hda1 /mnt/hda1
Then go to Phase 3 to create the remaster.

Phase 2b:  If you want to skip the ICAClient install hassle from above you can download my iso that already has the ICAClient installed and working from < http://www2.sutter.k12.ca.us/dsl/dsl.htm >)

Do the remaster:

Create directories on the hard driver for the source files (Thanks to MEO – this is lifted pretty much from his Remastering How To)

Quote

#mount -rw /dev/hda1 /mnt/hda1

Make the directories needed

#mkdir /mnt/hda1/source
#mkdir /mnt/hda1/newcd
#mkdir /mnt/hda1/newcd/KNOPPIX

Copy necessary files to directory /newcd

#cp -Rp /cdrom/autorun.bat /mnt/hda1/newcd (This file may not exist)
#cp -Rp /cdrom/autorun.inf /mnt/hda1/newcd (This file may not exist)
#cp -Rp /cdrom/index.html /mnt/hda1/newcd

Copy files to directory /newcd/KNOPPIX

#cp -Rp /cdrom/KNOPPIX/boot.cat /mnt/hda1/newcd/KNOPPIX
#cp -Rp /cdrom/KNOPPIX/boot.img /mnt/hda1/newcd/KNOPPIX

Copy the sources to the right directory

#cp -Rp /KNOPPIX/* /mnt/hda1/source
#cp -Rp /KNOPPIX/.bash_profile /mnt/hda1/source


Test the ICA Client:
# /usr/lin/ICAClient/wfcmgr
Or use the Icon I created.

This should open a client window.  You can now setup the connections to your Citrix system as you wish.  These settings are stored in /ramdisk/home/dsl/.ICAClient/appsrv.ini

You can also create a new desktop icon with a different name if you wish to run the client by right clicking the desktop, selecting Icon Tool and setting up an icon.  This icon will be stored in /ramdisk/home/dsl/.xtdesktop (I called mine Citrix and its file name is Citrix.lnk, and it is already present)

Copy any new icons you create to the remaster source:
# cp /ramdisk/home/dsl/.xtdesktop/youricon.lnk /mnt/hda1/source/etc/skel/.xtdesktop

Copy the appsrv.ini to the source directory:
Right click the desktop, select Apps, Tools, Midnight Commander as super-user
In the left window navigate to: /ramdisk/home/dsl/.ICAClient/
Highlight appsrv.ini and click the VIEW icon to make sure your settings are in this file.
In the right window navigate to /mnt/hda1/source/usr/lib/ICAClient/config/
Highlight appsrv.ini (make sure it is the one in /mnt/hda1/source/usr/lib/ICAClient/config?) and tap F8 to delete the file
Go back to the left window where /ramdisk/home/dsl/.ICACLient/appsrv.ini should still be highlighted and tap the COPY icon to copy it to the source directory – highlight it in the right window and click VIEW to verify the changes made it over.
Repeat this for the /mnt/hda1/source/usr/lib/ICAClient/.config/appsrv.ini file

Phase 3 - Create the iso

Again – Thanks to MEO for these instructions:

Quote

Create the custom compressed image file:

#mkisofs -R /mnt/hda1/source | create_compressed_fs - 65536 > /mnt/hda1/newcd/KNOPPIX/KNOPPIX

Create the iso-file as follows:

#cd /mnt/hda1
#mkisofs -r -J -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o myknoppix.iso newcd


You now need to burn the new iso.  If you are a Windows type like me the easiest way is to transfer the iso file to a windows share.  Open an XShell as super-user and issue these commands:

#cd /mnt/hda1
#smbclient //server/sharename –U Username
Enter your password, once connected simply enter “put myknoppix.iso”

Once the transfer is made you can burn and test the image.  You can now use this image as a starting point for the next step.

Phase 4 – strip down the desktop.

You may not need this step – my distro will be used in a classroom full of high school students, and I need to limit what they can do.

After some thought I figured out the sneaky way to do this was to eliminate all the icons from the desktop except the citrix icon, then strip away all the right click icons.  DSL boots automatically as the DSL user.  The DSL user has enough rights for a student with unfettered access to potentially cause some issues.  By removing the icons and the right click menus, it is difficult for the student to do much except run the ICA Client.  I’m sure the hard core Linux heads could think of a way around this.  They are welcome and encouraged to post suggestions of a better for us Windows wieners.

Remove Icons:
To strip down the icons open Midnight Commander as super-user (Right click, Apps, Tools, Midnight Commander as super-user)
Navigate to /mnt/hda1/source/etc/skel/.xtdesktop and use the F8 key to delete everything except:
Citrix.lnk (Or your custom icon.link)
binary.png
gear.png
program.png
shellscript.png
synaptic.png

Remove Right Click menus:
#sudo beaver (opens the Beaver text editor as super-user)
Click the file open icon and type this in the selection window: /mnt/hda1/source/etc/skel/.fluxbox/menu
Then edit the menu file however you want.  I left only one choice, the Xvesa option on the system menu.  This allows you to change desktop resolution if you are on an old system.  

If you are lazy, I put a my menu file in /opt on the icaclient.iso – you can just copy it to /mnt/hda1/source/etc/skel/.fluxbox using Midnight Commander as super-user

I’m sure the real experts can – if they can make it through this huge post – make suggestions to stream line this.  That is both welcome and encouraged.

Redo the master per the instructions above:

Quote

Create the custom compressed image file:

#mkisofs -R /mnt/hda1/source | create_compressed_fs - 65536 > /mnt/hda1/newcd/KNOPPIX/KNOPPIX

Create the iso-file as follows:

#cd /mnt/hda1
#mkisofs -r -J -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o mystripped.iso newcd



Thanks to MEO, ROBERTS, SUNACK, and ^thehatsrule^ for the help in figuring this out.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.