Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Samba HowTo Guide
Prev Home Next

Note

More recent drivers on Windows 2000 and Windows XP are installed into the “3” subdirectory instead of the “2”. The version 2 of drivers, as used in Windows NT, were running in kernel mode. Windows 2000 changed this. While it still can use the kernel mode drivers (if this is enabled by the Admin), its native mode for printer drivers is user mode execution. This requires drivers designed for this purpose. These types of drivers install into the “3” subdirectory.

Obtaining Driver Files from Windows Client [print$] Shares

Now we need to collect all the driver files we identified in our previous step. Where do we get them from? Well, why not retrieve them from the very PC and the same [print$] share that we investigated in our last step to identify the files? We can use smbclient to do this. We will use the paths and names that were leaked to us by getdriver . The listing is edited to include line breaks for readability:

root# 

smbclient //TURBO_XP/print\$ -U'Danka%xxxx' \ 
   -c 'cd W32X86/2;mget HD*_de.* hd*ppd Hd*_de.* Hddm*dll HDN*Aux.DLL'


added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
Got a positive name query response from 10.160.50.8 ( 10.160.50.8 )
Domain=[DEVELOPMENT] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Get file Hddm91c1_de.ABD? 

n

Get file Hddm91c1_de.def? 

y

getting file \W32X86\2\Hddm91c1_de.def of size 428 as Hddm91c1_de.def
Get file Hddm91c1_de.DLL? 

y

getting file \W32X86\2\Hddm91c1_de.DLL of size 876544 as Hddm91c1_de.DLL
[...]

After this command is complete, the files are in our current local directory. You probably have noticed that this time we passed several commands to the -c parameter, separated by semicolons. This ensures that all commands are executed in sequence on the remote Windows server before smbclient exits again.

Remember to repeat the procedure for the WIN40 architecture should you need to support Windows 9x/Me/XP clients. Remember too, the files for these architectures are in the WIN40/0/ subdirectory. Once this is complete, we can run smbclient. . .put to store the collected files on the Samba server's [print$] share.

Installing Driver Files into [print$]

We are now going to locate the driver files into the [print$] share. Remember, the UNIX path to this share has been defined previously in your smb.conf file. You also have created subdirectories for the different Windows client types you want to support. If, for example, your [print$] share maps to the UNIX path /etc/samba/drivers/, your driver files should now go here:

  • For all Windows NT, 2000, and XP clients, /etc/samba/drivers/W32X86/ but not (yet) into the 2 subdirectory.

  • For all Windows 95, 98, and Me clients, /etc/samba/drivers/WIN40/ but not (yet) into the 0 subdirectory.

We again use smbclient to transfer the driver files across the network. We specify the same files and paths as were leaked to us by running getdriver against the original Windows install. However, now we are going to store the files into a Samba/UNIX print server's [print$] share.

root# 

smbclient //SAMBA-CUPS/print\$ -U'root%xxxx' -c \
  'cd W32X86; put HDNIS01_de.DLL; \
  put Hddm91c1_de.ppd; put HDNIS01U_de.DLL;        \
  put HDNIS01U_de.HLP; put Hddm91c1_de.DLL;        \
  put Hddm91c1_de.INI; put Hddm91c1KMMin.DLL;      \
  put Hddm91c1_de.dat; put Hddm91c1_de.dat;        \
  put Hddm91c1_de.def; put Hddm91c1_de.hre;        \
  put Hddm91c1_de.vnd; put Hddm91c1_de.hlp;        \
  put Hddm91c1_de_reg.HLP; put HDNIS01Aux.dll;     \
  put HDNIS01_de.NTF'


