Index

Index

Disclaimer

Introduction

Main features

Limitations

Setting up your LPSW environment

Setting up the spooling server basics

Setting up a LPSW

Setting up a shared printer

An example

To do

Disclaimer

Welcome to LPSW “The Linux Printer Server for Windows networks (on a single floppy)”

LPSW is free software and is supplied on an as is basis in the hope that it will be useful to other people. The author offers no warranty of its fitness for any purpose whatsoever, and accepts no liability whatsoever for any loss or damage incurred by its use.

LPSW is not a supported product. The author accepts no commitment or liability to address any problems that may be encountered in using it; however, the author is interested to hear about any bugs or deficiencies.

LPSW is licensed under the GNU General Public License (GPL 2.0).

Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000 and Windows XP are trademarks of Microsoft Corporation, Winzip is a trademark of Winzip Computing Incorporated, Winrar is a trademark of Eugene Roshal, Rawwritewin is a trademark of John Newbigin.

 

Index

What is LPSW?

LPSW means Linux Printer Server for Windows networks.

It is a single floppy Linux distribution that will help you configuring one to many Windows printer servers hopefully reusing old PCs.

You only need a 486 or later PC with 16MB of RAM and a floppy drive. You can also throw away its mouse and keyboard ad use its monitor and its HD somewhere else.

Do you have an unused obsolete PC? Or is your company plenty of obsolete PCs?

Do you need a printer server for your Windows network? Or do you need many printer server?

You do not want to use Windows? Because, perhaps, you want use its precious and expensive license on another PC, not wasting it on a stupid printer server.

Ok, take the old PCs, throw away the keyboards, the mice, use the monitors on for other uses, remove also hard disks and CDROM drives. The only things you will need are the PC itself, a network interface card (if the main board does not have one included) and a diskette drive!

Well, needing some shared printers in my company, when I realized that I had three identical old PCs (all with the hard disk missing, maybe some of them died, maybe some were used on other PCs), I decided to transform them in printer servers.

The problem was finding the hard disks for them without having to waste money in buying them new.

I also wanted not to waste precious and expensive Windows licenses on them, so I decided to investigate the possible use of Linux (many thanks to Linus Torwalds, without him nothing of this would have been possible).

I searched the Internet looking for something already configured (or easy to do), but I did not succeed.

Anyway I found some interesting Linux distributions like Coyote Linux, Linux Router Project (LRP) and Giotto, just to mention some of them (but you can find others) running on a single diskette.

None of them was easily adaptable to act as Windows network printer servers.

I found that Giotto, thanks to the author Wolfgang Zekoll, was very easy to configure anyway.

So I adopted it to develop my Linux Printer Server for Windows networks (LPSW).

I took some months to do the job (I do not have much free time to spend), but finally I did it!

My idea was to make a printer server without any hard disk, using some other PC’s disk space as spooling area.

In order to reach my target I had to Giotto both Samba client and server, and then to add the printer daemon (lpd).

Adding the Samba client was easy enough (because it was one of the Giotto options), but adding the Samba server was very hard: the server was not working properly (even if it was not giving any particular error into the log files), only after a long testing period, I realized that it needed a more recent shared library, the problem was then finding the space on the floppy for it (the new library was lot greater than the original) and the Samba daemons that were very big.

This was not enough because I had to add also the printer daemon, here I found that it was not able to use symbolic links on Samba mounted shares, to solve this problem I had to patch the lpd code recompiling it.

I also ported the printer information file translator from Linux to Windows (with the help of DJGPP by DJ Delorie) in order to be able to add any new printer without even having the need to access the LPSW console at all, doing everything on a Windows PC.

Then I added some additional features in order to configure one to many printer servers on the same network in a very simple and straightforward way.

 

Index

Main features

Here are some of these interesting features:

 

Index

Limitations

And now some limitations:

 

Index

Setting up your LPSW environment

All you need is:

Now do the job. You can setup everything dividing it in three procedures (it would take you no more than 15 minutes each, lot less than setting up a single Windows based printer server from scratch):

In the following description I will give just a configuration example, obviously change everything you need to fit your situation.

 

Index

Setting up the spooling server basics

Setting up the spooling server basics (you will need administrator rights if it runs Windows NT, Windows 2000 or Windows XP):

  1. On the selected spooling server create a new directory and share it with full permissions for everyone.
  2. With your favourite Windows text editor create a file named servers.ini into the shared directory with the following section and parameters (section and parameter names cannot be changed, all the values must reflect your specific configuration):

