Your Ad Here

Configure Netatalk on Ubuntu to Share a USB Printer [Ubuntu Guide]

Netatalk Logo

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 (written for Ubuntu Hardy Heron 8.04 and OS X Leopard 10.5.2) 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.



This post is one of five in a series on how to integrate Ubuntu into a Mac OS X Network. Check out the others linked to below.
Ubuntu Guide: Configure a Netatalk File Server Based on Apple Filing Protocol (AFP)
Ubuntu Guide: Configure Avahi to Broadcast Services via Bonjour to Mac OS X
Ubuntu Guide: Configure Vinagre to Share the Screen with Mac OS X
Ubuntu Guide: Configure a Firefly (mt-daapd) Streaming Media Server for iTunes and Front Row
Ubuntu Guide: Configure Netatalk to Share a USB Printerr


© Copyright Zaphu 2007. All rights reserved. -- Valid XHTML

Sitemap XML Sitemap XHTML