Sharing a USB printer from Mac OS X to Windows

Not too long ago I was asked to use hook up the Mac Mini that was collecting dust in our office to our HP Deskjet printer (HP Deskjet 1280 to be exact) and have it function as a “print server” of sorts (we have since replaced it with a NAS with print server functionality, which subsequently broke - that’s how long this post has been sitting in my drafts folder). While setting it up to be shared with Mac machines was a cinch (we have a grand total of 3 Mac machines in the office, including the Mac Mini and my treasured MacBook Pro), sharing the printer from the Mac (Mini) to Windows machines was significantly more difficult. After some trial and error, first with what made the most sense, and then with stuff I could glean off the Internet, I finally arrived at something that works. Maybe this would be useful for the next unfortunate bloke that needs to do this sharing of printers from Mac to Windows machines without a print server.

First point of reference: Print from Windows XP to a shared Mac printer tip on Mac OS X Hints. The tip suggests you select a PostScript driver in Windows after finding it on the network (which requires you to do several things first, but we will come to that later). This worked, but it was sub-optimal because you couldn’t use the printer driver software to do stuff like 2-up printing (i.e. print 2 pages per side per sheet). This post will show you how to share a USB printer from Mac OS X to Windows PCs with full driver capability.

  1. On the Mac (the one that the USB printer that you want to share is connected to), go to the Sharing preferences pane and ensure Printer Sharing and Windows Sharing are both turned on.
  2. Fire up your browser and go to http://127.0.0.1:631 - this is the web interface to CUPS. When asked to enter a password, login with your Mac OS X user account (it has to be an administrator account).
  3. Go to the Printers tab and add a new printer (yes, in addition to any existing printer configuration that already exist for the same printer). Choose a name that’s short and descriptive (no spaces). For the purposes of this guide, let’s call it ‘uberprinter’. Best to keep it under 12 characters since Windows is finicky.
  4. When asked to select a device, select USB printer.
  5. You’ll be asked for a Device URI. To find out, open up a terminal and type lpinfo -v. You should see your USB printer coming up. Mine came up as ‘direct usb://HP/Deskjet%201280?serial=CN516851RPUN’. Copy and paste this (without the ‘direct’ part - i.e., I’d have copied ‘usb://HP/Deskjet%201280?serial=CN516851RPUN’) into the ‘Device URI’ field.
  6. Select a ‘Make’ of ‘Raw‘. Keep going until the printer is added.
  7. You’re done configuring from the Mac. But before you go, determine your Mac’s IP address (do a ‘ifconfig’ in a shell or fire up System Profiler and check out the ‘Network’ item) - note it down somewhere. Now it’s time to hook up your Windows machine to use the shared printer.
  8. OK now go to your Windows machine and add a new printer (Control Panel -> Printers and Faxes). Select ‘A network printer… blah blah’. Don’t browse for the printer, you will enter its IP address directly in the ‘URL’ field. Enter ‘http://your.macs.ip.address:631/printers/uberprinter’ (replacing ‘your.macs.ip.address’ with your Mac’s IP address and ‘uberprinter’ with the short name you gave your printer). If you can’t remember your printer’s name, just scurry back to the Mac and browse to http://127.0.0.1:631/printers/. You should be able to see the printer you added listed there - its name is linked there.
  9. Now, all that’s left is to install the correct Windows printer driver on the Windows machine. If you’re lucky Windows already has your driver, if not do whatever you need to get the proper driver - after all, the purpose of jumping through all these hoops is to get full printer driver functionality off the shared Mac printer.

That’s it. That’ll teach you for not getting a print server or one of those new printers with network functionality.

Problems?

Some readers wrote in with their own difficulties and have kindly allowed me to share their solutions. First off, Patrick McKrell who had a solution for cases where you still are just not able to print from the Windows machine (it involves killing a daemon so it’s pretty sweet).

Thank you for making available your instructions for sharing a USB printer connected to a Mac using OS X with a Windows PC. All of your points worked flawlessly on the Mac. My Mac is a B&W G3 running OS X 10.2.8. The printer is an HP PSC 1510.

Back to Windows Add Printer. Is my driver there? No. I browsed the Windows file system to Program Files/HP/. No luck. Couldn’t find or add my driver. Next I unplugged the printer’s USB cable from the Mac and into the PC. Windows detected the new hardware, created whatever files it needed, and automatically created the USB-connected PSC 1500 series printer in Printers and Faxes. Well, that’s pretty darn close. I opened the printer’s properties, changed the port from USB to Internet Port (as per your configuration guidance), sent a print job….and nothing. Hmmm.

