Wouldn’t it be great if you could install your printer drivers directly from the CUPS server, just like you would with a Windows print server?, rather than having to install them manually for each workstation? Getting CUPS and SAMBA to push print drivers to Windows PCs could be a real pain, especially when there so little information on the web, and the few that exists leaves important details out, making you spend hours and even days trying to figure out what you are doing wrong. I went through this myself; that is why I decided to write this tutorial. Please don’t rush though it, follow it step by step and make sure you don’t skip anything. This tutorial assumes that you have all printers already setup in CUPS. I will be using Ubuntu 10.04 as my print server. The method is same for any other Debian based Linux distribution, but you might have to change some commands for other distributions.

Copy PostScript Drivers from Windows to CUPS Server

Go into any Windows machine that has postscript printer drivers installed and enter the following directory:

c:\windows\system32\spool\drivers\w32x86\3

Copy the following files to the /usr/share/cups/drivers directory in your CUPS server:

PS5UI.DLL
PSCRIPT5.DLL
PSCRIPT.HLP
PSCRIPT.NTF

As you can see the files are all uppercase. You must convert every single letter in their filename to lowercase.

Install CUPS PostScript Windows Drivers

Go to the CUPS software download page and download the file cups-windows-6.0-sourde-tar.gz, this file contains the CUPS printer drivers for Windows. Uncompress it to a folder. Get inside the folder with your terminal screen and run:

sudo make intall

This will create 4 files in your /usr/share/cups/drivers directory. The following picture shows how the directory should look like in your CUPS server.

Prepare SAMBA

Log in to your Linux server as “root”, (in Ubuntu you have to enable the root account)

Create a SAMBA user, this user must match a user that already exist on Linux, we are going to choose root. So go to your shell prompt and issue the following commands:

smbpasswd -a root

Create samba spool directory with full permissions by issuing the command:

mkdir -m 777 /var/spool/samba

Set privileges to the Windows drivers directory at the CUPS server by issuing the following commands at your shell prompt:

Run the cupsaddsmb command to export CUPS printer drivers to SAMBA so they can bee acquired by Windows PCs:

cupsaddsmb -H localhost -U root -a -v

If the command fails check your “security” statement on the smb.conf file under [global], the command won’t run if it is set to “share” you need to set it to “user”, and restart samba. After the command runs you can change it back.

Remember to change the security statement on your smb.conf file under [global] from “user” back to “share” (if you happen to use this setting) otherwise you might not be able to see the printer list without entering a username and password. Restart CUPS and SAMBA with the following commands at your shell prompt:

sudo /etc/init.d/cups restart
sudo restart smbd

And we are done! Just remember that you have to run the cupsaddsmb command every time you install a new printer. Now you should be able to to navigate to the list of printers on your CUPS server from any Windows computer, right click on the one you wish to install, click on “connect” and driver should be automatically loaded in the windows machine. No more having to spend time manually installing drivers on each machine, now you can do it all with the click of a button.