added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
Got a positive name query response from 10.160.51.162 ( 10.160.51.162 )
Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]
putting file HDNIS01_de.DLL as \W32X86\HDNIS01_de.DLL
putting file Hddm91c1_de.ppd as \W32X86\Hddm91c1_de.ppd
putting file HDNIS01U_de.DLL as \W32X86\HDNIS01U_de.DLL
putting file HDNIS01U_de.HLP as \W32X86\HDNIS01U_de.HLP
putting file Hddm91c1_de.DLL as \W32X86\Hddm91c1_de.DLL
putting file Hddm91c1_de.INI as \W32X86\Hddm91c1_de.INI
putting file Hddm91c1KMMin.DLL as \W32X86\Hddm91c1KMMin.DLL
putting file Hddm91c1_de.dat as \W32X86\Hddm91c1_de.dat
putting file Hddm91c1_de.dat as \W32X86\Hddm91c1_de.dat
putting file Hddm91c1_de.def as \W32X86\Hddm91c1_de.def
putting file Hddm91c1_de.hre as \W32X86\Hddm91c1_de.hre
putting file Hddm91c1_de.vnd as \W32X86\Hddm91c1_de.vnd
putting file Hddm91c1_de.hlp as \W32X86\Hddm91c1_de.hlp
putting file Hddm91c1_de_reg.HLP as \W32X86\Hddm91c1_de_reg.HLP
putting file HDNIS01Aux.dll as \W32X86\HDNIS01Aux.dll
putting file HDNIS01_de.NTF as \W32X86\HDNIS01_de.NTF

Whew that was a lot of typing! Most drivers are a lot smaller many have only three generic PostScript driver files plus one PPD. While we did retrieve the files from the 2 subdirectory of the W32X86 directory from the Windows box, we do not put them (for now) in this same subdirectory of the Samba box. This relocation will automatically be done by the adddriver command, which we will run shortly (and do not forget to also put the files for the Windows 9x/Me architecture into the WIN40/ subdirectory should you need them).

smbclient to Confirm Driver Installation

For now we verify that our files are there. This can be done with smbclient , too (but, of course, you can log in via SSH also and do this through a standard UNIX shell access):

root# 

smbclient //SAMBA-CUPS/print\$ -U 'root%xxxx' \
	-c 'cd W32X86; pwd; dir; cd 2; pwd; dir'

 added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
Got a positive name query response from 10.160.51.162 ( 10.160.51.162 )
Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.8a]

Current directory is \\SAMBA-CUPS\print$\W32X86\
.                                  D        0  Sun May  4 03:56:35 2003
..                                 D        0  Thu Apr 10 23:47:40 2003
2                                   D        0  Sun May  4 03:56:18 2003
HDNIS01Aux.dll                      A    15356  Sun May  4 03:58:59 2003
Hddm91c1KMMin.DLL                   A    46966  Sun May  4 03:58:59 2003
HDNIS01_de.DLL                      A   434400  Sun May  4 03:58:59 2003
HDNIS01_de.NTF                      A   790404  Sun May  4 03:56:35 2003
Hddm91c1_de.DLL                     A   876544  Sun May  4 03:58:59 2003
Hddm91c1_de.INI                     A      101  Sun May  4 03:58:59 2003
Hddm91c1_de.dat                     A     5044  Sun May  4 03:58:59 2003
Hddm91c1_de.def                     A      428  Sun May  4 03:58:59 2003
Hddm91c1_de.hlp                     A    37699  Sun May  4 03:58:59 2003
Hddm91c1_de.hre                     A   323584  Sun May  4 03:58:59 2003
Hddm91c1_de.ppd                     A    26373  Sun May  4 03:58:59 2003
Hddm91c1_de.vnd                     A    45056  Sun May  4 03:58:59 2003
HDNIS01U_de.DLL                     A   165888  Sun May  4 03:58:59 2003
HDNIS01U_de.HLP                     A    19770  Sun May  4 03:58:59 2003
Hddm91c1_de_reg.HLP                 A   228417  Sun May  4 03:58:59 2003
              40976 blocks of size 262144. 709 blocks available

Current directory is \\SAMBA-CUPS\print$\W32X86\2\
.                                  D        0  Sun May  4 03:56:18 2003
..                                 D        0  Sun May  4 03:56:35 2003
ADOBEPS5.DLL                        A   434400  Sat May  3 23:18:45 2003
laserjet4.ppd                       A     9639  Thu Apr 24 01:05:32 2003
ADOBEPSU.DLL                        A   109568  Sat May  3 23:18:45 2003
ADOBEPSU.HLP                        A    18082  Sat May  3 23:18:45 2003
PDFcreator2.PPD                     A    15746  Sun Apr 20 22:24:07 2003
              40976 blocks of size 262144. 709 blocks available

Notice that there are already driver files present in the 2 subdirectory (probably from a previous installation). Once the files for the new driver are there too, you are still a few steps away from being able to use them on the clients. The only thing you could do now is retrieve them from a client just like you retrieve ordinary files from a file share, by opening print$ in Windows Explorer. But that wouldn't install them per Point'n'Print. The reason is that Samba does not yet know that these files are something special, namely printer driver files , and it does not know to which print queue(s) these driver files belong.

