Mainly Neat Stuff --> Vintage Networking --> Using a Shared OS X Printer

Using a Shared OS X Printer

Apple's OS X 10.2 Jaguar operating system (onwards) includes CUPS but apart from a few geeks, nobody knows what to do with it. This document describes how to configure CUPS to share your USB colour inkjet printer (or similar) for use by older Macs. You'll need to download some free software that enhances the OS X CUPS software so that it acts as a PostScript RIP. Depending on the configuration of your older Mac, you may need to install software that allows you to print to a Unix-style LPD print queue.

For a fairly "modern" Mac (anything running System 7.1.1 or higher), you can print using Apple's desktop printing software as if using a standard PostScript colour printer on your local network. Good colour PostScript output can also be achieved with older Macs running System 6 or higher but the procedure is a little more clunky.

Credits: Daniel Steffen outlined how to share printers using OS X, the classic Unix LPD print service and CUPS in an article at Mac OS X Hints. I've fleshed out the details in his original piece and added descriptions on how to print from various Mac systems.

Assumptions: I assume that the user is familiar with installing Mac OS X software, knows the Administrator password for the Mac and that Macs on the local network are appropriately configured to use TCP/IP. No Unix expertise is required; the most important thing to remember is that Unix commands and filenames are case sensitive so you should type them exactly as shown in the text.

Installing Gimp-Print on Mac OS X

This procedure requires that your Mac is running OS X 10.2 or higher because it needs CUPS. CUPS is not readily available for older versions of Mac OS X.

Before starting, you will need to download the latest versions of ESP GhostScript (ESPGS) and Gimp-Print (see Useful Links). Each package is about 5Mb in size so you'll need to be patient if you're on a dialup connection. Gimp-Print supports most popular inkjet and laser printers (many more than Mac OS X alone) but you should still check that your own is supported. Read the distribution notes carefully to check whether the package is required or your version of Mac OS X is supported.

  1. Ensure that your printer is connected to your Mac and is switched on. When Gimp-Print is installed, it will try to communicate with your printer and the installation will fail if your printer can't be found.
  2. Install Gimp-Print in the standard way for a Mac OS X package. I'd recommend copying the How To Gimp-Print pdf document from the disk image to your hard disk at this point.
  3. Follow the first set of procedures in the How To Gimp-Print pdf entitled Setting up a USB Printer. When prompted to provide a Device Name, enter a name that contains only alphanumeric characters; do not include spaces, brackets, hyphens or any non-alphanumeric characters. The name I chose for my printer was SC760GP, short hand for "Stylus Color 760 Gimp-Print", which meant that my LPD queue would be created with a sensible name.

    When reading the CUPS and Gimp-Print documentation, you may have seen references to PPD files. These work in a similar way to Adobe's PPD files for PostScript printers to describe a printer's features.
  4. Ignore the procedures for network printing in the How To Gimp-Print pdf.
  5. Install ESP Ghostscript in the standard way for a Mac OS X package. The PostScript Support section in the How To Gimp-Print pdf describes how to print a PostScript test file and to set the default settngs (eg paper size) for your printer.

Configuring LPD on Mac OS X

LPD is a classic Unix service or daemon that manages print queues. It isn't enabled by default on Mac OS X which uses a different service. LPR is the protocol for printing to LPD print queues; LPR utilities have been written for most popular operating systems including classic Mac OS, Windows 95/98, Windows NT/2000/XP as well as Unix.

Checking for the xinetd Daemon

The LPD printing service on Mac OS X is managed by the xinetd daemon. When a remote computer makes a request to print via LPD, xinetd will start the LPD daemon to process the print job. Mac OS X does not enable xinetd by default; xinetd is started for the first time when you configure your Mac to run one of the services that depend on it. xinetd will continue to run after it has been started even when you restart your Mac.

Open a Terminal window. At the command prompt, type:

%  ps -ax | more
         

