Push Windows Printer Drivers with CUPS - Page 2

 By Carla Schroder
Page 2 of 2   |  Back to Page 1
Print Article

CUPS Windows Drivers

Download and unpack the CUPS Windows drivers, currently cups-windows-6.0-source.tar.gz. Enter the source directory and run this command:

# make install
Creating directory /usr/share/cups/drivers...
Installing cups6.inf...
Installing cups6.ini...
Installing cupsps6.dll...
Installing cupsui6.dll...

Now you need either the Postscript drivers copied from a Windows PC, or get the Adobe drivers, winsteng.exe. They're all the same; get the Adobe drivers if you can't find them on your Windows PC.

To use the Adobe drivers, download and install them on a Windows system. You don't need a printer, you just want to extract the files. On Windows 2000/XP, look for the windowssystem32spooldriversw32x86 directory. On Windows 9x/ME look for the WIN40 directory. Copy the contents of these directories into /usr/share/cups/drivers directory on the Samba/CUPS server. This is how it looks for Windows 2000/XP:

Add these for Windows 9x/ME:
Be to sure to convert all filenames to lowercase. If you don't cupsaddsmb won't work.

Export CUPS Drivers to Samba

Now create a Samba user. This must correspond to a Linux system user. The easy way is to use root:

# smbpasswd -a root
New SMB password:
Retype new SMB password:

Now export the CUPS drivers to Samba with cupsaddsmb. If you have more than one Samba server on your network, disconnect from the network first or cupsaddsmb will go nuts trying to install all the printers, which won't work:

# ifdown eth0

To export the drivers, use the command:

# cupsaddsmb -H localhost -U root -a -v

Figure 1.(Click for a larger image)
You can get an idea of just how much output the command produces, and what you should expect to see, by looking at Figure 1.

Important smb.conf Tweak

Go back to your smb.conf and make a small but very important change. Change security = user to security = share. If you don't, you'll have to set up Samba users and passwords for all of your users.

Restart CUPS and Samba, and rejoin the network:

# /etc/init.d/samba restart
# /etc/init.d/cupsys restart
# ifup eth0

Automagic Windows Installation

Give Samba a minute or two to broadcast itself to your LAN. Then go to any Windows PC on your LAN, run the Add Printer Wizard, and voila! Automatic printer installation from the Samba server.

Now What?

If you get a message like "the printer server does not have the correct printer driver installed" you have a couple of options. First, test the offending .ppd file with the cupstestppd command. PPD files are plain text files, so if you can find an error you can fix it.

Another option is to search for a .ppd file that Windows will accept. You might find this on another Windows PC, on the same Adobe page where you downloaded the Postscript drivers, or on linuxprinting.org.

Finally, the worst-case scenario is you have to hunt down a driver CD, and don't forget your Windows CD, and install the drivers locally. True, this means leaving the lair, but with a bit of luck it won't happen often.


The Official Samba-3 HOWTO and Reference Guide

This article was originally published on Jul 24, 2007
Get the Latest Scoop with Networking Update Newsletter