一片老文章

The Minimal Citrix Client (DOS)
(or Citrix-on-a-Floppy)
by Espen Koht
During a project I was involved with, we wanted to fit a Citrix client into a small a footprint as possible, so I set out to see how lean I could make a bootable disk with the client for a 486 PC. The reason we wanted it as small as possible was because we wanted to make the machines diskless, by network booting them and running from a RAM disk. At the end of the exercise I managed to fit the OS, IP stack and client on a 1.44Mb bootable disk. Although we don’t boot from a floppy as such, this is a convenient size, and it can be run from a floppy if someone has a need for something like that.
This is not a step-by-step how-to, but an overview of the final product with comments. It should make it pretty easy to recreate the disk for anyone with some experience, but you would have to do the work yourself!

I don’t offer any support with this, so if you have any problems I can’t promise a reponse. Feedback is still welcome though.

Netbooting (optional)
We neetboot our clients and run off a RAM disk. I won’t document this here. We use etherboot which is Linux oriented but also allows you to boot in DOS. The client assembled doesn’t have to be used this way, but is probably most useful this way.
Hardware (example)
The specs of the hardware we use is:
486 25SX and 33DX PC
4 Mb RAM
3com EtherLink III NIC
Built-in S3 video card

We wanted these to be very low maintenance, which is why we disconnected or removed the hard drives and opted for bootroms on the network cards, and RAM drives. We also wanted it to be cheap, so everything is free to use, with the only possible exception being the OS which you might need additional licences for.

It should work on slower CPUs too, and if you don’t use a RAM disk with a little less RAM (3Mb?). We have used NE2000 network cards with success too, but it would need a different driver (see the notes).

Client Functionality
Full screen Citrix client.
Non-configurable connection to a single application or desktop on a server or server farm.
Mapping of a printer on the local LPT (parallel) port.
Mapping of local floppy drive.
The client as described as no audio support. It should be possible to add it, but we have not tried it.
Client Disk Components
The client disk consists of 4 parts:

  1. The operating system, which is DOS due to its low footprint.
  2. The networking software, which is LanManager, which wouldn’t be my first choice, but does TCP/IP, and is free from Microsoft here. The client’s IP configuration is done by DHCP, which is supposed to be poor in LanManager, bu we haven’t had any problems in our single sub-net environment.
  3. The Citrix DOS Client. Available from download.citrix.com/
  4. Assorted utilities such as a client-side screen-saver.

Compression
To make even better use of the space, you will also need to compress some of the files (.exe .com .sys) with a utility like PkLite. Note that not all the executables are compressable (wfcdos32.exe for example).
Client Disk Content
Below is a listing of all the files on the client disk (directory contents are listed on seperate pages). The simplest way to build it is to do an install of LanManager and the Citrix client and configuring them they you want them to work with the client. Then you can move the files required over to the disk or disk image according to whether they are needed or not. You can then add some of additional utilities. The listings below will hopefully make it clear which files are needed or which are not. The top level directory looks like this:
(click on an item to see a comment or desciption of the item)
ANSI.SYS
AUTOEXEC.BAT
COMMAND.COM
CONFIG.SYS
IO.SYS
IPCONFIG.EXE
LANMAN.DOS (DIR) Jump to seperate web page

MSDOS.SYS
NOBREAK.SYS
REFRESH.EXE
SED.EXE
SHUTDOWN.MSG
TEMP (DIR)
VGASAVE.COM
WFCLIENT (DIR) Jump to seperate web page
WFCNAME.INI

ANSI.SYS
Only necessary because of the ‘fancy’ shutdown message we use between sessions to make it clear when it is best to shut down the machine.

AUTOEXEC.BAT
This is content of our AUTOEXEC.BAT with some comments. You will probably want to modify some of this to suit your own circumstances. Note that we are not making any assumptions about drive letters, as our bootroms could act as either A or C if we want to.
@ECHO OFF
SET TEMP=\temp
refresh 800 3
mouse
vgasave /c:900 /mirq:12

Here we start up a few useful things, including a client-side screen-saver and setting the refresh rate for the graphics chip-set we use.

SET PATH=\LANMAN.DOS\NETPROG;%PATH%
\LANMAN.DOS\DRIVERS\PROTOCOL\tcpip\umb.com
LOAD TCPIP
SOCKETS

This is LanManager stuff for loading the IP stack.

ipconfig > \temp\ip.tmp
sed -e “/IP Address/!d” \temp\ip.tmp | sed -e “s/.*196./ClientName = /” >> wfcname.ini

This is a bit of a hack to generate unique client IDs. It assumes all machines are in the same known subnet. Our IP numbers is of the form X.X.196.Y, and this simply obtains the IP for the machine, and gives it a client name equal to the Y part of the address. There are better ways of doing this, and SED is pretty powerful, so I’m sure you can do better yourself. The original ipconfig output is retained in /temp for troubleshooting purposes. This code appends to a file containing only “[WFCLIENT]” and it is assumed this gets reset by the fact that this is a downloaded ramdisk. For a genuine floppy client this assumption would be wrong, but you could do something similar by renaming the WFCLIENT.INI WFCLIENT.ORG and adding a line like COPY WFCLIENT.ORG WFCLIENT.INI before this routine.

cd \wfclient
VSL
go

CONFIG.SYS
DEVICE=\NOBREAK.SYS
DEVICE=\ANSI.SYS
DEVICE=\LANMAN.DOS\DRIVERS\DOSUTILS\HIMEM.SYS
BUFFERS=15,0
FILES=30
DOS=HIGH,UMB
LASTDRIVE=G
DEVICE=\LANMAN.DOS\DRIVERS\PROTMAN\PROTMAN.DOS /i:\LANMAN.DOS
DEVICE=\LANMAN.DOS\DRIVERS\ETHERNET\ELNK3\ELNK3.DOS
DEVICE=\LANMAN.DOS\DRIVERS\PROTOCOL\tcpip\tcpdrv.dos /i:\LANMAN.DOS
DEVICE=\LANMAN.DOS\DRIVERS\PROTOCOL\tcpip\nemm.dos
The one thing you need to change here is the 3rd to last line here to refer to the driver for your network card (this example is for the 3com Etherlink III driver ELNK3.DOS). Again note that we have removed drive letters.

DOS
We use DOS 5.0, since that is what we had available, but other versions should work too. You’ll need a bootable floppy or disk image (for network booting) with the three core DOS files, IO.SYS, MSDOS.SYS and COMMAND.COM. If you sys the disk from a newer version of DOS/Windows, make sure you erase any other (hidden) files that may get put on the disk.

NOBREAK.SYS
Optional. This simply stops the user from interrupting the batch files. Available from cuiwww.unige.ch/info/pc/remote-b … obreak.zip

REFRESH.EXE
Optional. A utility we use to set a higher than default refresh rate for the video cards in our clients. Your hardware may require something similar.

SED.EXE
Used in AUTOEXEC.BAT to process the text file containing the client’s IP number after it has been assigned by DHCP and generate a unique client name. Available from simtel.net/pub/simtelnet/msd … sed15x.zip

VGASAVE.COM
Optional. Client-side screensaver which works in both text and VESA modes, with mouse-wake and more. Free and available from simtel.net/pub/simtelnet/msd … ave200.zip

明天试试!