A list of all processs running on your Mac will be displayed similar to the one below:

  PID  TT  STAT      TIME COMMAND
    1  ??  Ss     0:00.05 /sbin/init     
    2  ??  Ss     0:00.15 /sbin/mach_init        
   51  ??  Ss     0:01.68 kextd
   69  ??  Ss     0:00.70 update
   73  ??  Ss     0:00.00 dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F
  104  ??  Ss     0:01.87 configd
  123  ??  Ss     0:00.31 /System/Library/CoreServices/SecurityServer -X
  166  ??  Ss     0:18.69 /System/Library/Frameworks/ApplicationServices.framew
  170  ??  Ss     1:00.64 /System/Library/CoreServices/WindowServer -daemon
  174  ??  Ss     0:00.25 /sbin/autodiskmount -va
  227  ??  Ss     0:00.12 syslogd
  238  ??  Ss     0:00.00 /usr/libexec/crashreporterd
  249  ??  Ss     0:00.12 /usr/sbin/mDNSResponder    
  261  ??  Ss     0:00.60 netinfod -s local
  266  ??  Ss     0:01.62 lookupd
  289  ??  Ss     0:01.78 /System/Library/CoreServices/coreservicesd -preload A
  294  ??  S      0:00.00 nfsiod -n 4
  295  ??  S      0:00.00 nfsiod -n 4
  296  ??  S      0:00.00 nfsiod -n 4
  297  ??  S      0:00.00 nfsiod -n 4
  308  ??  Ss     0:00.00 inetd
  more 

Check through the entries for the command below which confirms that xinetd is running:

xinetd -pidfile /var/run/xinetd.pid  

Press the spacebar to display the next screen of processes or press q if you want to return to the command prompt. 

If xinetd is running, proceed to the next stage. If you need to start xinetd, open the OS X System Preferences window and select Sharing. On the Services tab, start FTP Access. This is only a temporary requirement but it will ensure that xinetd will always start on your Mac. When you next restart your Mac, you should turn off FTP Access.

Enabling Printer Sharing

Open the OS X System Preferences window and select Sharing. On the Services tab, start Printer Sharing.

On the Firewall tab, click on the New button. From the Port Name pull down menu, select Other. In the Port Number field, type 515 and in the Description field type LPD.

Creating the LPD Config File

Open a Terminal window. At the command prompt, move to the config file directory by typing:

%  cd /etc/xinetd.d

At the command prompt, type:

%  sudo pico printer

Enter the administrator password when prompted. In the pico editor, enter the text below. Use the tab key to line up the text columns.

service printer
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        server          = /usr/libexec/cups/daemon/cups-lpd
        groups          = yes
        flags           = REUSE
}

Press Control-X to quit the editor. Press Y to confirm that the file should be saved and press Return to accept the file name 'printer'. Check that the file has been written correctly by typing:

%  cat printer

To enable the new LPD config file, you will need to restart xinetd. At the command prompt, type:

%  sudo killall -HUP xinetd

xinetd will take only a few moments to restart. To display the LPD queue name for your printer, type:

%  lpstat -v

The result will read something like this:

device for SC760GP: usb://EPSON/Stylus%20COLOR%20760?serial=T01040006060940230
device for Stylus_COLOR_760: //dev/null

Note that two printers are listed. In this example the first entry, SC760GP, is the LPD queue name for my printer which matches the name I provided for it when installing Gimp-Print. If you didn't use alphanumeric characters only when naming your printer, it may be displayed strangely; to correct it, delete the Gimp-Print printer in Mac OS X Print Center and recreate it with a sensible name.

Testing the LPD Service

You can test that your LPD service is working by typing (change SC760GP to the name of your LPD queue):

%  lpr -P SC760GP printer

This will print out the config file that you typed in. Gimp-Print will detect that you are printing a plain text file and format the output appropriately.

Printing From Mac System 7.1.1 or Higher

Recent versions of the Mac OS desktop printing software allow users to print directly from any application to an LPD print queue using LaserWriter 8.5.1 or higher. Mac OS 8.5 onwards will have a suitable version of the LaserWriter driver installed by default. For earlier versions of Mac OS, you will need to download LaserWriter 8.5.1 (see Useful Links). Users of Mac OS 8.0 will also need to upgrade to Mac OS 8.1.

You can create a desktop printer for your OS X shared printer by the following:

  1. Run the Desktop Printer Utility. This must be the version installed with LaserWriter 8.5.1 onwards.
  2. Select LaserWriter 8 and then the option Printer (LPR).
  3. Select a suitable PPD (PostScript Printer Description file). If you are only printing simple A4 or US Letter output, you can use the Generic or LaserWriter PPD. If you need more control of your output, you will need to identify a PPD file for a printer that has similar capabilities as your OS X shared printer (eg paper sizes, margins).
  4. Under LPR Printer Selection, enter the IP address of your OS X Mac and the LPD queue name (this is case sensitive).
  5. Click OK and save the desktop printer to your desired location.
  6. Print a test page to confirm that your new desktop printer works.