Running rpcclient with adddriver

Next, you must tell Samba about the special category of the files you just uploaded into the [print$] share. This is done by the adddriver command. It will prompt Samba to register the driver files into its internal TDB database files. The following command and its output has been edited for readability:

root# 

rpcclient -Uroot%xxxx -c 'adddriver "Windows NT x86" \
  "dm9110:HDNIS01_de.DLL: \
  Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP:   \
  NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,          \
  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,   \
  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \
  HDNIS01Aux.dll,HDNIS01_de.NTF,                     \
  Hddm91c1_de_reg.HLP' SAMBA-CUPS


cmd = adddriver "Windows NT x86" \
  "dm9110:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL:   \
  HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \
  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,          \
  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL,        \
  HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP"

Printer Driver dm9110 successfully installed.

After this step, the driver should be recognized by Samba on the print server. You need to be very careful when typing the command. Don't exchange the order of the fields. Some changes would lead to an NT_STATUS_UNSUCCESSFUL error message. These become obvious. Other changes might install the driver files successfully but render the driver unworkable. So take care! Hints about the syntax of the adddriver command are in the man page. provides a more detailed description, should you need it.

Checking adddriver Completion

One indication for Samba's recognition of the files as driver files is the successfully installed message. Another one is the fact that our files have been moved by the adddriver command into the 2 subdirectory. You can check this again with smbclient :

root# 

smbclient //SAMBA-CUPS/print\$ -Uroot%xx \
	-c 'cd W32X86;dir;pwd;cd 2;dir;pwd'

 added interface ip=10.160.51.162 bcast=10.160.51.255 nmask=255.255.252.0
 Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]

  Current directory is \\SAMBA-CUPS\print$\W32X86\
  .                                  D        0  Sun May  4 04:32:48 2003
  ..                                 D        0  Thu Apr 10 23:47:40 2003
  2                                   D        0  Sun May  4 04:32:48 2003
                40976 blocks of size 262144. 731 blocks available 

  Current directory is \\SAMBA-CUPS\print$\W32X86\2\
  .                                  D        0  Sun May  4 04:32:48 2003
  ..                                 D        0  Sun May  4 04:32:48 2003
  DigiMaster.PPD                      A   148336  Thu Apr 24 01:07:00 2003
  ADOBEPS5.DLL                        A   434400  Sat May  3 23:18:45 2003
  laserjet4.ppd                       A     9639  Thu Apr 24 01:05:32 2003
  ADOBEPSU.DLL                        A   109568  Sat May  3 23:18:45 2003
  ADOBEPSU.HLP                        A    18082  Sat May  3 23:18:45 2003
  PDFcreator2.PPD                     A    15746  Sun Apr 20 22:24:07 2003
  HDNIS01Aux.dll                      A    15356  Sun May  4 04:32:18 2003
  Hddm91c1KMMin.DLL                   A    46966  Sun May  4 04:32:18 2003
  HDNIS01_de.DLL                      A   434400  Sun May  4 04:32:18 2003
  HDNIS01_de.NTF                      A   790404  Sun May  4 04:32:18 2003
  Hddm91c1_de.DLL                     A   876544  Sun May  4 04:32:18 2003
  Hddm91c1_de.INI                     A      101  Sun May  4 04:32:18 2003
  Hddm91c1_de.dat                     A     5044  Sun May  4 04:32:18 2003
  Hddm91c1_de.def                     A      428  Sun May  4 04:32:18 2003
  Hddm91c1_de.hlp                     A    37699  Sun May  4 04:32:18 2003
  Hddm91c1_de.hre                     A   323584  Sun May  4 04:32:18 2003
  Hddm91c1_de.ppd                     A    26373  Sun May  4 04:32:18 2003
  Hddm91c1_de.vnd                     A    45056  Sun May  4 04:32:18 2003
  HDNIS01U_de.DLL                     A   165888  Sun May  4 04:32:18 2003
  HDNIS01U_de.HLP                     A    19770  Sun May  4 04:32:18 2003
  Hddm91c1_de_reg.HLP                 A   228417  Sun May  4 04:32:18 2003
                40976 blocks of size 262144. 731 blocks available

