Printing and Samba

2007-01-08 2-minute read

Finally working on getting the windows clients to print using a printer install on a Samba server, rather than directly via IP.

First step, install cupsys and cupsys-client:

apt-get install cupsys cupsys-client

Then install some ppd files:

apt-get install foomatic-filters-ppd

Then, I went to Open Printing to lookup the best PPD file for the printer in question.

I searched in /usr/share/ppd for that PPD, copied it to my home directory, and then installed the printer with:

lpadmin -p NameOfPrinter -E -v socket://ip.ad.dr.ess:9100 -P LaserJet_1320-hpijs.ppd

I made sure it was there with:

lpstat -v

Then I made it the default printer with:

lpadmin -d NameOfPrinter

Finally I tested by creating a test.txt file and typing:

lp test.txt

And now the Samba part:

Make sure you have the following in the global section of your /etc/samba/smb.conf file:

printing = cups
printcap name = cups
cups options = "raw"
load printers = yes

And the following two share definitions:

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
client driver = Yes
guest ok = yes
writable = no
printable = yes
printer admin = root
;  create mode = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
guest ok = no
read only = yes
write list = root

Next - fire up a windows computer (note: I can’t get this to work on Windows Vista, but it does work on Windows XP).

Then, browse your network shares to find your samba server. Double click on the printers folder (not on the printer that you see listed). Right click on the printer in the printers folder and click Properties. From the advanced tab, select to install a driver. Navigate to a folder containing the drivers (which you should download from the driver manufacturer).

NOTE: If you are adding a new printer you seem to need to restart samba to get it to show up (reload didn’t seem to work). I think that’s because it’s the nmbd service that needs to restart.