Finally, I recalled seeing someone’s web post –thanks to your point of reference. I followed the poster’s instructions, and, yeah, it prints, and in color. Thanks again, Chu, for your post. It was easy to follow, and importantly, it worked with my setup (despite the color issue).

Patrick McKrell

The solution? Change your CUPS configuration to allow raw printing:

Basically, I saw that every job on the windows side had “error”.

After looking at the error logs for cups on the mac box (/var/log/cups/), I noticed this line repeatedly:

print_job: Unsupported format ‘application/octet-stream’!

Did some googling, and found a post with the answer:

>
> You probably need to uncomment the following lines in
> /etc/cups/mime.types and /etc/cups/mime.convs:
>
>
> /etc/cups/mime.types:
> #application/octet-stream
>
>
> /etc/cups/mime.convs:
> #application/octet-stream application/vnd.cups-raw 0
> -
>
>
> That will allow raw printing.

Then, kill -HUP the cups daemon, and you’re good to go.

34 Comments & TrackBacks ()

Paper doll icon
Neil T.'s Gravatar

That’s a cool method - I’d previously tried using the native drivers on Windows for my Mac-connected printer and having it not work.

The method I used was actually different - install Rendez-Vous for Windows on the Windows machine and then use its printer wizard, selecting a PostScript driver. It works, but you don’t get all the snazzy features of this method.

But then again, the PostScript driver supports printing 2 pages on one sheet (reducing the pages 50%) and the normal Windows driver does not, so it’s much of muchness really.

Posted by: Neil T. on February 7, 2007 5am

Paper doll icon
Nem W Schlecht's Gravatar

I’ve been getting by for some time now by attaching my HP Deskjet D2334 to one of my Windows boxes and just saving a PDF on my Mac Mini (or iBook or MacBook) and then copying that PDF over to the Win box to print.

Today I got sick of that, attached the printer to my Mac Mini and try as I could, I couldn’t get it to print from Windows. Until I came across this - and I get to keep my driver specific features - very nice.

I’m new printing like a fool from wherever to my printer. Thanks much!

– Nem

Posted by: Nem W Schlecht on February 19, 2007 2pm

Paper doll icon
Luke Tarver's Gravatar

That’s the most simple and effective method I’ve seen and I tried a few. The only caveat is the inability to rename the printer from within Windows, so you have the full IP address of the printer to look at all the time. Anyway, you’re a genius and I owe you lunch ;)

Thanks!

Posted by: Luke Tarver on February 21, 2007 8am

Paper doll icon
Ruprict's Gravatar

Mate, you ROCK. Thanks!

Posted by: Ruprict on February 24, 2007 4am

Paper doll icon
Matt Huddie's Gravatar

Thanks, this is really helpful. I am now able to print from a Windows laptop with a flakey USB port to my Samsung ML-1750 laser by plugging it into my Mac Mini.

When I first tried this I made the mistake of copying the entire output line for the device URI from the output of the lpinfo -v command, including the leading ‘direct’. This produced the error: ‘client-error-not-possible’.

In other words, in the example use

usb://HP/Deskjet%201280?serial=CN516851RPUN

and not

direct usb://HP/Deskjet%201280?serial=CN516851RPUN

Posted by: Matt Huddie on February 27, 2007 6pm

Paper doll icon
Chu Yeow's Gravatar

@Matt (Huddle): Ahh thanks for pointing that out Matt, I did most of this mostly from memory so I was sure I’d have left something out or did something wrong ;). I’ve changed the original post.

Posted by: Chu Yeow on February 27, 2007 6pm

Paper doll icon
Max's Gravatar

I join to the comments of the previous posts.

Great useful hint!

Thanks!

Posted by: Max on February 28, 2007 3am

Paper doll icon
Steve's Gravatar

Many, many thanks for posting this solution. I’m not a Mac guy, so setting up my in-laws’ Mac Mini for printer sharing from my XP laptop would have easily taken me all day. I followed your steps verbatim, and… Voila!

Posted by: Steve on March 5, 2007 12am

Paper doll icon
Adam Butler's Gravatar

Hey there,

I used and loved this solution for a few days, but then it all stopped working. We’d hit print, it would go in a queue and then never make it to the printer.

Is there something I am doing wrong? It all worked a treat, then stopped. I know it’s hard to diagnose anything from that description but I am sure there’s a silly little thing that I missed … surely I am not the only guy this is happening to!

Any suggestions would be most appreciated!

Thanks

Adam

Posted by: Adam Butler on March 7, 2007 1pm

Paper doll icon
Adam Butler's Gravatar

And now it’s working again … sorry - not sure how to delete my post. I think the problem is with the USB connection on the iMac, not the AMAZING setup provided here! When I changed ports and unplugged a USB external hard drive I was back in action.

