Sharing a USB printer from Mac OS X to Windows

In: Mac| Operating Systems

5 Feb 2007

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.

61 Responses to Sharing a USB printer from Mac OS X to Windows

Avatar

Neil T.

February 7th, 2007 at 5am

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.

Avatar

Nem W Schlecht

February 19th, 2007 at 2pm

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

Avatar

Luke Tarver

February 21st, 2007 at 8am

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!

Avatar

Ruprict

February 24th, 2007 at 4am

Mate, you ROCK. Thanks!

Avatar

Matt Huddie

February 27th, 2007 at 6pm

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

Avatar

Chu Yeow

February 27th, 2007 at 6pm

@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.

Avatar

Max

February 28th, 2007 at 3am

I join to the comments of the previous posts.

Great useful hint!

Thanks!

Avatar

Steve

March 5th, 2007 at 12am

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!

Avatar

Adam Butler

March 7th, 2007 at 1pm

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

Avatar

Adam Butler

March 7th, 2007 at 1pm

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.

Avatar

QT Luong

March 11th, 2007 at 7am

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.

Avatar

ELZ

March 15th, 2007 at 12pm

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

Avatar

jBerc

March 20th, 2007 at 3pm

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.

Avatar

Jack

March 21st, 2007 at 12am

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

Avatar

T-m

April 30th, 2007 at 4am

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

Avatar

Tim Lance

May 6th, 2007 at 4am

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.)

Avatar

K

May 7th, 2007 at 9am

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

Avatar

Virgil

May 13th, 2007 at 4am

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.

Avatar

Bill Wilson

May 17th, 2007 at 4am

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.

Avatar

Stephanie Giovannini

May 18th, 2007 at 4am

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?

Avatar

Frank

May 19th, 2007 at 5am

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!

Avatar

Fiona Scott

May 25th, 2007 at 1am

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

Avatar

tobi

August 5th, 2007 at 4am

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?

Avatar

Marcin Jagodzi?ski

September 1st, 2007 at 10pm

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.

Avatar

Greg

September 25th, 2007 at 1am

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).

Avatar

Barry Resnik

September 27th, 2007 at 11am

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?

Avatar

Siddhartha

October 2nd, 2007 at 11pm

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

Avatar

yush

November 14th, 2007 at 10pm

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

Avatar

Jim

December 6th, 2007 at 12am

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

Avatar

PW

December 10th, 2007 at 8pm

Thanks! Perfect description! Have a Brother printer.

Avatar

phuong

December 28th, 2007 at 4am

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.

Avatar

John Arany

January 21st, 2008 at 11pm

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?

Avatar

LesK

February 6th, 2008 at 1pm

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.

Avatar

Sebastian

March 2nd, 2008 at 5am

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.

Avatar

Me

August 31st, 2008 at 10am

Amazing. Thank you.

I have just installed Windows on a partition on a new Mac, and trying to figure out how to network it (safely, if at all) is really a PIA. Your directions worked perfectly…..

Avatar

Paul Pollock

September 1st, 2008 at 4am

I just got finished enabling the Windows XP machine to print using the HP printer hooked up to my OS X Mac. Works great.

I gotta wonder though as to why it was that the many other schemes for doing the same thing failed so miserably?

Thanks muchly!

Avatar

Rupert Pfaff

September 15th, 2008 at 8pm

Fantastic – exactly what I was looking for and worked first time with my Epson Stylus Photo 1290S.

Cheers!

Avatar

Derick Schaefer

September 26th, 2008 at 10am

Everything about my Mac is so stable (it’s brand new) but twice in the past several months I have gotten updates from HP that have completely wrecked my printer and I have had to un-install and re-install my drivers to get it to work. The last go around messed up printing in my browser. For example, I was printing out some work on a PHP site I was working on and now the fonts are all messed up. The site can be found at click here.

Anyway, I have another printer I am using but I guess I wonder how HP can ship two driver updates in a row that wreck everything! Ugggg.

Avatar

Rafael

October 5th, 2008 at 6am

Help please.. after specifying my IP address and printer name off step 8 instead of going to the drivers part (step 9) it ask me for “user and password”.
Which ones should i type in??

Avatar

Compartir impresora USB desde Mac « Debido a mi prerrogativa…

October 9th, 2008 at 1am

[...] Sacado de Redemption in a blog [...]

Avatar

paul gotel

October 13th, 2008 at 8pm

Thank you , I had it working with vista setup then failed , so had it working with Bonjour then failed finally got it up and running like this very cool indeed master Yoda!
All working fine after 3 hours of web searching thank you so much you make the whole Computer thing a place to always be provided with answers !
Aloha Paul

Avatar

Deborah

October 23rd, 2008 at 12pm

I got all the way to the last step. I’ve entered my Mac’s IP address, along with the correct following string. I keep getting an error that says “Windows cannot connect…either the printer name was typed incorrectly or the connection has been lost..” I’ve double checked and triple checked everything! I’m running Vista though, any help there at all???

Avatar

Jeff C

November 9th, 2008 at 4am

I cannot get past Step 1. I have OSX but there is no option called Windows Sharing that can be turned on. Where did you see that?

Avatar

doug

November 10th, 2008 at 5am

It took me about an hour to get this going, thanks to some overly helpful software. I won’t swear this is the easiest way to go, but in case you get stuck like I did:

