3

If you have installed Netatalk following this post and Avahi following this post, it is fairly straightforward to share a USB printer connected to your Ubuntu machine with Macs on your local area network (LAN) via AppleTalk. By default, Netatalk installs and runs the print sharing service called papd. So, after the printer is installed on the Ubuntu machine in the customary fashion, sharing via Netatalk only requires some edits to the papd configuration file. This guide will get you started.

Open the papd.conf file in the netatalk configuration directory (Here, I’m using vim to edit the file).

sudo vim /etc/netatalk/papd.conf

This file is well commented to guide you and, if you wish, it is possible to configure several shared printers. Below I show the lines I added to the end of this file to share an HP LaserJet 2200 that I have connected to my Ubuntu machine via USB. To help you figure out how to appropriately modify these lines to share your printer(s), I explain each line in the following paragraph.

LaserJet 2200:\
      :pr=|lpr -P HP_LaserJet_2200:\
      :pd=/etc/cups/ppd/HP_LaserJet_2200.ppd:

The first line specifies the name of the printer that will appear in the printer configuration window on Macs connected to your LAN. The second line specifies the printer name. Here I am using the | character so that print jobs gets piped through to the lpr command. The -P option specifies the printer to use (here HP_LaserJet_2200). This printer name is the one recognized by the lpr command on your Ubuntu machine. You can find the names of installed printers by executing the following command in a terminal.

lpstat -p

The third line give to path to the printer’s PPD file. Your PPD files are probably in the same directory as mine. Note that the syntax of the papd.conf file is very specific, for example, notice that colons separate the options and backslashes denote line breaks. I had a great deal of trouble getting my printer to work at first because I forgot a colon. After making changes to the papd.conf file, restart Netatalk and Avahi.

sudo /etc/init.d/netatalk restart
sudo /etc/init.d/avahi-daemon restart

If everything is configured correctly, you should be able to add the newly shared printer using the Add Printer... option in your printer list on your Mac(s) and selecting the AppleTalk tab. Good luck and enjoy your newly shared printer.


If you have enjoyed this entry. Please feel free to bookmark it using your favorite social bookmarking site

3 Responses so far

  1. Omar says:

    Ubuntu 12.04. I’ve got file sharing working, and followed these instructions to the tea. Firewalls are off (with sharing from a true mac working well), and I still can’t see the printer.
    lpstat -p shows my printer name as “HP-LaserJet-1020″ with PPD similarly named. Everything else in my setup is identical to yours. nbplkup shows the printer as registered. So cornfused.

  2. Omar says:

    One thing no tutorials seems to mention is the obvious (for the sake of ID10T/PEBCAK errors; namely: that you need to share the printer in the System Settings/Printing control panel). Works like a charm now.

Leave a Comment