[drivers] # this section gives definitions for storing the drivers for the used printers.

dir = <drivers directory> # the directory where the printer drivers will be stored.

file = <printers definitions file> # the file that lists the drivers needed by each printer.

  1. Now create a new directory for storing printer drivers inside this shared directory (this can be useful if you have Windows 95, Windows 98 or Windows ME based PCs in your network and you wish your LPSWs to supply the needed drivers for all the printers you use on first access to the printers).
  2. Using winzip or winrar extract the files from LPSW-1.0.0.tar.gz into a temporary directory.
  3. Copy the mkprdef.exe file into the drivers directory.
  4. Using rawwritewin open the file LPSWadd.img and create the LPSWadd floppy disk.
  5. You can also protect the LPSWadd floppy against unwanted writings, you will need it just when creating a new LPSW PC.

 

Index

Setting up a LPSW

Setting up a LPSW:

  1. On the spooling server, using rawwritewin, open the file LPSW.img and create the LPSW floppy disk.
  2. Inside the shared directory create a new server directory.
  3. Inside the server directory create a printers.ini file and add the following a section to it (section name and parameter names cannot be changed, the values can be just true or false in order to enable or disable the respective printer port):

[printers] # this section list and enables or disables the printer ports of the LPSW.

lp1 = false # disable the lp1 printer port.

lp2 = false # disable the lp2 printer port.

  1. Now edit the servers.ini file into the shared directory to add the following a section for the new LPSW (section name is the printer server IP, parameter names cannot be changed, all the values must reflect your specific configuration):

[<printer server IP>] # the IP address of the specific LPSW.

name = <printer server name> # the NetBios name of this LPSW.

dir = <server directory> # the name given to the server directory assigned to this LPSW.

comment = <server comment> # the comment that will appear browsing this LPSW.

workgroup = <server workgroup> # the name of the workgroup this LPSW is assigned to.

  1. On the new LPSW PC check the BIOS settings in order to enable booting from the floppy drive (and setting it as the first in the boot order).
  2. Insert the LPSW floppy into the printer server drive and boot it.
  3. Just after the LILO boot prompt, before the boot timeout will expire, type LPSW 5 to enter in configuration mode.
  4. At the login prompt type root to login the LPSW PC.
  5. Insert the LPSWadd floppy and type mount /dev/fd0 /disk to mount it.
  6. Change directory to / with cd /.
  7. Extract the addon files from it by typing tar xvzf /disk/add.tgz.
  8. If you are not in the United States or do not like the US keyboard, identify the file of your keyboard and type gzip –dc /x/keymaps/<country code>.map.gz | /bin/loadkeys to load your keyboard mapping immediately.
  9. Type umount /disk to unmount the LPSWadd floppy.
  10. Now insert again the LPSW floppy and type mount /dev/fd0 /disk to mount it.
  11. Type rm /disk/etc/us.map.gz to remove the US keyboard map (and save precious floppy disk space).
  12. Type cp /x/keymaps/<country code>.map.gz /disk/etc to copy the map of your keyboard onto the floppy.
  13. Type ln -sf /disk/etc/<country code>.map.gz /disk/etc/keymap.gz to link it to the one used by default.
  14. Identify the correct network interface card driver for your LPSW PC and copy its module by typing cp /x/netmodules/<module name>.o.gz /disk/modules/net.
  15. Now type jpico /etc/lpsw.config to edit the main LPSW configuration file, change all the parameters in order to fit your situation:

[host] # this section configures the LPSW fixed settings.

modules = smbfs lp # do not modify this line, these modules are needed.

nicmodule = <module name> # driver module name (without .o.gz) of NIC in this LPSW.

ip = <printer server IP> # IP address of this LPSW.

[spool] # this section configures the spooling server fixed settings.

name = <spooling server name> # NetBios name of the spooling server.

share = <share name> # name assigned to the shared directory.

user = <user name> # user name used to access the share.

password = <password> # password used to access the share (if any).

ip = <spooling server IP> # spooling server IP address.

  1. You can replace the root password by typing passwd and then typing your new password twice.
  2. Type sync to flush data onto the floppy and reboot the LPSW PC.
  3. You can also protect the LPSW floppy against unwanted writings, you should not need to modify anything on it any more (except for replacing the network interface card, IP address redistributing in your network or similar things).

 

