How to Configure Automatic Printer Driver Download by Integrating CUPS and SAMBA



This AppNote describes how to integrate CUPS with the SAMBA service to provide an easy and reliable print service for your network environment.

SAMBA is an open source suite that has, since 1992, provided file and print services to all manner of SMB/CIFS clients, including the numerous versions of Microsoft Windows operating systems. Samba is freely available under the GNU General Public License. For Linux, there are two daemons for Samba server: smnd for SMB/CIFS services and nmbd for naming services.

CUPS is a modularised computer printing system for Unix-like operating systems that allows computers to act as powerful print servers. A computer running CUPS is a host which can accept print jobs from client computers, process them, and send them to the appropriate printer.

Packages Requirements

To perform this integration, you will need to install the following packages:

  • cups
  • cups-client
  • cups-drivers-stp
  • cups-SUSE-ppds-dat
  • cups-libs
  • cups-backends
  • cups-drivers
  • samba
  • samba-client
  • samba-winbind


  1. Edit the file /etc/samba/smb.conf and change the following settings:
             load printers = yes
             printing = cups
             printcap name = cups
             comment = All Printers
             path = /var/tmp
             browseable = no
             public = yes
             guest ok = yes
             writable = no
             printable = yes
             comment = Printer Drivers
             path = /etc/samba/drivers
             browseable = yes
             guest ok = no
             read only = yes
             write list = root
  2. You need to reload your samba service, using the following command:
    rcsmb reload
  3. In this next step we will copy the Adobe Postscript driver files to the CUPS data directory /usr/share/cups/drivers. For licensing reasons, you will need to download this driver directly from the Adobe website | (Adobe Universal PostScript Windows Driver). The files needs to be copied using UPPERCASE filenames:
    -------------- LS command listing the files --------------
    sles10:/usr/share/cups/drivers # ls
  4. After you setup a printer within CUPS through the available methods (lpadmin command, CUPS portal or YaST), you will use the command cupsaddsmb to set the driver files for client automatically download and installation after the first one contact with this printer share. The cupsaddsmb is a script that copies the needed files for convenient Windows client installations from the CUPS data directory to the [print$] share. Also, it copies the PPD files associated with this printer from /etc/cups/ppd to the [print$] share.


    # cupsaddsmb -v <cups printer name>


    sles10:/ # cupsaddsmb -v HP4050
    Password for root required to access localhost via SAMBA:
    Running command: smbclient //localhost/print\$ -N -U'root%novell' -c 'mkdir
    W32X86;put /var/spool/cups/tmp/45f97eeb64ea2 W32X86/HP4050.PPD;put
    /usr/share/cups/drivers/ADOBEPS5.DLL W32X86/ADOBEPS5.DLL;put /usr/share/cups/drivers/ADOBEPSU.DLL
    W32X86/ADOBEPSU.DLL;put /usr/share/cups/drivers/ADOBEPSU.HLP W32X86/ADOBEPSU.HLP'
    Domain=[GW7LX] OS=[Unix] Server=[Samba 3.0.20b-3.15-1162-SUSE]
    NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
    putting file /var/spool/cups/tmp/45f97eeb64ea2 as \W32X86/HP4050.PPD (12812.8 kb/s) (average 12813.1 kb/s)
    putting file /usr/share/cups/drivers/ADOBEPS5.DLL as \W32X86/ADOBEPS5.DLL (15409.4 kb/s) (average 15027.7 kb/s)
    putting file /usr/share/cups/drivers/ADOBEPSU.DLL as \W32X86/ADOBEPSU.DLL (14722.1 kb/s) (average 14963.7 kb/s)
    putting file /usr/share/cups/drivers/ADOBEPSU.HLP as \W32X86/ADOBEPSU.HLP (9008.8 kb/s) (average 14699.1 kb/s)
    Running command: rpcclient localhost -N -U'root%novell' -c 'adddriver "Windows NT x86"
    Printer Driver HP4050 successfully installed.
    Running command: smbclient //localhost/print\$ -N -U'root%novell' -c 'mkdir
    WIN40;put /var/spool/cups/tmp/45f97eeb64ea2 WIN40/HP4050.PPD;put
    /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;put
    /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;put
    /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;put
    /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD;put
    /usr/share/cups/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;put
    /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
    Domain=[GW7LX] OS=[Unix] Server=[Samba 3.0.20b-3.15-1162-SUSE]
    NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
    putting file /var/spool/cups/tmp/45f97eeb64ea2 as \WIN40/HP4050.PPD (12812.8 kb/s) (average 12813.1 kb/s)
    putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM (15191.4 kb/s) (average 14908.3 kb/s)
    putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV (15065.1 kb/s) (average 15012.8 kb/s)
    putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP (14758.0 kb/s) (average 14989.0 kb/s)
    putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD (13174.5 kb/s) (average 14976.1 kb/s)
    putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL (14419.7 kb/s) (average 14946.0 kb/s)
    putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (13999.7 kb/s) (average 14921.1 kb/s)
    Running command: rpcclient localhost -N -U'root%novell' -c 'adddriver "Windows 4.0"
    Printer Driver HP4050 successfully installed.
    Running command: rpcclient localhost -N -U'root%novell' -c 'setdriver HP4050 HP4050'
    Succesfully set HP4050 to driver HP4050.

    NOTE #1: during the process, the script will request the samba root password.
    NOTE #2: the parameter -v is used to get a verbose output
    NOTE #3: you can use the parameter -a to configure all printers and driver: cupsaddsmb -v -a

  5. Ready! Now your Windows workstations are able to download the printer driver directly from the server. From the workstation, browse to the CUPS/Samba server, open the Printers share, right-click on this printer and select “Install” or just double-click its. So, you should have a new printer in your workstation local “Printer” folder (in my LAB, “HP4050 on sles10srv”).

