/ Markus Amersdorfer:home / university / about:me /
\ capsaicin - my blog on growing chilis \

CUPS providing print services to Windows clients

Once you got CUPS up and running (check out this page for a more detailed description), you can easily provide printing services to the Windows world.
(I'll use the Debian packages samba-2.2.3a and cupsys-1.1.14-3 with my description here.)

Thanks to Jason Buberel for his great instructions at http://www.buberel.org/linux/cups-samba.php.
Another site dealling with CUPS under Debian can be found here.


The important settings in the [global] section are printcap name = lpstat and printing = cups.
[printers] holds print command, lpq command and lprm command besides the usual settings for a (printer) share.
The option use client driver = yes should solve the problem if you get an "access denied, no connection possible" message on the Windows client's printer window.



    workgroup = WOODS
    netbios name = forest
    server string = %h server (Samba %v)
    time server = yes
    client code page = 850
    character set = ISO8859-15
    invalid users = bin daemon adm sync shutdown halt mail news uucp operator gopher
    hosts allow = localhost
    domain logons = yes
    security = user
    os level = 255
    local master = yes
    preferred master = yes
    domain master = yes
    logon script = logon.bat
    logon drive = u:
    encrypt passwords = yes

    log file = /var/log/samba/log.%m
    max log size = 50
    deadtime = 60
    #max 02-05-04 -- Deactivating Roaming User-Profiles:
    logon home = 
    logon path = 
    domain admin group = @n-admin

    nt acl support = no

    # cups
    printcap name = lpstat
    printing = cups
    comment = The domain logon service
    path = /data/netlogon
    public = no
    writeable = no
    browsable = no

    comment = All Printers
    path = /var/spool/samba
    browseable = no
    guest ok = yes
    writable = no
    printable = yes
    print command = lpr -P %p -o raw %s -r
    lpq command = lpstat -o %p
    lprm command = cancel %p-%j
    # use client driver = yes

    comment = "Verzeichnis fuer: %u"
    browsable = no
    writeable = yes
    guest ok = no

Add-on - 03-01-14:
According to Linux New Media's Linux Magazin, edition 2/2003, article "Druckverteiler", it reads to set "print command = lp -c -d%p -oraw; rm %s" for CUPS without Libcups and "printcap name = cups". Nevertheless, the configuration mentioned above works perfectly for me.
BTW: There are 2 possibilities for Windows-clients to print: 1. Either by using printer-drivers installed on the client specific for the destination-printer and having Samba and CUPS just passing them through (keyword "raw"). 2. Have the client print to a Postscript-File and hand it to the server which then converts it to the corresponding printer-format according to its own drivers.
The article also explains on how to automatically install the correct printer drivers on a Windows-client with the driver being loaded from the Samba-server for both ways just mentioned above.

Windows 2000

After running testparm and restarting Samba, simply add the printer to the Windows client. You can use the "Add Printer Wizard" for this selecting the Linux server as the printer's host. You should install the corresponding printer driver locally, using the database of Windows 2000 itself.


Taken from Buberel's homepage:

"Lastly, a note about your system startup scripts: In order for Samba to recognize that CUPS is available as a printing system, the cups daemon must be up and running before you start your sabma daemon. On RedHat 7.3, the startup order is Samba first, then CUPS. You should change this around so that cups starts before samba. This can be done by using the 'chkconfig' tool."

Valid XHTML 1.0 Strict Valid CSS! Created with Vim [Blue Ribbon Campaign icon]
© Markus Amersdorfer
last modified: 2010-02-23 15:42:18
5790 hits