missed these yesterday. I'm bad about that :-(
[Samba.git] / docs / htmldocs / printer_driver2.html
blob34208f8feea755182841c07ed9056d5ac6d73e48
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Printing Support in Samba 2.2.x</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="ARTICLE"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><DIV
16 CLASS="ARTICLE"
17 ><DIV
18 CLASS="TITLEPAGE"
19 ><H1
20 CLASS="TITLE"
21 ><A
22 NAME="AEN1"
23 >Printing Support in Samba 2.2.x</A
24 ></H1
25 ><HR></DIV
26 ><DIV
27 CLASS="SECT1"
28 ><H1
29 CLASS="SECT1"
30 ><A
31 NAME="AEN3"
32 >Introduction</A
33 ></H1
34 ><P
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
39 ><P
40 >The additional functionality provided by the new
41 SPOOLSS support includes:</P
42 ><P
43 ></P
44 ><UL
45 ><LI
46 ><P
47 >Support for downloading printer driver
48 files to Windows 95/98/NT/2000 clients upon demand.
49 </P
50 ></LI
51 ><LI
52 ><P
53 >Uploading of printer drivers via the
54 Windows NT Add Printer Wizard (APW) or the <A
55 HREF="http://imprints.sourceforge.net"
56 TARGET="_top"
57 >Imprints tool set
58 </A
59 ></P
60 ></LI
61 ><LI
62 ><P
63 >Support for the native MS-RPC printing
64 calls such as StartDocPrinter, EnumJobs(), etc... (See
65 the <A
66 HREF="http://msdn.microsoft.com/"
67 TARGET="_top"
68 >MSDN documentation
69 </A
70 > for more information on the Win32 printing API)
71 </P
72 ></LI
73 ><LI
74 ><P
75 >Support for NT Access Control Lists (ACL)
76 on printer objects</P
77 ></LI
78 ><LI
79 ><P
80 >Improved support for printer queue manipulation
81 through the use of an internal databases for spooled job
82 information</P
83 ></LI
84 ></UL
85 ></DIV
86 ><DIV
87 CLASS="SECT1"
88 ><HR><H1
89 CLASS="SECT1"
90 ><A
91 NAME="AEN20"
92 >Configuration</A
93 ></H1
94 ><P
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
100 download).</P
101 ><DIV
102 CLASS="WARNING"
104 ></P
105 ><TABLE
106 CLASS="WARNING"
107 BORDER="1"
108 WIDTH="100%"
109 ><TR
110 ><TD
111 ALIGN="CENTER"
113 >Warning</B
114 ></TD
115 ></TR
116 ><TR
117 ><TD
118 ALIGN="LEFT"
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
128 parameter named <TT
129 CLASS="PARAMETER"
131 >printer driver location</I
132 ></TT
134 to be used on a per share basis to specify the location of
135 the driver files associated with that printer. Another
136 parameter named <TT
137 CLASS="PARAMETER"
139 >printer driver</I
140 ></TT
141 > provided
142 a means of defining the printer driver name to be sent to
143 the client.</P
145 >These parameters, including <TT
146 CLASS="PARAMETER"
148 >printer driver
149 file</I
150 ></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
154 HREF="#MIGRATION"
155 >Migration section
157 >of this document.</P
158 ></TD
159 ></TR
160 ></TABLE
161 ></DIV
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
168 ><PRE
169 CLASS="PROGRAMLISTING"
170 >[print$]
171 path = /usr/local/samba/printers
172 guest ok = yes
173 browseable = yes
174 read only = yes
175 write list = ntadmin
176 </PRE
177 ></P
179 >The <A
180 HREF="smb.conf.5.html#WRITELIST"
181 TARGET="_top"
182 ><TT
183 CLASS="PARAMETER"
185 > write list</I
186 ></TT
187 ></A
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"
192 TARGET="_top"
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"
199 TARGET="_top"
201 CLASS="COMMAND"
202 > guest ok = yes</B
203 ></A
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
209 CLASS="EMPHASIS"
210 >author's note: </I
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"
221 TARGET="_top"
223 CLASS="COMMAND"
224 >map to guest = Bad User
226 ></A
227 > in the [global] section as well. Make sure
228 you understand what this parameter does before using it
229 though. --jerry]</P
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
240 ><PRE
241 CLASS="PROGRAMLISTING"
242 > [print$]-----
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"
248 </PRE
249 ></P
250 ><DIV
251 CLASS="WARNING"
253 ></P
254 ><TABLE
255 CLASS="WARNING"
256 BORDER="1"
257 WIDTH="100%"
258 ><TR
259 ><TD
260 ALIGN="CENTER"
262 >Warning</B
263 ></TD
264 ></TR
265 ><TR
266 ><TD
267 ALIGN="LEFT"
270 CLASS="EMPHASIS"
271 >ATTENTION! REQUIRED PERMISSIONS</I
272 ></P
274 >In order to currently add a new driver to you Samba host,
275 one of two conditions must hold true:</P
277 ></P
278 ><UL
279 ><LI
281 >The account used to connect to the Samba host
282 must have a uid of 0 (i.e. a root account)</P
283 ></LI
284 ><LI
286 >The account used to connect to the Samba host
287 must be a member of the <A
288 HREF="smb.conf.5.html"
289 TARGET="_top"
290 ><TT
291 CLASS="PARAMETER"
293 > printer admin</I
294 ></TT
295 ></A
296 > list.</P
297 ></LI
298 ></UL
300 >Of course, the connected account must still possess access
301 to add files to the subdirectories beneath [print$].</P
302 ></TD
303 ></TR
304 ></TABLE
305 ></DIV
307 >Once you have created the required [print$] service and
308 associated subdirectories, simply log onto the Samba server using
309 a root (or <TT
310 CLASS="PARAMETER"
312 >printer admin</I
313 ></TT
314 >) account
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
324 ></P
325 ><UL
326 ><LI
328 >Use the "New Driver..." button to install
329 a new printer driver, or</P
330 ></LI
331 ><LI
333 >Select a driver from the popup list of
334 installed drivers. Initially this list will be empty.</P
335 ></LI
336 ></UL
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
352 CLASS="FILENAME"
353 >smb.conf</TT
354 >.</P
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
363 ><DIV
364 CLASS="SECT2"
365 ><HR><H2
366 CLASS="SECT2"
368 NAME="AEN74"
369 >Support a large number of printers</A
370 ></H2
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
376 same driver, the <A
377 HREF="rpcclient.1.html"
378 TARGET="_top"
380 CLASS="COMMAND"
381 >rpcclient's
382 setdriver command</B
383 ></A
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
388 ><PRE
389 CLASS="PROGRAMLISTING"
392 CLASS="PROMPT"
393 >$ </TT
394 >rpcclient pogo -U root%secret -c "enumdrivers"
395 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
397 [Windows NT x86]
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]
408 CLASS="PROMPT"
409 >$ </TT
410 >rpcclient pogo -U root%secret -c "enumprinters"
411 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
412 flags:[0x800000]
413 name:[\\POGO\hp-print]
414 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
415 comment:[]
418 CLASS="PROMPT"
419 >$ </TT
420 >rpcclient pogo -U root%bleaK.er \
422 CLASS="PROMPT"
423 >&gt; </TT
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.
427 </PRE
428 ></P
429 ></DIV
430 ></DIV
431 ><DIV
432 CLASS="SECT1"
433 ><HR><H1
434 CLASS="SECT1"
436 NAME="AEN85"
437 >The Imprints Toolset</A
438 ></H1
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/"
444 TARGET="_top"
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
449 ><DIV
450 CLASS="SECT2"
451 ><HR><H2
452 CLASS="SECT2"
454 NAME="AEN89"
455 >What is Imprints?</A
456 ></H2
458 >Imprints is a collection of tools for supporting the goals
459 of</P
461 ></P
462 ><UL
463 ><LI
465 >Providing a central repository information
466 regarding Windows NT and 95/98 printer driver packages</P
467 ></LI
468 ><LI
470 >Providing the tools necessary for creating
471 the Imprints printer driver packages.</P
472 ></LI
473 ><LI
475 >Providing an installation client which
476 will obtain and install printer drivers on remote Samba
477 and Windows NT 4 print servers.</P
478 ></LI
479 ></UL
480 ></DIV
481 ><DIV
482 CLASS="SECT2"
483 ><HR><H2
484 CLASS="SECT2"
486 NAME="AEN99"
487 >Creating Printer Driver Packages</A
488 ></H2
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
496 ></DIV
497 ><DIV
498 CLASS="SECT2"
499 ><HR><H2
500 CLASS="SECT2"
502 NAME="AEN102"
503 >The Imprints server</A
504 ></H2
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
513 CLASS="EMPHASIS"
514 >not</I
515 > recommended that this security check
516 be disabled.</P
517 ></DIV
518 ><DIV
519 CLASS="SECT2"
520 ><HR><H2
521 CLASS="SECT2"
523 NAME="AEN106"
524 >The Installation Client</A
525 ></H2
527 >More information regarding the Imprints installation client
528 is available in the <TT
529 CLASS="FILENAME"
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
536 ></P
537 ><UL
538 ><LI
540 >a set of command line Perl scripts</P
541 ></LI
542 ><LI
544 >a GTK+ based graphical interface to
545 the command line perl scripts</P
546 ></LI
547 ></UL
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
553 NT print servers.</P
555 >The basic installation process is in four steps and
556 perl code is wrapped around <B
557 CLASS="COMMAND"
558 >smbclient</B
560 and <B
561 CLASS="COMMAND"
562 >rpcclient</B
563 >.</P
565 ><PRE
566 CLASS="PROGRAMLISTING"
568 foreach (supported architecture for a given driver)
570 1. rpcclient: Get the appropriate upload directory
571 on the remote server
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
577 create the printer
578 </PRE
579 ></P
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
594 ><TT
595 CLASS="FILENAME"
596 >HKLM\System\CurrentControlSet\Control\Print\Environment
597 </TT
598 ></P
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
610 installed first.</P
611 ></DIV
612 ></DIV
613 ><DIV
614 CLASS="SECT1"
615 ><HR><H1
616 CLASS="SECT1"
618 NAME="AEN128"
620 NAME="MIGRATION"
621 ></A
622 >Migration to from Samba 2.0.x to
623 2.2.x</A
624 ></H1
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
629 several paths.</P
630 ><DIV
631 CLASS="WARNING"
633 ></P
634 ><TABLE
635 CLASS="WARNING"
636 BORDER="1"
637 WIDTH="100%"
638 ><TR
639 ><TD
640 ALIGN="CENTER"
642 >Warning</B
643 ></TD
644 ></TR
645 ><TR
646 ><TD
647 ALIGN="LEFT"
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
653 ></P
654 ><UL
655 ><LI
657 ><TT
658 CLASS="PARAMETER"
660 >printer driver file (G)</I
661 ></TT
664 ></LI
665 ><LI
667 ><TT
668 CLASS="PARAMETER"
670 >printer driver (S)</I
671 ></TT
674 ></LI
675 ><LI
677 ><TT
678 CLASS="PARAMETER"
680 >printer driver location (S)</I
681 ></TT
684 ></LI
685 ></UL
686 ></TD
687 ></TR
688 ></TABLE
689 ></DIV
691 >Here are the possible scenarios for supporting migration:</P
693 ></P
694 ><UL
695 ><LI
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
700 ></LI
701 ><LI
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
710 CLASS="COMMAND"
711 >make_printerdef</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"
715 pile.</P
716 ></LI
717 ><LI
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
723 ></LI
724 ><LI
726 >If you want to migrate an existing <TT
727 CLASS="FILENAME"
728 > printers.def</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/"
734 TARGET="_top"
735 > Imprints insrallation client</A
736 > for an example.
738 ></LI
739 ></UL
740 ></DIV
741 ></DIV
742 ></BODY
743 ></HTML