Sharing Printers with a Windows Client

Ideally there would be no need to deal with Windows clients. However, sometimes we are forced to do so. We'll need both cups and samba in order to complete this task. Make sure that you've gone through both our cups and samba sections before proceeding. I will assume that the anonymous configuration has been used in the configuration of samba. Keep in mind that for other configurations the process might vary.

The first task is for us to modify smb.conf.

vi /usr/local/etc/smb.conf

Now add the following lines:

[global]
load printers = yes
printing = cups
printcap name = cups

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root

It is not important to combine them within your other sections (ie, you do not need to merge the [global] entries with an already existing [global] section). Just place those lines at the bottom of your configuration. There is supposedly a means of making Windows clients "automagically" install the cups-samba driver, but I've never managed to make this work. Here I am outlining instructions for a slightly less clean method, that works. Note that pub is a public directory on our samba share. Now we'll make a specific directory for sharing printer drivers.

mkdir /big/samba/pub/drivers

Now we will need to download the cups-samba drivers and place them into our drivers directory. The cups-windows source is desired. Now let's unpack the tarball and move its contents to the proper directory.

tar -xf cups-windows-6.0-source.tar.gz
cd cups-windows-6.0/i386
mv * /big/samba/pub/drivers

The only thing left to do is restart our servers.

/usr/local/etc/rc.d/samba restart
/usr/local/etc/rc.d/cupsd restart

Now from a Windows client browse into the share from your FreeBSD system. Double click on the printer and when prompted to install drivers, specify the drivers that exist in the pub/drivers section of the share. You should now be able to print to your FreeBSD server from Windows Clients.