There is other way to configure automatically drivers download, you can upload the driver from the workstation to the [print$] samba share. But, in this case you need to use the “RAW” driver in the printer installation on CUPS service.

  1. Log into the workstation as the domain root (this is the Administrator account for the operating system that is the host platform for this implementation of Samba.
  2. Launch MS Windows Explorer. Navigate in the left panel. Click My Network Places->Entire Network->Microsoft Windows Network->”Your domain”->”Your server”. Click on Massive Printers and Faxes.
  3. Identify a printer that is shown in the right panel. Let’s assume the printer is called HP4050. Right-click on the HP4050 icon and select the Properties entry. This opens a dialog box that indicates that “The printer driver is not installed on this computer. Some printer properties will not be accessible unless you install the printer driver. Do you want to install the driver now?” It is important at this point to answer No.
  4. The printer properties panel for the HP4050 printer on your server is displayed. Click the Advanced tab. Note that the box labeled Driver is empty. Click the New Driver button that is next to the Driver box. This launches the “Add Printer Wizard”.
  5. The “Add Printer Driver Wizard on <your server>” panel is now showed. Click Next to continue. From the left panel, select the printer manufacturer. In the right panel, select the printer. Click Next, and then Finish to start the driver upload.
  6. The driver upload can take few minutes. When it completes, you are returned to the Advanced tab in the Properties panel.
  7. Click OK. It will take a minute or so to upload the settings to the server. You will return to the Printers and Faxes screen. Right-click on the printer, click Properties->Device Settings. Now change the settings to suit your requirements. You need to change one setting and apply the changes. This is necessary so that the printer settings are initialized in the Samba printers database. Click Apply to commit your settings. Revert any settings you changed just to initialize the Samba printers database entry for this printer. If you need to revert a setting, click Apply again.
  8. Ready! Now, your workstations are able to download this printer driver automatically. You must repeat this process for all network printers (for every printer on each server).

More information


(Visited 1 times, 1 visits today)


  • itsssusa says:

    you install the universal adobe postscript drivers but end up using some hp driver instead – what is the point?

    Also, sles10 is still using cups 1.1 which is unsupported and cannot make use of the improved cups-windows postscript driver:

    # rpm -ivh /tmp/cups-windows-6.0-1.i386.rpm
    error: Failed dependencies:
    cups >= 1:1.2 is needed by cups-windows-6.0-1.i386
    # rpm -q cups
    # cat /etc/*-release
    SUSE Linux Enterprise Server 10 (x86_64)
    VERSION = 10

    Given that cups is now at 1.3.x isnt it about time sles caught up?

  • Leave a Reply

    Your email address will not be published. Required fields are marked *