Another verification is that the timestamp of the printing TDB files is now updated (and possibly their file size has increased).

Check Samba for Driver Recognition

Now the driver should be registered with Samba. We can easily verify this and will do so in a moment. However, this driver is not yet associated with a particular printer. We may check the driver status of the files by at least three methods:

  • From any Windows client browse Network Neighborhood, find the Samba host, and open the Samba Printers and Faxes folder. Select any printer icon, right-click and select the printer Properties. Click the Advanced tab. Here is a field indicating the driver for that printer. A drop-down menu allows you to change that driver (be careful not to do this unwittingly). You can use this list to view all drivers known to Samba. Your new one should be among them. (Each type of client will see only its own architecture's list. If you do not have every driver installed for each platform, the list will differ if you look at it from Windows95/98/ME or Windows NT/2000/XP.)

  • From a Windows 200x/XP client (not Windows NT) browse Network Neighborhood, search for the Samba server, open the server's Printers folder, and right-click on the white background (with no printer highlighted). Select Server Properties. On the Drivers tab you will see the new driver listed. This view enables you to also inspect the list of files belonging to that driver (this does not work on Windows NT, but only on Windows 2000 and Windows XP; Windows NT does not provide the Drivers tab). An alternative and much quicker method for Windows 2000/XP to start this dialog is by typing into a DOS box (you must of course adapt the name to your Samba server instead of SAMBA-CUPS ):

    	
    rundll32 printui.dll,PrintUIEntry /s /t2 /n\\
    SAMBA-CUPS
    
    
    
    	

  • From a UNIX prompt, run this command (or a variant thereof), where SAMBA-CUPS is the name of the Samba host and xxxx represents the actual Samba password assigned to root:

    	
    rpcclient -U'root%xxxx' -c 'enumdrivers' 
    SAMBA-CUPS
    
    
    
    	

    You will see a listing of all drivers Samba knows about. Your new one should be among them. But it is only listed under the [Windows NT x86] heading, not under [Windows 4.0] , since you didn't install that part. Or did you? In our example it is named dm9110. Note that the third column shows the other installed drivers twice, one time for each supported architecture. Our new driver only shows up for Windows NT 4.0 or 2000. To have it present for Windows 95, 98, and Me, you'll have to repeat the whole procedure with the WIN40 architecture and subdirectory.

Specific Driver Name Flexibility

You can name the driver as you like. If you repeat the adddriver step with the same files as before but with a different driver name, it will work the same:

root# 

rpcclient -Uroot%xxxx         \
  -c 'adddriver "Windows NT x86"                     \
  "mydrivername:HDNIS01_de.DLL:              \
  Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP:   \
  NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,          \
  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,   \
  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \
  HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP' SAMBA-CUPS
  


cmd = adddriver "Windows NT x86" \
 "mydrivername:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL:\
  HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,           \
  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,                    \
  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL,                  \
  HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP"

Printer Driver mydrivername successfully installed.

You will be able to bind that driver to any print queue (however, you are responsible that you associate drivers to queues that make sense with respect to target printers). You cannot run the rpcclient adddriver command repeatedly. Each run consumes the files you had put into the [print$] share by moving them into the respective subdirectories, so you must execute an smbclient ... put command before each rpcclient ... adddriver command.

Running rpcclient with setdriver

Samba needs to know which printer owns which driver. Create a mapping of the driver to a printer, and store this information in Samba's memory, the TDB files. The rpcclient setdriver command achieves exactly this:

root# 

rpcclient -U'root%xxxx' -c 'setdriver dm9110 mydrivername' 
SAMBA-CUPS



 cmd = setdriver dm9110 mydrivername

Successfully set dm9110 to driver mydrivername.

Ah, no, I did not want to do that. Repeat, this time with the name I intended:

root# 

rpcclient -U'root%xxxx' -c 'setdriver dm9110 dm9110' 
SAMBA-CUPS



 cmd = setdriver dm9110 dm9110
Successfully set dm9110 to driver dm9110.

The syntax of the command is:


rpcclient -U'root%
sambapassword
' -c 'setdriver 
printername
 \
 
drivername
' 
SAMBA-Hostname


. 

Now we have done most of the work, but not all of it.

Samba HowTo Guide
Prev Home Next

 
 
  Published under the terms fo the GNU General Public License Design by Interspire