Printing from Mac to Linux: the cheat sheet

For the last few years, desktop Linux and Mac OS X alike have used CUPS (Common Unix Printing System) as their native printing subsystem. In an ideal world, this would mean it’s really easy to set them up to talk to each other.

In the world we live in, however, things are not so easy. Configuring CUPS remains a black art, compounded by the absolutely abysmal reporting of errors to the printer UI on both OSes. To have any clue what’s going on you have to seek out and find the log files…

I can understand that on Linux, but really, how did Steve Jobs let this out the door on his precious Macintosh? Heck, Apple even bought the company that developed CUPS a few years back. Stop making our iPods smaller for a couple minutes and fix your printing error messages! ;)

The situation:

I have a relatively straightforward setup: an Ubuntu Linux desktop PC (stormcloud.local) with a well-supported USB printer hooked up, and a Mac laptop (nimbus.local) which roams the world. When at home, it’s nice to be able to print directly from the Mac rather than print to PDF, copy the file, and then print.

The cheat sheet:

First the basics — make sure printer sharing is enabled on Linux; this much you should be able to do through the regular GUI:

Now the voodoo! Add to /etc/cups/cupsd.conf on Linux:

    # Allow remote access
    ServerAlias *
    Port 631

And restart cupsd:

    sudo /etc/init.d/cupsd restart

Now, you can add the printer on the Mac; be sure to fill everything out!

Several gotchas I discovered:

Listening isn’t enough

Very early in my journey I made sure that the Linux box’s cupsd.conf was set to listen on the network as well as to itself:

    BAD: Listen localhost:631
    GOOD: Port 631

But when I’d try to hit the CUPS web administration pages I’d just get a “400 Bad Request”. After some experimentation, I found that it actually responds just fine… as long as in the HTTP headers I call it “localhost” instead of by its proper local network name.

To get it working (so eg http://stormcloud.local:631/ would actually pull something up!) I had to add this to cupsd.conf:

    GOOD: ServerAlias *

No, setting the name I wanted in ServerName mysteriously wasn’t enough.

Pick a queue, any queue

The Mac’s IPP printer setup dialog says you can leave the “Queue” field “blank for default queue”. This is a lie! Despite having only one printer available, I could only get printing working if I listed the queue explicitly.

To add insult to injury, you need to include the “printers/” prefix. This is easiest if you find the printer on the web interface and copy-paste the path from the URL…

Now I can print my dang Fandango tickets, which I’m pretty happy about!

Drivers

I’ve been using the native driver for the printer on the Mac side. It should also work to just leave it at Generic PostScript as long as the Linux box has a driver, but I feel safer with it there. ;)

3 thoughts on “Printing from Mac to Linux: the cheat sheet”

  1. Printing has been our one major headache (aside from OpenOffice Impress) since switching to Linux for all our computers a few months back. Network printing works sometimes, but it’s really hard to predict when it will quit and why.

Comments are closed.