Network Installation of Windows Printers from Samba

The combination of Samba and CUPS makes network printing on a mixed Linux/Windows LAN easier than ever. You can share Linux printers with Windows clients, and Windows printers with Linux clients. A Linux/Samba/CUPS printer server is reliable and reasonably simple to set up and maintain.

CUPS without Samba makes an excellent print server for both Windows and Linux clients. But it has one drawback: no network installation of Windows printer drivers. CUPS automatically shares printer drivers with Linux hosts with no extra work on your part; CUPS and Samba together can do the same for Windows hosts. You should have a functioning LAN, all of your Windows hosts in the same workgroup, a Linux machine already running at least one printer with CUPS, and Samba installed and ready to go to work.

When you're first trying this out, it is all right to run the commands as root, like in the following examples. It makes it easier to troubleshoot. But after you get the hang of it, it is better to create a user just for Samba administration chores.

Obtaining Drivers

The Adobe driver package works for all versions of Windows, so you can do without the CUPS drivers. The CUPS driver set is a better choice for Windows NT/2000/XP, because it offers more features and better performance. But the CUPS drivers do not support Windows 95/98/ME; you will still need the Adobe drivers for those. These are the files needed:

In this article, we'll use only the Adobe drivers. Download the Adobe driver installer (the English version is called winsteng.exe) to a Windows PC and run the installer (even if you don't have a printer to install), so you can copy the files you need to your Samba server. Look for these two directories after installation: w32x86, which contains the files for Windows NT/2000/XP, and WIN40, which contains the files for Windows 95/98/ME.

The next step is to edit smb.conf to set up a printers and a print$ share. You must use these exact share names, as they are special reserved Samba shares. This is a complete example for wide-open, no-login network printer installations. Of course you will use your own hostnames, workgroup name, and network addresses:

Use your Samba password. You should see bales of output fly by, and the last two lines should resemble the example above. The last thing to do is edit smb.conf one more time. Change security = user to security = share, and then restart Samba. There may be a more elegant way to do this; the problem is you need user-level security to enable root to log in to Samba and run cupsaddsmb. But for users to install network printers without requiring Samba accounts, you need share-level security.

You should now be able to go to any Windows PC on your Samba LAN and install printers over the network, and Samba will automatically download the drivers.

Linux Printer Server

This is a great way to build a dedicated Linux print server. You can fine-tune access to printers any
way you like with the usual Samba accounts and access controls. Use an old Pentium--don't clutter landfills; there's lots of life in those old PCs. Connect several parallel port printers to a single printer server by using PCI parallel expansion cards. USB printers are even easier and cheaper--a four-port USB hub costs around $20.

Resources

Chapter 23 of the Linux Cookbook has recipes for using Samba as a file server, for a peer network, for a domain controller, and all kinds of printing scenarios. Chapter 14 (free sample chapter!) covers printing with CUPS, including how to build a printer server for Windows without Samba.

Chapter 19 of The Official Samba-3 HOWTO and Reference Guide covers printing in extreme detail. See the Samba list archives for solutions to almost any problem.