March 2010
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
293031  
97

Categories

Archives

Howto Install Windows Print Drivers onto a Central Samba Share

If you’ve followed my blog for a while you’ve probably noticed that I like to automate just about everything. I can’t stand doing anything manual, at least more than once. So of course when I setup a network printer, I like to have the Windows drivers that go along with each printer available automagically over the network. This technique isn’t glaringly obvious so I thought I’d quickly document how I accomplished it.

Background

This technique requires that you already have both Samba & CUPS servers setup and configured. You should also already have the printer whose drivers we’re going to install configured and working through CUPS. You can read how I did this for the MFC-8480DN printer in this previous post.

Getting Started

First things first, you typically want to grab a copy of the Windows drivers for your particular printer. Remember, in this example I’m using the network capable, Brother MFC-8480DN, that I discussed in this previous post. I downloaded the Windows drivers from the Brother’s website here. Here’s a link the specific driver bundle that I used. Brother calls this bundle the “Add Printer Wizard Driver”. I then set them aside, so I could focus on getting the special Samba share, print$, configured. This is a special share where print drivers for all versions of Windows can be staged, for later consumption by Windows client systems that add this printer.

Samba

adding the print$ share

For my setup, which is a CentOS 5 system, I added the following stanza to my /etc/samba/smb.conf file.

1
2
3
4
5
6
7
8
9
# /etc/samba/smb.conf
 
[print$]
  comment = Printer Driver Download Area
  path = /etc/samba/drivers
  browseable = yes
  guest ok = yes
  read only = yes
  write list = @samba-printers, root

NOTE: The unpacked driver files that get added to the print$ share will be stored under /etc/samba/drivers on the Samba server. You can put them really anywhere, but I chose to keep them with the Samba config. files.

samba-printers Linux Group

Next, I created a special Linux group that I arbitrarily called samba-printers. Users in this group, in addition to root, will be the only users that have permission to add Windows drivers to the print$ Samba share. I accomplished this by adding the line below to the /etc/group file on the Samba server.

1
2
3
# /etc/group file on Samba server
 
samba-printers:x:1020:root,user1,user2

The 2 user accounts, user1 & user2, are both Linux accounts as well as Windows accounts. In my home network I typically create them this way to make things like this simpler. If you happen to user different user accounts on Windows vs. Linux you can map the Windows accounts to Linux accounts through the Samba config. file /etc/samba/smbusers.

creating /etc/samba/drivers

Next, I created the directory /etc/samba/drivers and permissioned it with our newly created Linux group using these commands:

1
2
mkdir -m ug+rwx,o-w,g+s /etc/samba/drivers
chgrp samba-printers /etc/samba/drivers

restarting Samba

Finally I needed to restart the Samba server.

1
/etc/init.d/smbd restart

Installing a Print Driver to print$

uncompressing drivers

Now I turned my attention back to that driver bundle I downloaded previously. BTW, the file I downloaded in that step was called 8480-USB2KXPVISTA-32-A-US.EXE. On one of my Windows PC’s I created a directory called c:\mfc-8480dn. I then uncompressed the 8480-USB2KXPVISTA-32-A-US.EXE file into this directory.

installing the CUPS printer

Still on the Windows PC: I brought up the Windows Run dialog box by selecting the Start Menu –> Run…. In the Run dialog I typed \\bart\mfc-8480dn. This then took me through the process of adding the CUPS managed MFC-8480DN printer to my system. Once I added this printer to my Windows PC’s I brought up the properties dialog for this printer. You can typically find these icons under the Window’s Control Panel under something called Printers in Windows 2000 or Printers and Faxes in Windows XP. Here’s a screenshot of my Printers folder on my Windows 2000 box.

printers

printers

Copying the files to print$

To start this process I first right clicked on the newly added printer, MFC-8480DN on bart, and selected Properties. I was then presented with the Properties dialog box. From here I selected the Advanced tab towards the top, and then clicked the New Driver… button.

New Driver

New Driver

This began the Add Print Driver Wizard as seen in the screenshot below. I then clicked the Next button.

wizard

wizard

From here I clicked the Have Disk… button as in this screenshot.

Have Disk

Have Disk

In the Install From Disk dialog I selected the Browse button.

browse

browse

In the Locate File dialog, I browsed to the location where I uncompressed the driver files, i.e. C:\mfc-8480dn\usa, and clicked the Open button.

inf file

inf file

I was then returned to the Add Printer Driver Wizard dialog and presented with a potential list of printers to choose from. Here I chose the MFC-8480DN Printer, and clicked the Next button.

select printer

select printer

You should now be back at the Install From Disk dialog window. The location of your drivers, C:\mfc-8480dn\usa in my case, was displayed in the Copy manufacturer’s files from: field. I then clicked the OK button.

Install driver

Install driver

Finally I was at the end of the Add Printer Driver Wizard. I clicked the Finish button which began installing the drivers to the print$ Samba share.

Copy files

Copy files

If everything was setup correctly, you should now see the contents of the directory C:\mfc-8480dn\usa being copied to the Samba server, i.e. \\bar\print$\….

transfer dialog

transfer dialog

verify the drivers are on print$

checking from windows

To double check that the files were correctly installed, you can login to the Samba server and do an ls to see that the files were in fact copied to print$. Simply look around in the /etc/samba/drivers directory.

Additionally you can see what print drivers are available for a given printer by bringing up a printer’s Properties dialog, and selecting the Sharing tab. Once you’ve got the Sharing tab open, click on the Additional Drivers… button.

additional drivers

additional drivers

In the Additional Drivers dialog box, you’ll see the word Yes next to each platform that has a driver available for this particular printer, on the print$ share. The check mark denotes which driver you’re printer is using.

available drivers

drivers available per platform

checking from linux

If you have the package samba-client under CentOS/RHEL/Fedora installed you should see a program available called rpcclient. You can use this program to query a samba server to get a list of available drivers.

1
2
3
4
5
6
7
# rpcclient <samba server> -U root -c "enumdrivers"
 
% rpcclient bart -U root -c "enumdrivers"
 
[Windows NT x86]
Printer Driver Info 1:
	Driver Name: [Brother MFC-8480DN Printer]

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>