Printer Sharing from Mac OSX

This is a HOWTO for printer sharing from Mac OSX, including installation of gimp-print, using Samba to share printers with ms-windows PCs, enabling lpd printer sharing to Unix and Linux machines, and IPP to MacOSX-attached printers. For sharing from Mac to Mac, you don't need this HOWTO. If you're trying to use the printer on a Mac from a PC or Unix/Linux box on the network, the solution you need may be here.

gimp-print

Gimp-print is included with MacOS 10.3 & 10.4 so you don't need to install anything or configure a special printer queue. To use the gimp-print drivers, configure printers with a USB driver rather than an Epson or HP driver.

If you are using MacOS-10.2, the gimp-print drivers produce better output or are more versatile than those supplied by the manufacturer of the printer or the stock MacOSX drivers, and in any case you will need them to share the printer via CUPS and for programs like LyX that do not use the Mac print-center. Install the latest version, and if you have not already done so, install ESP ghostscript. See the included documentation or the Gimp-Print FAQ for OS X for instructions on how to configure printer(s) with a gimp-print driver. For a USB printer that MacOSX has automatically configured with a stock OSX driver, you should configure a second queue with a gimp-print driver. On the Mac you can choose which queue to use for specific documents. From remote machines, you will want to use the gimp-print queue.

When you have configured your printer(s), look at http://localhost:631/printers or /etc/printcap to see the queue name(s) the system has assigned to your printer(s). This is the mac-queue-name in the instructions below.

Samba

The Samba server included with MacOSX is a powerful and easy-to-configure package that shares files, printers, and other resources via the SMB protocol.

If you are running MacOS-10.2 (these two steps are not necessary on later versions of MacOS):

Read the smb.conf man page or the Samba documentation to decide if you want to add to the [global] section of /etc/smb.conf:

   workgroup = workgroup-name
   hosts allow = your-network-ip
   security = share

Depending on your network configuration, you may need to change the access in the <Location/> section of /etc/cups/cupsd.conf. The configuration rules are similar to those for the Apache web-server.

Enable Samba printer sharing in System Preferences by clicking Sharing → Windows File Sharing. If you upgrade your MacOS version, check to see that Windows File Sharing is still enabled. Caution: if your network is not behind a firewall blocking ports 137 and 139, and you haven't limited access in /etc/smb.conf, enabling Samba could share your printers and files with the world.

One user has reported that with some versions of MS-Windows he needed a user account on the Mac for each user on the PCs in the network, with the exact name (including capitalization) and password as used on the PCs.

On the ms-windows PCs on your network:

I know: you probably don't have an Apple Laserwriter. You still want to use the Apple Laserwriter drivers. The goal is to send proper Postscript to the Mac, which CUPS and the gimp-print drivers on the Mac will translate to the codes your printer understands. Microsoft drivers are notorious for non-portable Postscript, but the Apple Laserwriter drivers work.

You should now be able to print from the PC to the printer on the Mac.

UNIX TIPS

lpd

To share a printer on the Mac across an ethernet network, in System Preferences click Sharing → Printer Sharing. If your network is not behind a firewall that blocks port 631, you may want to edit /etc/cups/cupsd.conf to limit access to your network or subnet. Be careful not to override the changes the system makes to enable printer sharing. If you change the configuration file, reboot or restart CUPS with
   sudo killall cupsd
   sudo cupsd

If your Unix or Linux system uses lpd to share printers across a network. The CUPS print system on MacOS can communicate with these systems if you enable the cups-lpd daemon.

Caution: without a firewall blocking port 515, or tcp-wrappers with inetd, or xinetd configured to limit access to the printer service with an only_from directive, lpd printer-sharing will expose your printers to the world.

Unix/Linux clients

To configure a Unix or Linux machine that is not running CUPS to use the USB printer on the Mac, use the command

   lpadmin local-printername -s mac-ip-name\!mac-queue-name
on the Unix or Linux box. If you don't have a working DNS, substitute the ip-address of the Mac for mac-ip-name. You may need to enable the printer with
   enable local-printername
   accept local-printername

Some older versions of Unix or Linux may require different tools to add a printer. If you need to write an /etc/printcap entry, use :rm=mac-ip-name:rp=mac-queue-name:. Once the printer is configured on the Unix or Linux box, you should be able to print to local-printername with lpr and/or lp.

If you have a Unix/Linux driver for the printer, you can configure it as a filter with lpadmin or in /etc/printcap, and use lpr -P local-printername -o raw to avoid the Postscript-to-printer driver that CUPS on the Mac would normally invoke.

IPP

If your remote box supports IPP printing, (ms-windows-xp, ms-windows-2000, Linux/Unix with CUPS, or ms-windows-95/98 with the IPP update) you can configure it to print to a printer on the Mac without setting up Samba or lpd. Make sure you have gimp-print installed, as described above, and on System Preferences click Sharing → Printer Sharing. Then, on the remote system, set up a network printer with URL
   http://mac-ip-name:631/printers/mac-queue-name
If you don't have a working DNS, substitute the ip-address of the Mac for mac-ip-name.

From a Linux or Unix system running CUPS, you may need to specify the printer as "Raw"/"Raw Queue (en)".

For ms-windows PCs, which by default do not generate Postscript printer output, use the Apple Laserwriter or Apple ColorLaserwriter driver.

If your remote system supports it, you can also use IPP print configuration with lpd if you have configured the Mac to handle remote lpd clients. The URL from the client is:

   lpd://mac-ip-name/mac-queue-name

printing text/raw files

To use dedicated printer drivers on IPP or LPD clients instead of sending Postscript to the CUPS driver on the Mac, edit the files /etc/cups/mime.convs and /etc/cups/mime.types on the Mac to uncomment the lines beginning application/octet-stream. This will enable printing of the raw printer queue on the Mac. Reboot or give the commands

   sudo killall cupsd
   sudo cupsd
on the Mac after you make this change. You can then install the appropriate printer-driver on the remote client.

disclaimer

The information on this page is believed to be accurate, has been used successfully on many systems and sites, and has benefited from the comments and suggestions of many users. Due to the variations in individual systems and configuration, this information is conveyed as is with no warranty of any kind.


Last modified: 11-Feb-2006 12:17:33 EST © 2002 Ronald Florence