Posted by: Adam Butler on March 7, 2007 1pm

Paper doll icon
QT Luong's Gravatar

At first I was not able to go past the CUPS identification.
I had to edit /private/etc/cups/cupsd.conf
by changing the last
# AuthType Basic
# AuthClass System
to
AuthType None

Even after doing the whole set-up as described on this page, there was still a problem. When I try to print from Windows XP, at first everything looks OK, but nothing happens. Looking into the queue for the printer, the job is there, but the status is “Error”. This printer is working fine. For instance I am able to share that printer with another mac.

Posted by: QT Luong on March 11, 2007 7am

Paper doll icon
ELZ's Gravatar

Thanks a million. This saved me some research. Gotta Love The Power of the Internet. :)

Posted by: ELZ on March 15, 2007 12pm

Paper doll icon
jBerc's Gravatar

I have a Canon IP4000 USB printer but I can’t find my Device URI. lpinfo -v in Terminal shows my Acrobat Distiller (direct pdf700://distiller) but not my USB printer. CUPs shows Device URI: file:///dev/null. I’ve tried using usb://Canon/iP4000 but that doesn’t work.

Posted by: jBerc on March 20, 2007 3pm

Paper doll icon
Jack's Gravatar

Thanks, this was the only method I could get to work. Great find.

Posted by: Jack on March 21, 2007 12am

Paper doll icon
T-m's Gravatar

Thank you so much! Worked like a charm. Love you, man ;)

Posted by: T-m on April 30, 2007 4am

Paper doll icon
Tim Lance's Gravatar

I know a lot, way more than just enough to be dangerous, but this was giving me fits. I had found all sorts of hints but this is THE ONE! Plus I get the drivers. (Well, my wife and the Windows daughter, do. Me and the Mac daughter now get to gloat.)

Posted by: Tim Lance on May 6, 2007 4am

Paper doll icon
K's Gravatar

hey can some1 help me when i add the printer from windows it says cannot find the printer and im 110% sure ive one evreyhing rite…thanks

Posted by: K on May 7, 2007 9am

Paper doll icon
Virgil's Gravatar

I’m with the guy above - printer set up OK in CUPS (can do a test print to it from the MAC). But, try as I might the Windows machines just can’t find the URL when you enter it into the Add Printer Wizard. One strange things is that I cannot ping my Mac from any of the Windows machines - all the Windows machines can ping each other and they all (including the Mac) have DHCP addresses from the same Linksys router. At first I thought that the problem was that the first Windows machine was connected via WiFi (perhaps some problem with gatewaying between wired and wireless network on my router) but, when moved my windows Laptop to wired connection and it doesn’t help.

I’d appreciate some help if you’ve got time - I’m a real Mac newbie. I’m certain that I’ve got windows and printer sharing on but I can’t get my windows machines to connect (even to fileshares) - please help me!

Cheers,

Virgil.

Posted by: Virgil on May 13, 2007 4am

Paper doll icon
Bill Wilson's Gravatar

I setup the printer as a shared print from my windows terminal server. When I print from windows it sends the job to the mac, and the mac even says the job completed but nothing comes out the printer. Which is what brought me to this site.

for the person that gets the error “can’t find printer” he is an easy quick method of setting up a windows printer - just open my computer, or even internet explorer and type in \\ip.address.of.mac - of course use the actual IP address of the mac so something like this \\192.168.1.62 that will browse the mac, and you will see your shared printer in the list just double click on it, and windows will offer to install everything you need.

Posted by: Bill Wilson on May 17, 2007 4am

Paper doll icon
Stephanie Giovannini's Gravatar

I am unable to login to CUPS administrator site. Every user name and password is “incorrect” even though they’re all administrators. I tried changing the cupsd.conf file but it made no difference. Any ideas?

Posted by: Stephanie Giovannini on May 18, 2007 4am

Paper doll icon
Frank's Gravatar

Why on earth does these have to be so convaluted?? Shouldn’t apple have all this crap going on behind the scenes for the user? What’s more insulting is that Apple documentation makes it sound so easy and breezy to get this going, but it’s all wrong!

Anyway, that god/ala/buddha that there are people who can figure this stuff out AND those people have blogs for the rest of us to read.

Thanks!

Posted by: Frank on May 19, 2007 5am

Paper doll icon
Fiona Scott's Gravatar

I’m a technologically useless and your instructions are brilliant! thanks a million

Posted by: Fiona Scott on May 25, 2007 1am

Paper doll icon
tobi's Gravatar

thanks for this post - this really helps.

but i needed to use the \\server\printer port, using the cups http printer port did not work. the print jobs just got spooled but never printed.