Note that the readme files for LaserWriter 8.5.1 lists the files that it installs. It may be possible to install these files manually on a System 7.1 Mac that has received the "usual enhancements" (eg Thread manager, Scriptable Finder etc) but I have not tested this.

Printing with Mac System 7.1 and 7.0

For earlier versions of the Mac System software, it is not possible to print to an LPD print queue directly from applications. Printing is a two step process: print the output into a PostScript file and then use an LPR utility to submit the PostScript file to a queue. "Print to File" is a standard option in the Print dialog for System 7 onwards.

For my first tests, I installed LaserWriter 8.4.1 on a Mac running System 7.1. This produced both colour and black and white PostScript files that printed on my OS X shared printer. A major limitation was that I could not select a PPD file which would have limited my paper size options to A4 or US Letter. This limitation is not present if your network has a real PostScript laser printer or a queue managed by an AppleShare server.

Adobe's PostScript driver 8.5.1 works with System 7.1 and provides a Virtual Printer option that allows you to select a different PPD when you don't have a real printer present. You will need to use this driver combination (see Useful Links) if you need to print to different paper sizes.

Printing with Mac System 6

Apple's standard LaserWriter 7 driver was unable to produce working PostScript files that would print to my OS X shared printer. As an alternative, I installed the last version of Adobe's PostScript driver that supports System 6, PSPrinter 8.2.1. The only copy I could locate (see Useful Links) is not a full set of files and the installer program did not work; however it contains all of the components you need. For System 6, you will need to install the following files manually:

I have not found a way to enable virtual printers with this version of the PSPrinter driver. You will only be able to select a different PPD if your network has a real PostScript laser printer or a queue managed by an AppleShare server.

My testing used a 68030 Mac IIci with 8Mb RAM, System 6.0.8 (International English) and Multifinder.

Mac LPR Utility

There are several freeware Mac LPR utilities that will submit a PostScript file to an LPD queue. I chose a particularly old one from Brown University that works with System 6 as well as System 7.x. To obtain a copy, see Useful Links.

When you launch LPR, it will prompt you for a settings file for the LPD queue that you wish to use. The first time you run LPR, you should press Cancel.

LPR is configured using the options in the Settings menu: Origin, Destination, Header Page, Formatting and Printer Control.

In the Destination dialog box, enter the IP address of your OS X Mac and the LPD queue name (case sensitive).

In the Formatting dialog box, select the option Remote. This will allow the Mac OS X print server to determine that you are sending a PostScript file and to format it appropriately.

 

To send a PostScript file to your print queue, select Print File from the File menu. The time taken to submit the job will depend on the size of the PS file. A confirmation dialog will be displayed when the job has been sent. There will be a short interval while the OS X Mac processes the PS file.

 

Useful Links 

ESP GhostScript (ESPGS) and Gimp-Print downloads and information: http://gimp-print.sourceforge.net/MacOSX.php3.

More useful OS X printing info: http://www.linuxprinting.org/macosx/

Daniel Steffen's original piece on sharing a printer with older Macs: http://www.macosxhints.com/article.php?story=20020901005320524

More CUPS printing tips: http://www.macosxhints.com/article.php?story=20020824202229751  

 

LaserWriter 8.5.1 (International English) : ftp://ftp.apple.com/Apple_Support_Area/Apple_Software_Updates/English-International/Macintosh/Printing/LaserWriter/

LaserWriter 8.5.1 (British) : ftp://ftp.apple.com/Apple_Support_Area/Apple_Software_Updates/English-British/Macintosh/Printing/LaserWriter/

Various LaserWriter software versions (North American): ftp://ftp.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Printing/LaserWriter/

 

Adobe Mac Downloads (Adobe PS Printer 8.5.1 and Virtual Printer): http://www.adobe.com/support/downloads/product.jsp?product=44&platform=Macintosh

Old Adobe PS 8.2.1 driver for System 6: ftp://ftp.minolta-qms.com/pub/cts/out_going/mac/460drivr.sea.hqx

 

Mac LPR 1.2 utility: http://www.umich.edu/~archive/mac/util/print/lpr1.2.cpt.hqx (Note that there is another version for download that includes the source code but I have mislaid the URL.)

Loads of old Mac printer utils: http://www.umich.edu/~archive/mac/util/print/

Various old Mac drivers from Minolta-QMS: http://www.qms.com/support/Master_driver_lists/mac_drivers.htm

Printer Defaults Utility: http://www.maths.warwick.ac.uk/~jhr/soft.html


Copyright information: If you wish to use any images on these pages, please contact the author, Phil Beesley on beesley@mandrake.demon.co.uk.