Index

Setting up a shared printer

Setting up a shared printer:

  1. On the spooling server, inside the server directory the printer is connected to, create a new spooling directory for this printer.
  2. Now edit the printers.ini file into the server directory to add the following section for the new printer (section name is the Linux printer port the printer is connected to, parameter names cannot be changed, all the values must reflect your specific configuration):

[<printer port>] # the Linux printer port the printer is connected to.

name = <printer name> # the NetBios name of this printer.

dir = <spooling directory> # the name of the spooling directory assigned to this printer.

comment = <printer comment> # the comment that will appear browsing this printer.

driver = <printer driver> # the exact name of the driver as it appears into configuration file.

  1. In the same file enable the corresponding printer port in the printers section:

lp1 = true # to enable the lp1 printer port or.

lp2 = true # to enable the lp2 printer port.

  1. If you have Windows 95, Windows 98 or Windows ME PCs in your network and would like your LPSW to be able to supply them the correct printer drivers at the first access to the printer through the network (when installing the printer on them), you need to create a printer definition file and to copy all the required driver files, so get the most recent drivers for the printer (you can find them in the most recent of these PCs or on the Internet from the printer producer site).
  2. Now, if you will use the drivers coming from a Windows based PC, copy the msprint*.inf files, or if you will use the drivers coming from the printer producer Internet site, copy the <specific printer information file> (.inf) file, into the drivers directory
  3. Open a DOS box on the spooling server and go to the drivers directory by typing cd <shared directory>\<drivers directory>.
  4. Here add a new record to the printers definitions file by typing mkprdef <printer information file> “printer name” <printers definitions file> (the first argument is the file that contains the original information for Windows based PCs, the second argument is the exact name of the printer as it appears inside the printer information file, the third argument is the file that carries the same information for Samba) for the this printer, if the printer definitions file does not exist it will be created, if it already exists simply a new record will be appended. You can edit the printer definitions file and modify the first field (the printer name), the best idea is to copy exactly the name that the same printer has on a Windows NT, Windows 2000 or Windows XP PC, doing this, the same printer should have the same name for all Windows based PCs.
  5. Now copy all the files that mkprdef.exe listed on the DOS box to the drivers directory (you can find them inside the Windows .cab files where the msprint*.inf file used was or together with the <specific printer information file>, do not care if they are compressed (with a trailing _ underscore) or not. Notice that if some files have been listed inside a directory, unless you modify the printer definitions file accordingly, you need to create this directory inside the drivers directory and put those files in it.
  6. Now, if you do not need them for other printers, you can also remove the .inf files from the drivers directory.
  7. Connect the printer to the LPSW PC and reboot it.
  8. Finally, after LPSW PC reboot, on all the Windows based PCs, install this printer (the printer should be recognized and all the PCs should be able to install the required drivers automatically).

 

Index

An example

This the most simple example where we have two PCs (on a workgroup named pcgroup), a Windows based PC (named spooler with IP address 192.168.1.240) and a Linux based PC or LPSW (named server1 with IP address 192.168.1.241) which has a 3com EtherLink III network interface card on the PCI bus and HP LaserJet 1100 connected to LPT1, this is the initial situation of the interested explorer trees (as seen from the Windows network):

\\spooler

\driversdir

\mkprdef.exe

\spooldir

\servers.ini

\serverdir1

\printers.ini

\printerdir1

\\server1

\printer1

Here is what we would have into the servers.ini file:

[drivers]

dir = driversdir

file = printers.def

[192.168.1.241]

name = server1

dir = serverdir1

comment = Printer Server 1

workgroup = pcgroup

Here is what we would have into the printers.ini file:

[printers]

lp1 = true

lp2 = false

[lp1]

name = printer1

dir = printerdir1

comment = Laser printer 1

driver = HP LaserJet 1100

Now what we would have into the lpsw.config file:

[host]

modules = smbfs lp

nicmodule = 3c509

ip = 192.168.1.241

[spool]

name = spooler

share = spool

user = root

password =

ip = 192.168.1.240

And finally this is the command we would execute in this case (inside the \\spooler\driversdir directory) in order to create the printers.def file (inside the same directory):

mkprdef hp2010p5.inf “HP LaserJet 1100” printers.def

Note that :

 

Index

To do

Now what I could do to improve further LPSW (if I find time and if I feel like) in the future:

 

Index