Printing from a Windows box via samba to CUPS
This little fix had me stumped for several hours. From a windows box, printing to a samba server using CUPS gives no joy. Windows has it's own drivers, so it will send raw printer instructions to CUPS, expecting these to be passed directly to the printer. CUPS usually expects to be able to do the data conversion itself using it's drivers, using a set of mime-types to recognise incoming jobs, and translating them to the proper printer language on the way, be it postscript, bubblespeak or whatever your particular paper-chomping animal speaks. CUPS seems to ship (on RedHat / Fedora at least) without support for application/octet-stream support. Is it just me, or is octet really hard to type?
Anyway, enabling binary data is really simple, once you know how. Edit your CUPS mime.types file (/etc/cups/mime.types on my system) and uncomment or add the following:
application/octet-stream
Hardly brain surgery there. Now using your favourite editor again, crack open /etc/cups/mime.convs and feed it the line:
application/octet-stream application/vnd.cups-raw 0 -
This tells it to simply pass the data through. Restart cups (service cupsd restart or similar) and try printing again - hopefully you'll either get a page, or some other weird error message - but at least you got an error this time, rather than a silent failure. You're on your own now, 'cause this much worked for me.
Comments
harlequinSmurf
Sun, 04/25/2004 - 18:00
Permalink
thanks for the heads up
Having just about completed the installation of our new server this little piece of information was a definate help. I've never set up a printer share using samba before so I probably would have spent hours (if not days) trolling through the web trying to find out why it wasnt working.
just a note: on RHEL3 those lines are both in the respective files, just commented out each time.
agittins
Thu, 04/29/2004 - 16:19
Permalink
Re: Thanks for the heads up
Cool, glad it was useful. Heh... did you see I made a note about the mail routing too? here. You might like to confirm if that's indeed how you set up your end, wasn't sure if you used iptables redirect or if you did it another way.
ryanrlamothe
Fri, 07/02/2004 - 16:31
Permalink
YES!!!!!
WOW, I have spent HOURS trying to figure out why in the FU@K a new Redhat Fedora Core 2 SAMBA Printer Share wouldn't work with my Windows XP clients. FU@K MAN, IT's 1:23AM AND YOU HAVE MADE MY DAY/WEEK/MONTH/YEAR!!!! I wish I could give you a big hug right now (well, maybe you wouldn't want to since I have spent 16 hours straight in a hot server room...ha ha). Yes, I haven't laughed since I started working on this damned problem. THANK YOU!!!!!!!!!!!!!
PS-Can you please report this to both CUPS and Redhat (ESPECIALLY REDHAT) or the Fedora Team???? Please!!!!! The printing through SAMBA works with Mandrake 10, but I am not currently using that as a corporate server. Again, Thank You, you seriously made my day.
PPS-If you do report this to Redhat/Fedora, please email me the Bugzilla link so that I can join in and follow along in the bug development process of this.
agittins
Fri, 08/20/2004 - 01:20
Permalink
re: YES!!!!!
Very glad you found it useful ryanrlamothe - certainly is a pain in the butt until you work out the issue!
I had a look in redhat's bugzilla, and it seems that this behaviour is by design - I think I can understand that, since allowing binary queues might potentially incur a security risk, but at any rate it seems they won't change it. Have a look at Bug 97091 for the word.
Cheers,
Ash.
agittins
Fri, 08/20/2004 - 01:20
Permalink
re: YES!!!!!
Very glad you found it useful ryanrlamothe - certainly is a pain in the butt until you work out the issue!
I had a look in redhat's bugzilla, and it seems that this behaviour is by design - I think I can understand that, since allowing binary queues might potentially incur a security risk, but at any rate it seems they won't change it. Have a look at Bug 97091 for the word.
Cheers,
Ash.
Anonymous (not verified)
Fri, 07/01/2005 - 10:32
Permalink
well you posted this about a year ago
But it came in handy to me today! Thanks, I had no clue! No error no nothing just complete silence. You rock man.
-Elizabeth
Add new comment