4 >Printing Support in Samba
2.2.x
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.57"></HEAD
23 >Printing Support in Samba
2.2.x
</A
35 >Beginning with the
2.2.0 release, Samba supports
36 the native Windows NT printing mechanisms implemented via
37 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
38 Samba only supported LanMan printing calls.
</P
40 >The additional functionality provided by the new
41 SPOOLSS support includes:
</P
47 >Support for downloading printer driver
48 files to Windows
95/
98/NT/
2000 clients upon demand.
53 >Uploading of printer drivers via the
54 Windows NT Add Printer Wizard (APW) or the
<A
55 HREF=
"http://imprints.sourceforge.net"
63 >Support for the native MS-RPC printing
64 calls such as StartDocPrinter, EnumJobs(), etc... (See
66 HREF=
"http://msdn.microsoft.com/"
70 > for more information on the Win32 printing API)
75 >Support for NT Access Control Lists (ACL)
80 >Improved support for printer queue manipulation
81 through the use of an internal databases for spooled job
95 >In order to support the uploading of printer driver
96 files, you must first configure a file share named [print$].
97 The name of this share is hard coded in Samba's internals so
98 the name is very important (print$ is the service used by
99 Windows NT print servers to provide support for printer driver
120 >Previous versions of Samba recommended using
121 a share named [printer$]. This name was taken from the
122 printer$ service created by Windows
9x clients when a
123 printer was shared. Windows
9x printer servers always have
124 a printer$ service which provides read-only access via no
125 password in order to support printer driver downloads.
</P
127 >However, the initial implementation allowed for a
131 >printer driver location
</I
134 to be used on a per share basis to specify the location of
135 the driver files associated with that printer. Another
142 a means of defining the printer driver name to be sent to
145 >These parameters, including
<TT
151 > parameter, are being depreciated and should not
152 be used in new installations. For more information on this change,
153 you should refer to the
<A
157 >of this document.
</P
163 >You should modify the server's smb.conf file to create the
164 following file share (of course, some of the parameter values,
165 such as 'path' are arbitrary and should be replaced with
166 appropriate values for your site):
</P
169 CLASS=
"PROGRAMLISTING"
171 path = /usr/local/samba/printers
180 HREF=
"smb.conf.5.html#WRITELIST"
188 > is used to allow administrative
189 level user accounts to have write access in order to update files
190 on the share. See the
<A
191 HREF=
"smb./conf.5.html"
193 > smb.conf(
5) man page
</A
194 > for more information on
195 configuring file shares.
</P
197 >The requirement for
<A
198 HREF=
"smb.conf.5.html#GUESTOK"
204 > depends upon how your
205 site is configured. If users will be guaranteed to have
206 an account on the Samba host, then this is a non-issue.
</P
211 >The non-issue is that
212 if all your Windows NT users are guarenteed to be authenticated
213 by the Samba server (such as a domain member server and the NT
214 user has already been validated by the Domain Controller in
215 order to logon to the Windows NT console), then guest access
216 is not necessary. Of course, in a workgroup environment where
217 you just want to be able to print without worrying about
218 silly accounts and security, then configure the share for
219 guest access. You'll probably want to add
<A
220 HREF=
"smb.conf.5.html#MAPTOGUEST"
224 >map to guest = Bad User
227 > in the [global] section as well. Make sure
228 you understand what this parameter does before using it
231 >In order for a Windows NT print server to support
232 the downloading of driver files by multiple client architectures,
233 it must create subdirectories within the [print$] service
234 which correspond to each of the supported client architectures.
235 Samba follows this model as well.
</P
237 >Next create the directory tree below the [print$] share
238 for each architecture you wish to support.
</P
241 CLASS=
"PROGRAMLISTING"
243 |-W32X86 ;
"Windows NT x86"
244 |-WIN40 ;
"Windows 95/98"
245 |-W32ALPHA ;
"Windows NT Alpha_AXP"
246 |-W32MIPS ;
"Windows NT R4000"
247 |-W32PPC ;
"Windows NT PowerPC"
271 >ATTENTION! REQUIRED PERMISSIONS
</I
274 >In order to currently add a new driver to you Samba host,
275 one of two conditions must hold true:
</P
281 >The account used to connect to the Samba host
282 must have a uid of
0 (i.e. a root account)
</P
286 >The account used to connect to the Samba host
287 must be a member of the
<A
288 HREF=
"smb.conf.5.html"
300 >Of course, the connected account must still possess access
301 to add files to the subdirectories beneath [print$].
</P
307 >Once you have created the required [print$] service and
308 associated subdirectories, simply log onto the Samba server using
315 from a Windows NT
4.0 client. Navigate to the
"Printers" folder
316 on the Samba server. You should see an initial listing of printers
317 that matches the printer shares defined on your Samba host.
</P
319 >The initial listing of printers in the Samba host's
320 Printers folder will have no printer driver assigned to them.
321 The way assign a driver to a printer is to view the Properties
322 of the printer and either
</P
328 >Use the
"New Driver..." button to install
329 a new printer driver, or
</P
333 >Select a driver from the popup list of
334 installed drivers. Initially this list will be empty.
</P
338 >If you wish to install printer drivers for client
339 operating systems other than
"Windows NT x86", you will need
340 to use the
"Sharing" tab of the printer properties dialog.
</P
342 >Assuming you have connected with a root account, you
343 will also be able modify other printer properties such as
344 ACLs and device settings using this dialog box.
</P
346 >A few closing comments for this section, it is possible
347 on a Windows NT print server to have printers
348 listed in the Printers folder which are not shared. Samba does
349 not make this distinction. By definition, the only printers of
350 which Samba is aware are those which are specified as shares in
356 >Another interesting side note is that Windows NT clients do
357 not use the SMB printer share, but rather can print directly
358 to any printer on another Windows NT host using MS-RPC. This
359 of course assumes that the printing client has the necessary
360 privileges on the remote host serving the printer. The default
361 permissions assigned by Windows NT to a printer gives the
"Print"
362 permissions to the
"Everyone" well-known group.
</P
369 >Support a large number of printers
</A
372 >One issue that has arisen during the development
373 phase of Samba
2.2 is the need to support driver downloads for
374 100's of printers. Using the Windows NT APW is somewhat
375 awkward to say the list. If more than one printer are using the
377 HREF=
"rpcclient.1.html"
384 > can be used to set the driver
385 associated with an installed driver. The following is example
386 of how this could be accomplished:
</P
389 CLASS=
"PROGRAMLISTING"
394 >rpcclient pogo -U root%secret -c
"enumdrivers"
395 Domain=[NARNIA] OS=[Unix] Server=[Samba
2.2.0-alpha3]
398 Printer Driver Info
1:
399 Driver Name: [HP LaserJet
4000 Series PS]
401 Printer Driver Info
1:
402 Driver Name: [HP LaserJet
2100 Series PS]
404 Printer Driver Info
1:
405 Driver Name: [HP LaserJet
4Si/
4SiMX PS]
410 >rpcclient pogo -U root%secret -c
"enumprinters"
411 Domain=[NARNIA] OS=[Unix] Server=[Samba
2.2.0-alpha3]
413 name:[\\POGO\hp-print]
414 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
420 >rpcclient pogo -U root%bleaK.er \
424 > -c
"setdriver hp-print \"HP LaserJet
4000 Series PS\
""
425 Domain=[NARNIA] OS=[Unix] Server=[Samba
2.2.0-alpha3]
426 Succesfully set hp-print to driver HP LaserJet
4000 Series PS.
437 >The Imprints Toolset
</A
440 >The Imprints tool set provides a UNIX equivalent of the
441 Windows NT Add Printer Wizard. For complete information, please
442 refer to the Imprints web site at
<A
443 HREF=
"http://imprints.sourceforge.net/"
445 > http://imprints.sourceforge.net/
</A
446 > as well as the documentation
447 included with the imprints source distribution. This section will
448 only provide a brief introduction to the features of Imprints.
</P
455 >What is Imprints?
</A
458 >Imprints is a collection of tools for supporting the goals
465 >Providing a central repository information
466 regarding Windows NT and
95/
98 printer driver packages
</P
470 >Providing the tools necessary for creating
471 the Imprints printer driver packages.
</P
475 >Providing an installation client which
476 will obtain and install printer drivers on remote Samba
477 and Windows NT
4 print servers.
</P
487 >Creating Printer Driver Packages
</A
490 >The process of creating printer driver packages is beyond
491 the scope of this document (refer to Imprints.txt also included
492 with the Samba distribution for more information). In short,
493 an Imprints driver package is a gzipped tarball containing the
494 driver files, related INF files, and a control file needed by the
495 installation client.
</P
503 >The Imprints server
</A
506 >The Imprints server is really a database server that
507 may be queried via standard HTTP mechanisms. Each printer
508 entry in the database has an associated URL for the actual
509 downloading of the package. Each package is digitally signed
510 via GnuPG which can be used to verify that package downloaded
511 is actually the one referred in the Imprints database. It is
515 > recommended that this security check
524 >The Installation Client
</A
527 >More information regarding the Imprints installation client
528 is available in the
<TT
530 >Imprints-Client-HOWTO.ps
</TT
532 file included with the imprints source package.
</P
534 >The Imprints installation client comes in two forms.
</P
540 >a set of command line Perl scripts
</P
544 >a GTK+ based graphical interface to
545 the command line perl scripts
</P
549 >The installation client (in both forms) provides a means
550 of querying the Imprints database server for a matching
551 list of known printer model names as well as a means to
552 download and install the drivers on remote Samba and Windows
555 >The basic installation process is in four steps and
556 perl code is wrapped around
<B
566 CLASS=
"PROGRAMLISTING"
568 foreach (supported architecture for a given driver)
570 1. rpcclient: Get the appropriate upload directory
572 2. smbclient: Upload the driver files
573 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
576 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
581 >One of the problems encountered when implementing
582 the Imprints tool set was the name space issues between
583 various supported client architectures. For example, Windows
584 NT includes a driver named
"Apple LaserWriter II NTX v51.8"
585 and Windows
95 callsits version of this driver
"Apple
586 LaserWriter II NTX"</P
588 >The problem is how to know what client drivers have
589 been uploaded for a printer. As astute reader will remember
590 that the Windows NT Printer Properties dialog only includes
591 space for one printer driver name. A quick look in the
592 Windows NT
4.0 system registry at
</P
596 >HKLM\System\CurrentControlSet\Control\Print\Environment
600 >will reveal that Windows NT always uses the NT driver
601 name. The is ok as Windows NT always requires that at least
602 the Windows NT version of the printer driver is present.
603 However, Samba does not have the requirement internally.
604 Therefore, how can you use the NT driver name if is has not
605 already been installed?
</P
607 >The way of sidestepping this limitation is to require
608 that all Imprints printer driver packages include both the Intel
609 Windows NT and
95/
98 printer drivers and that NT driver is
622 >Migration to from Samba
2.0.x to
626 >Given that printer driver management has changed
627 (we hope improved :) ) in
2.2.0 over prior releases,
628 migration from an existing setup to
2.2.0 can follow
649 >The following smb.conf parameters are considered to be
650 depreciated and will be removed soon. Do not use them
651 in new installations
</P
660 >printer driver file (G)
</I
670 >printer driver (S)
</I
680 >printer driver location (S)
</I
691 >Here are the possible scenarios for supporting migration:
</P
697 >If you do not desire the new Windows NT
698 print driver support, nothing needs to be done.
699 All existing parameters work the same.
</P
703 >If you want to take advantage of NT printer
704 driver support but do not want to migrate the
705 9x drivers to the new setup, the leave the existing
706 printers.def file. When smbd attempts to locate a
707 9x driver for the printer in the TDB and fails it
708 will drop down to using the printers.def (and all
709 associated parameters). The
<B
713 tool will also remain for backwards compatibility but will
714 be moved to the
"this tool is the old way of doing it"
719 >If you install a Windows
9x driver for a printer
720 on your Samba host (in the printing TDB), this information will
721 take precedence and the three old printing parameters
722 will be ignored (including print driver location).
</P
726 >If you want to migrate an existing
<TT
729 > file into the new setup, the current only
730 solution is to use the Windows NT APW to install the NT drivers
731 and the
9x drivers. This can be scripted using smbclient and
732 rpcclient. See the
<A
733 HREF=
"http://imprints.sourceforge.net/"
735 > Imprints insrallation client
</A