Samba as a print server in a Windows 2000 Workgroup


OK, hopefully you've got your Samba server serving files (even if you only want to use it as a print server I'd suggest that a test share will allow you to check that Samba's running OK.) The next job is to get Samba working as your print server.


I'm using cupsd - Common Unix Printing System Daemon (see man cupsd or http://localhost:631/documentation.html)
Install your printer (http://localhost:631/admin logging in as root) and print a test page. If that works OK, the we need to sort out smb.conf
If you used my quick smb.conf then you should find the settings in the [global] section already done

[global]
printcap name = cups
load printers = yes
printing = cups

Obviously, we need to define the printers in smb.conf, but we don't now need to set each one up individually thanks to load printers.

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
public = yes
guest ok = yes
writable = yes
printable = yes
printer admin = root administrator

And I've allowed open access to anyone to print, but only root and administrator have any admin rights. (making sure that the Windows username that you'll be using to test the printer is listed in the printer admin list ought to prevent you from suffering the "Access denied, unable to connect" error that can be very irritating until you figure out just what it means.)

Now you can either wait for Samba to refresh itself, or force a service smb reload and hopefully you should see the printer listed in both \\SERVERNAME\ and the printers folder. If you can see it there, then you can use Windows Add Printer Wizard to add it as a network printer as you would any other. Hopefully you should now be able to print a test page from Windows. If not (What bitter voice of experience?) I'd suggest trying
echo Hello > \\SERVERNAME\PRINTERNAME
which ought to print "Hello" on a piece of paper for you to cheer you up and incidentally prove that the printer is available to the network and we've got a driver / compatability problem. The next place to check out is /var/log/cups and have a look through error_log. entries like:
print_job: Unsupported format 'application/octet-stream'!
Hint: Do you have the raw file printing rules enabled?
can be considered significant!
Have a look in /etc/cups and in mime.convs uncomment the line:
# application/octet-stream application/vnd.cups-raw 0 -
in mime.types uncomment the line:
# application/octet-stream
Now you will need a service cups restart but with a bit of luck you should now be able to print a test page from Windows, and hence anything else as well. If you're still having problems, increse the LogLevel info setting in cupsd.conf (the options are immediately above) and restart cups and see if you can get any more meaningful information.