Printing From Mac via Windows
As you might imagine, one of the first things I needed to do when setting up my new MacBook Pro was to get it to print. I have two printers that are connected to an old Windows 2000 box (an HP LaserJet and a Canon color ink jet). Getting connected to these printers, via Samba, proved to be a bit of a hassle. I think the problem stemmed from the fact that the user ID I needed to use for the Samba authorization (i.e. the user ID on the Windows box to “Connect As”) contains a space, although I can’t swear to that. All I know is, I had to “wiggle a lot of wires” to get things to work. Here’s what I did:
First of all, I checked that Samba was working, in general. I could see that it was by opening Finder and establishing a connection to the Windows 2000 box for file sharing. That worked for me, right out of the box. So, it was only the shared printers that I could not reach.
Mac OS X uses a printing system, devised by Apple, called CUPS (Common Unix Printing System). I learned is that there are two ways to manage CUPS on a Mac: (1) via System Preferences | Print & Fax, and (2) via the CUPS web interface. (Well, three really, I suppose, if you count manually editing configuration files with a text editor, which I nearly had to resort to — see below.) The web interface is accessed by opening a web browser and browsing to localhost port 631 (i.e. http://localhost:631/ or http://127.0.0.1:631/).
The CUPS web interface provides a bit more control. The interface is well designed and self-explanitory. Through this interface, I easily deleted the printer specifications that I started to create earlier, and re-created them here. The only thing I found lacking was an example of addressing a printer via Samba. The protocol prefix for that is “smb:” So, for example, since my LaserJet is connected to a machine named “W2000SERVER” and shared as “HPLJ6P”, the proper URI is “smb://w2000server/hplj6p”. So far, so good. I tried printing a test page again. At this point, the web interface popped up a dialog box asking me for the “connect as” login information. I typed it in and,…. Oops, still no luck.
One of the options on the CUPS admin screen is to view the error log. Through that, I discovered that my Windows 2000 box was refusing the connection for lack of proper authentication. (My suspicion is that, under the hood, the web interface uses the dialog box input to build a command line switch, but doesn’t take into account the possibility that the user ID entered through the dialog box might contain a space and therefore needs to be quoted.)
Long story short, when I finally got things to work, it was after entering the connect-as information via System Preferences | Print & Fax (and not via the CUPS web interface). So, why didn’t that work in the first place? I’m not sure, but I think it’s something to do with how the Samba URI was put together (i.e. not put together correctly the first time around). Maybe I fat-fingered it? I dunno. What I do know is the magic incantation that worked for me was this:
- Use the CUPS web interface to define a printer, manually constructing the Samba URI (”smb://w2000server/hplj6p”), but stopping short of submitting a test print page, so that the web interface does not ask for the Samba connection authorization information.
- Switch over to System Preferences | Print & Fax, and submit a test print page from there (entering the authorization information when asked).
As a side note, somewhere along the way I managed to completely hose my CUPS configuration file. This made the CUPS startup sequence get caught in an endless loop, causing both System Preferences | Print & Fax, and the CUPS web interface to completely lock up to the point that restarting OS X didn’t even help. To solve that problem, I had to open a terminal window, login as root, and reset the CUPS configuration file back to the default settings, as follows:
login root cd /etc/cups cp cupsd.conf.default cupsd.conf
(Note: This, being a brand new machine and the first occasion for me to log in as root, I first had to enable the root account. See
http://www.spy-hill.com/~myers/help/apple/EnableRoot.html.)
Related articles:
- Beefier MacBook Pro Models Now Available
- Joining the Mac Family
- Either iGTD/iCal Sync or Quicksilver Crashes Apple Mail
Read more: Mac

Mike Groom wrote:
I’m a recent convert to Macs and I had the same problem with my new MacBook Pro but your advice solved it. My printer is an old HP DeskJet attached via USB to a PC running Windows Vista Ultimate.
I found that I had to add authentication information to the URI to get it to work. So the string is in the form:
“smb://user name:password@computer name/printer share name”
The Mac OS X Print and Fax configuration in system preferences just didn’t see my windows printer and I think it was blind to it because of the authentication problem.
Anyway, great advice. Thanks.
Posted 30 Mar 2008 at 12:03 pm ¶