however, i can now print from the windows box on my iP4000 on the mac mini. but only 1 job…after that the printer “locks up” and i need to restart it by pull the power plug.

someone got a hint whats going wrong?

Posted by: tobi on August 5, 2007 4am

Paper doll icon
Marcin Jagodzi?ski's Gravatar

I tried many, many solutions (Bonjour, native drivers, Gutenprint…) nothing worked (jobs were just passing thru the queque but not printing). Now it works, many thanks.

Posted by: Marcin Jagodzi?ski on September 1, 2007 10pm

Paper doll icon
Greg's Gravatar

I used the same process to set up a Mac as a printer server (and like you, found the Apple directions vague at best).

Since you have to reference the print server with an IP address, you must make sure your router does not dynamically assign an IP address to the Mac. If it does, the Mac IP depends on the order you computers are turned on.

Your router should allow you to assign a fixed address (and then set up your Mac to use a fixed address).

I had a problem when I assigned the Mac an IP address outside the routers dynamic IP assignment area (1 to 200), so I just assigned an address inside the dynamic area, but higher than the router would ever need (i.e. higher than the max number of computers I’d ever have networked).

Posted by: Greg on September 25, 2007 1am

Paper doll icon
Barry Resnik's Gravatar

I followed the instructions, was printing flawlessly for 4 days. Now, when i send the file from the win laptop, it spools, prints 1 sheet, starts the second, and hangs in the middle of the second sheet. It will show “sending data” forever on the imac dual core 1g. i delete the job, but have to unplug the printer to get it to reset. It is a Canon i860. Anyone having similar probs?

Posted by: Barry Resnik on September 27, 2007 11am

Paper doll icon
Siddhartha's Gravatar

I am having the EXACT SAME problem on my Canon MP500.

Posted by: Siddhartha on October 2, 2007 11pm

Paper doll icon
yush's Gravatar

You are the MAN! I spent literally days on trying to figure this out… and your post came to the rescue!

Posted by: yush on November 14, 2007 10pm

Paper doll icon
Jim's Gravatar

Thanks for the guidance - saved me at least a day of tinkering and frustration!

Posted by: Jim on December 6, 2007 12am

Paper doll icon
PW's Gravatar

Thanks! Perfect description! Have a Brother printer.

Posted by: PW on December 10, 2007 8pm

Paper doll icon
phuong's Gravatar

After hours of googling and gleaning through various websites, I stumbled upon yours with instructions that weren’t difficult to understand. The only problem I had was authenticating with CUPS. After googling and trying various methods, I ran into a website that said cups would not authenticate if the admin account didn’t have a password (go figure). Gave myself a password and within a few minutes I was printing from my Windows laptop. Thank you very much for this information.

Posted by: phuong on December 28, 2007 4am

Paper doll icon
John Arany's Gravatar

This is great info which works with Tiger or before probably.. However, for the life of me I can’t find the “add a new printer” button under the printers tab in Leopard.. Any ideas?

Posted by: John Arany on January 21, 2008 11pm

Paper doll icon
LesK's Gravatar

I have a number of windows xp machines and an iMac. I needed to network a Lexmark E230 laser printer and found that Bonjour worked quite well but didn’t have a printer driver in its list for this specific printer. I ended up printing a ‘cover’ page with every print job and didn’t have the printer specific controls.

To cure this I installed the windows driver for the Lexmark on the windows machine with the Bonjour printer and then used that driver in the Bonjour printer by just selecting the new driver I installed for the ‘Windows Lexmark’ printer. I did this simply by opening the preferences for the Bonjour printer (called Lexmark @ iMac) and selected the new driver. All functions worked fine after that.

When I went to windows machine2, I didn’t install the Windows printer software directly from the CD but added the Windows printer from machine1 by sharing it on machine1. This automatically added the driver to machine2. Then I added a new Bonjour printer on machine2 (by installing Bonjour and adding the Lexmark @ iMac). Then I changed the Lexmark @iMac printer driver on machine2 to the Windows driver for the Lexmark. This was dead easy and worked well. It also made installation on my other computers really easy too. Bonjour is available for download from the Apple website. You can also Google ‘bonjour printer’ to get the link.

Cheers.

Posted by: LesK on February 6, 2008 1pm

Paper doll icon
Sebastian's Gravatar

I accidently deleted the original printer in the cups list (lack of attention) and now when I try to start the instructions from scratch, lpinfo -v won’t even show a direct usb link !

What am I supposed to do now ? How can I have my usb link ?
Printing from Mac does work.

Posted by: Sebastian on March 2, 2008 5am

You can subscribe to the RSS feed for comments on this post.

Sorry, this entry is no longer accepting comments. If you have something you really want to say, you can write me.