. my hp printer was recognizable to the mac. so, it never gave me the “usb” option, instead it said something like “HP990 USB (HP Deskjet 990C)”. there were no other usb options
. when I went with that, it gave me no “raw” option, only a choice of various hp drivers
. no amount of meddling in the CUPS interface or even in the cups conf/ppd directories gave a clue (I could perceive) how to set up a raw printer. docs weren’t a help (searching for “raw” got some tangents, but no help)

Finally:

. choosing, “modify printer”
. leaving HP USB… as the device
. then, in the “manufacturer” it starts with the default of HP but you can choose “Raw”
. then, it gives you the “Raw queue (en)”
. and you are done

Other things I learned in my wasted hour:

. if the printer is not plugged in, it gives you no HP USB… choice when you are adding the printer
. you can choose the “internet printing protocol (http)” and enter the usb://… URI, then choose Raw as an alternate path
. when your printer runs out of paper, it can look a *lot* like it is malfunctioning, causing you to waste *even more* time

Avatar

doug

November 10th, 2008 at 5am

jeffc: the security settings have changed in the OS.

in the System Preferences, make sure your firewall will allow printer connections through (allow all incoming connections is easiest and least secure, etc. google/help can give insight to the more secure options)

then, in Sharing, allow Printer Sharing.

it’s *possible* that turning on printer sharing will fix the firewall, also. I don’t remember for sure.

Avatar

Trent

November 21st, 2008 at 8am

Thanks heaps, worked like a charm!!!!

Avatar

sojourner

November 28th, 2008 at 4am

I am close but no cigar yet.

I sent about 5 documents from Vista to the USB printer on the Mac. On the Windows side they are all marked as Error. I looked at the two /etc. files. the specified lines are already commented out.

Avatar

sojourner

November 28th, 2008 at 4am

On the Mac, in /private/var/log/cups/access_log, I see a number of lines like these:

192.168.1.101 – - [27/Nov/2008:15:42:17 -0500] “POST /printers/deskjet HTTP/1.1″ 200 132

The time above is when I was printing.

Avatar

More Questions - Mac-Forums.com

November 28th, 2008 at 4am

[...] some progress but no cigar yet, as I wrote in the following thread: Sharing a USB printer from Mac OS X to Windows | redemption in a blog Would appreciate [...]

Avatar

sojourner

November 28th, 2008 at 5am

Made some more progress.

I am getting this error:

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

The files mime.type and mime.convs in /private/etc/cups are read only. How do I uncomment the two lines specified? Also, how do I kill the daemon?

I have not used unix in several years.
Thanks.

Avatar

sojourner

November 28th, 2008 at 7am

-rw-r–r– 1 root wheel 2810 Jul 21 2002 mime.convs
-rw-r–r– 1 root wheel 5671 Jul 21 2002 mime.types

I don’t know the root password on this machine.

Avatar

sojourner

November 28th, 2008 at 8am

It worked, it worked. I am so happy.

I used sudo -s to change to root. Uncommented a line each in mime.types and mime.convs. Rebooted the Mac. Worked like a charm.

Thanks for the great post Chu Yeow.

I have problems booting up my Mac sometimes. Is this a place to ask for help on this?

Avatar

Printing to a Network Printer - Microsoft Windows Vista Community Forums - Vistaheads

November 28th, 2008 at 10pm

[...] Re: Printing to a Network Printer I was able to resolve this problem using the advice provided here: Sharing a USB printer from Mac OS X to Windows | redemption in a blog [...]

Avatar

John

December 27th, 2008 at 8am

I have the same problem Patrick had. However, I know very little unix, only enough to do something stupid. I can get into root and find the log files, but that is it. Is there another way to make this printing work? Or could someone post more complete commands in unix to do this?

Thanks for your help
John

Avatar

Matthew

January 8th, 2009 at 3pm

this was just what the doctor ordered, except now i have 2 printers listed in the print & fax system preference pane. no biggy though because it works!!!!! THANKS!!

Avatar

Bob Nielsen

January 26th, 2009 at 11am

I followed the directions (the mime octet stream lines were already uncommented), but got the following error:

Unable to install printer. Operation could not be completed (error 0×000006be).

Avatar

Bob Nielsen

January 29th, 2009 at 1am

I couldn’t get around that error, but decided Bonjour, which I had seen mentioned elsewhere. I installed it and ran the printer setup. Bonjour recognized the printer connected to my Mac and selected a postscript driver. Printing was up and running in less than a minute.

Avatar

Bob Nielsen

January 29th, 2009 at 1am

That should have read “I decided to try Bonjour”.

Avatar

Tim Brazer

April 28th, 2009 at 7am

This helped me out a lot here.

For some reason Windows 7 build 7057 x64 doesn’t see Printers being shared by a Mac.

Thanks!

Avatar

Daniel

April 30th, 2009 at 1am

Thanks for sorting this out. I couldn’t get the built-in printer sharing to work between Leopard and Vista. This worked like a charm.

Avatar

Anna

June 16th, 2009 at 6pm

Great post. Absolute newbie on Mac and never shared a printer before – was able to do this at first attempt. Do correct step 2 though, I could’t see an option called Windows Sharing either – went on regardless and it worked.

Comment Form