Setting up Samba as a Print Server

Revision as of 23:22, 22 September 2010 by Fraz (talk | contribs) (Using printers connected to the Samba server)


Samba could no only act in the fileserver role. There is also the possibility to do the job as printserver for the windows clients.

This seems to be well known, and nobody needs to any instruction because it is working :-)

When we take a closer lool to this role, it consists out of the following parts:

  • printer share -> at the printingprocess the client copies the spoolfiles
  • printserver software -> cups, lprng, lpr or something else. He delivers the spoolfiles to the printing devices. Maybe over the network or localy
  • windows printer driver -> to use the 'point and print' functionality it makes sence to store the windows printer driver in a special share (print$) on the server. Inside of this driver also the default settings of the printer are stored.
  • printer formular -> Every windows printout depends on the formular with his papersizes and so on. If a formular isn't know to the printserver the client could not use this although the printer was able to do it. Think about large formular or special paper like photos.
  • something I have forgotten ...

Printserver software / Using printers connected to the Samba server



CUPS is currently the most widely used spool system in Unix environments. Samba has built in support and defaults to CUPS if the develepment package (aka header files and libraries) could be found at compile time. The home of CUPS is [[1]]. Basically all sorts of files can be printed with CUPS, but using a Postscript printer driver will give you the most benefit and the client can control the settings for the printers. A multi-purpose printer driver for Windows can be found at the Adobe site, see [[2]]. The very big advantage of using Postscript as the printing language is that it doesn't matter whether your job has to be printed on a cheap inkjet or a big laser.


This is the first widely used printing system. It is very simple and doesnt use Postscript. But it is binary clean, so you can print to it directly via client side installed printer drivers.


to do a upload of the windows printer driver there must be done some steps.

  1. We need a user which is permited to do the job -> a printer admin windows call it 'Printer Operator'
  2. a share have to be prepaired an the printer admin need permission to read and write.

how to configure printer admin

since samba 3.0.20 the parameter is depricated and in the actuall version it isn't working anymore.

so what is the commandline to get a printer admin?

do the following command and the user or group will be printer admin:

 net rpc rights grant "<domain|hostname\<user|group>" SePrintOperatorPrivilege -U <hostname>/root


 net rpc rights grant "cake\support" SePrintOperatorPrivilege -U cake/root

this mean the user support on machine is printeradmin by the user root on the hostname "cake"

Directory structure in drivers directory

The normal directory structure for your printer drivers looks like

drwxr-xr-x   2 root root  96 Feb 24 20:02 COLOR
drwxr-xr-x   2 root root  48 Feb 24 20:02 IA64
drwxr-xr-x   2 root root  48 Feb 24 20:02 W32ALPHA
drwxr-xr-x   2 root root  48 Feb 24 20:02 W32MIPS
drwxr-xr-x   2 root root  48 Feb 24 20:02 W32PPC
drwxr-xr-x   3 root root  72 Feb 24 20:02 W32X86
drwxr-xr-x   2 root root  48 Feb 24 20:02 WIN40
drwxr-xr-x   2 root root  48 Feb 24 20:02 x64

You have to create it yourself. Here is a command line which does it. You only have to change the value of BASEDIR:

for X in COLOR IA64 W32ALPHA W32MIPS W32PPC W32X86 WIN40 x64; do 
  mkdir -p $BASEDIR/$X;

Create the share

Please have a look at the smb.conf and change only the necessary lines (user,groups), most of the distributions are well prepaired.

comment = Printer Drivers
path = /var/lib/samba/drivers
browseable = yes
guest ok = no
read only = yes
write list = root, chrisr

Uploading a printer driver (vendor drivers)

Do it like:

Special settings on printer and faxes

Enabling new papersizes

Only standardsizes of formulars are known. You have to add the neccessary sizes by hand.

  1. connect to the server \\<SambaServer>>
  2. printer -> Server Propertes -> Forms
  3. Create new form
A0 With 84,10 cm Height 118,90 cm
A1 With 59,40 cm cm Height 84,10 cm
  1. After this steps the large papersizes a shown in the different dialogs

The Size of the formulars depends on the ppds

Using printers connected to another Samba or Windows server

Using a printer connected to another Samba server


Using a printer connected to a Windows server

You also can use CUPS for it. CUPS has the special backend smb://<server>/<printer>. This in turn calls the smbspool program which is part of the samba suite. So if you set up a printer connected to a Windows server, you set up a normal printer with a special PrinterURI.

Note: the full form of that URI is: smb://[<username>[:<password>]@][domain/]<server>/<printer>

--rcsu 15:34, 15 April 2006 (CDT)