Printing from Ubuntu to a Mac's USB printer

Don't try this at home until you've read the whole post.

If you've been around for a few years, you probably read Eric Raymond's The Luxury of Ignorance: An Open-Source Horror Story, about setting up printing on Linux. That was years ago, and it seems that nothing has changed.

Here were the steps I thought you had to go through to set up Ubuntu to talk to a Mac's printer:

  1. Set up your printer so it works locally on the Mac.
  2. On the Mac, in "System Preferences", click "Sharing", and check "Printer Sharing".
  3. On the Ubuntu box, choose "System", "Administration", "Printing". Double-click "New Printer". Choose "Network Printer", and leave it on "CUPS Printer". Type "http://mac-dns-name-or-ip-address:631/printer/mac-queue-name" as the URI. (If you can't remember the queue name, visit the /printer URI in your browser.) Click "Forward", choose manufacturer "Raw" and model "Queue", and you're done.

For me, much of this was non-obvious. The URI left me Googling. (Mac OS was less helpful than usual because "System Preferences" didn't do its usual job of giving me a hint about how to use the service I've just enabled. Whoever implemented that for the other services deserves a prize; whoever's responsible for the fact that some services have no hint deserves a kick in the nuts.)

The manufacturer and model part was also non-obvious. Mainly because of the "oh no, my model of printer isn't in the list!" moment, and the fairly extensive Googling it required to find that it doesn't actually matter.

You might think it would be nice to have some decent browsing mechanism, and preferably Bonjour auto-discovery. I really shouldn't be asking Google for CUPS URIs to type in.

The funny thing is, Ubuntu can do the right thing. What you need to do is ignore the siren charms of "New Printer", and enable "Detect LAN Printers" on the "Global Settings" menu. Then you ignore the scary warning dialog telling you not to do this, type the root password, and then you sit around and wait for a bit. Because it doesn't work instantly, and it doesn't tell you it's doing anything. So don't go and deselect "Detect LAN Printers" thinking it's not done anything useful. Be patient.

If you are patient, a new printer will appear. It will have the name you gave it on your Mac, and it will be selected as the default printer. You can deselect "Detect LAN Printers" afterwards and the printer won't go away, but it will stop working after the next reboot.

The icon will still be there, and it won't look any different, and as far as I can tell there will be absolutely no indication of any problem, but if you print, nothing will happen. The printer's job count will increase, but the job queue will appear empty, and nothing will be printed. So leave "Detect LAN Printers" selected, and pretend it reads something like "Use Network Printers".

If I hadn't re-read Raymond's article, I wouldn't have known that I'd set up a local queue rather than just connected to a remote one. (Do I understand the scary dialog? No. Why does enabling LAN printer detection open port 631 on my system? Why can't the dialog explain what's really going on?)

(Note that printing to a remote queue is a useful trick if you're running Ubuntu in a VM: letting the host OS do the printing for the guest OS is likely to be much easier to set up. Thanks to Donnie Pennington for pointing this out to me after using this trick to print to his Mac's USB printer from Ubuntu running under Parallels.)

That the situation with Linux printing is this piss-poor in 2006 is bad. That everyone in the Linux world read a long and detailed complaint about exactly this several years ago and it still sucks exactly as it used to... that's hard to believe. Ubuntu's put a lot of time and effort into making the icons more orange and the desktop background more brown, but making printing simple enough for my parents to set up?

I guess printing is one of those things so deadly dull that you have to pay people to work on it.

In the meantime, I see that linuxprinting.org has a list of Suggested Printers for Free Software Users. If I'd known about that beforehand, I'd have bought an HP printer.

[Teresa Van Dusen reports that this is still true for Ubuntu 7.10.]