This site is now 100% read-only, and retired.

Sharing a printer to Windows XP clients with Samba and Cups

Posted by Anonymous on Mon 31 Jul 2006 at 11:07

Setting a printer in Debian Sarge from scratch and make it available for Windows XP clients on a LAN can be difficult, but using CUPS and samba it should be fairly straightforward if you have a supported printer. Here we will demonstrate how to do this.

Printing for the first time in a machine with a fresh install of Debian Sarge is not as easy as one might think. I came across many documents and web pages in the Internet that explain in a general way what I was trying to do, but none of them alone solved my problems and sometimes I didn't find what I was looking for in any of them. So, I wrote this guide to remember the solution to my problem and to share it with other people. This guide details all the problems I went trough -and the solutions – to make my printer available in my home's LAN. The LAN is formed by five PCs: Three desktops and two laptops. The machine running Debian Sarge is my own computer and the others, including laptops, run Windows XP. The printer is an old Epson Stylus Color 777.

Part 1: The Nightmare

First we must make sure we can print from the Debian Sarge PC to the printer attached to it. We must install and configure CUPS -the Common Unix Printing System- and for that we need to install the next packages that -as weird as it sounds- are not installed by default in a fresh desktop install of Sarge:

  • cupsys
  • cupsys-client
  • cupsys-driver-gimprint
  • cupsys-driver-gimprint-data

Besides these packages, Synaptic selected the next packages or they were already installed:

  • libcupsimage2
  • libcupsys2-gnutls10

Finally, this package is necessary or Mozilla Thunderbird won't print at all:

  • cupsys-bsd

The packages can be installed usingSynaptic or using the apt-get command as usual for Debian.

Once CUPS is installed we can add the printer. This can be done from a web browser opening the address http://localhost:631/ or from the KDE Control Center. The first problem hits us when we try to add the printer using the Control Center and in the part where we are supposed to choose the printer port we don't find lp0, the parallel port, but unknown-parallel0 We choose that option anyway and of course it doesn't work, the printer doesn't print a single character.

After a lot of time searching in Google and discovering a lot of people with the same problem but different solutions, we try some of them and discover that what is missing is the lp module in the kernel. So, we edit the file /etc/modules and add in a new line.

After rebooting (ok, I know you don't need to reboot to load a module, humor me) the port lp0 appears in the KDE Control Center. We use it again to add the printer in lp0 and choose the right driver. In this case the driver:

Epson Stylus Color 777 -CUPS+Gimp-Print v4.2.7

In the bottom part of the Control Center we can see the option "Print System Currently Used" and we change it to "CUPS". The printer must NOT be configured as RAW and we can leave "USER ACCESS SETTINGS" blank. Finally as the printer name we type StylusColor777. That should be all and really excited we open any program, try to print and...nothing, zero, no error messages, no badly printed pages, nothing. The programs seem to print well but the printer doesn't move at all. This is really discouraging because there are no error messages and we have not a single clue of what is happening. We loose an entire day searching solutions in the Internet. There are several people with the same problem but not a working solution, nobody knows how to fix this.

Keep in mind that this is a fresh install of Sarge. Amazing! Finally, fooling around the directories and files we open the file /var/log/cups/error_log and discover the following lines appear each time we try to print:

E [22/Oct/2005:13:29:58 -0500] Unable to convert file 0 to printable format for job 6!
I [22/Oct/2005:13:29:58 -0500] Hint: Do you have ESP Ghostscript installed?

We do a Google search for ESP Ghostscript and discover it refers to the package gs-esp (the Ghostscript PostScript interpreter - ESP version) that OF COURSE is not installed. We proceed to install it using:

apt-get install gs-esp

What is this program supposed to do? Here is part of the package description which explains:

 Ghostscript is used for PostScript preview and printing.  Usually as
 a back-end to a program such as ghostview, it can display postscript
 documents in an X11 environment.

 Furthermore, it can render PostScript files as graphics to be printed
 on non-PostScript printers.  Supported printers include common
 dot-matrix, inkjet and laser models.

We try to print a page... works perfectly! Two days lost but it is worth it! To this point we see that all the errors seem to be the distribution's fault. gs-esp should have been installed along with CUPS and lp not installed by default seems to be a hardware detection problem. From now on, we can print locally from the Debian Sarge PC.

Note: The Gimp needs to be configured independently from CUPS to print or it will only print random characters. In this case you only have to start the program, go to the 'Print' menu and choose the right driver and type of paper.

Part 2: Make the printer available using SAMBA

This task was another nightmare. The goal was to make the printer available to the Windows XP clients using SAMBA in anonymous form, this means the Windows XP clients don't need to use a login or password. (This is because my parents and brothers are the users and they don't seem to be able to memorize a password.)

Making the printer available requires three thing: CUPS configuration, SAMBA reconfiguration, and the configuration of each client with Windows XP installing the right drivers.

CUPS Configuration

After a lot of searching on the Internet and trying several times to access the printer from the windows clients - the printer doesn't appear at all in the LAN we discover that we must modify the file /etc/cups/cupsd.conf and add the line:

Allow From 192.168.1.*

This IP address may change with a different router. This will tell CUPS to accept printing from any machine connected to the local network.

Next, we must configure CUPS to allow printing in a RAW format from the Windows clients. For that we must modify two files: The first one is the file /etc/cups/mime.convs where we must uncomment the following line :

application/octet-stream application/vnd.cups-raw  0 - 

The second change we must make is in the file /etc/cups/mime.types where we must uncomment the following line:

application/octet-stream

SAMBA Configuration

The next step is to configure SAMBA by modifying the file /etc/samba/smb.conf.

The file smb.conf in my computer is the next one:

[global]
workgroup = KAMEHOUSE
netbios name = HARPIA
security = share

#this section is only to share the printer
printcap name = cups
disable spoolss = Yes
show add printer wizard = No
printing = cups


[printers]
comment = Printer in Linux
path = /var/spool/samba
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

This example of smb.conf works perfectly and we will comment on it in a moment. The notable fact is that if we try to print from any Windows XP machine we won't get anything at all, only another error. We locate the problem when we check the file /var/log/samba/log.smbd:

'/var/spool/samba' does not exist or is not a directory,
  when connecting to [StylusColor777]

That's true. Even when SAMBA's official documentation and all examples that we find around show "path=/var/spool/samba" as the spool directory, this directory is not created in Sarge when SAMBA is installed!!! So we create it with:

# mkdir /var/spool/samba

Aditionally we must give to it the necessary rights so that the Windows clients can write to it:

# chmod 777 /var/spool/samba

This must be done because when a printer job arrives to a SAMBA server, the information is written temporarily in the directory specified by the option 'path' in the 'printers' section of smb.conf. SAMBA then executes a command to send this information to the printer.

Now some comments about the file smb.conf. The important sections for printers are [global] and [printers]

workgroup = KAMEHOUSE

The workgroup must be the same workgroup of the Windows XP machines.

netbios name = HARPIA

Here we set the netbios name of the Linux server in the Windows XP network

It is important that we specify cups with:

printcap name = cups

This is the way in which SAMBA tells Windows the name of the printer available in CUPS. If we don't use 'cups' we will see in the file /var/log/samba/log.smbd the error message:

Unable to get jobs for ipp://localhost/printers/lp  client-error-not-found

Windows Client Configuration

The steps to configure the machines with Windows XP are demonstrated in the following screenshots.

If everything has been configured properly and the printer works then it will appear automatically. The drivers to use are the Windows XP native drivers or the ones in the printer install CD. The process must be repeated en each of the Windows XP machines. At the end you should be able to print from any of these machines. Even from the wireless connected laptops.

You must choose the network printer not a locally attached one.

If everything has been properly configured in Debian Sarge the printer must be available when you choose 'Browse for a printer'.

Note that the printer appears with its CUPS name, in this case StylusColor777

You can choose to make it the default printer or not:

Here we must choose the driver for the model of the printer. If Windows XP doesn't have the driver we must use the printer installation CD. If there are no drivers available for the printer you can select the drivers for a postscript printer. For example Apple Laserwriter o the Postscript driver from Adobe (available on their web site), if it is a color printer you can choose Apple Color Laserwriter. The drivers may print with a little less resolution but they work. This is because everything is send as postscript to CUPS and CUPS understands postscript just fine. This has a big advantage,if you have an old printer that doesn't have drivers for Windows anymore, you can use it just fine in the network if it works in Linux.

This is the last step and the Windows machine will be able to print to the Linux server.

This is pretty useful, isn't it? It took me a couple of days but I learned a lot about CUPS and SAMBA, specially looking at the log files. Next time I'll bring another piece to the puzzle, how to print to a printer connected to one of the Windows XP machines from the Debian Sarge PC.

by Cesar Chaparro

 

 


Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (213.217.xx.xx) on Mon 31 Jul 2006 at 16:04
You don't need to use samba.
XP can do printing direct to cups.
This what is called ipp internet printing protocol. just use
ipp://yourdebianhost:631/printers/Yourprintersnamehere
voila you can use it.
Aehm and you can also use a anonymous account for cups under XP.
You also dont need any postscript-adobe driver.
just give the /etc/cups/???/yourprinter.ppd to your client.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (200.121.xx.xx) on Mon 31 Jul 2006 at 18:55
There were several reasons to use SAMBA. It was already been used to share files. The network uses dynamic IP addresses so if I wanted to use ipp I would have probably needed to use the Debian machine as a DNS server too and I didn't want to start another service (efficiency, efficiency...). I'm not sure.

I didn't say that you needed to use postscript drivers. I said you should use the native printer drivers BUT if you didn't have them (old printer maybe) then you COULD use postcript drivers.

Glad to see there are several ways to solve the same problem :)

Cesar

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (201.242.xx.xx) on Wed 2 Aug 2006 at 01:43
This writeing is too bad for an article :(
But really what kinda lame things did you stuck? doesn't existing directories, missing kernel modules, this so basic, the half of the article is crap and in my opinion you should check the printer's compatibility before you buy that.

Yes this is right you don't need samba, end if you lamer don't write articles like this about samba cups setup. IPP is more simple, samba not a game for newbies like you...

Printer support compare to the windows is lacking, and maybe it's complicated but if you would read the specific howtos then it wouldn't be so hard but if someone crying because debian doesn't contain things by default i suggest that go back to fedora...

So we don't appriciate your help, even if it was your intention, it's another meaningless article and another kilobytes wasting on the web, Good Job!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (211.22.xx.xx) on Sat 5 Aug 2006 at 06:33
Friend,

I consider myself a fairly experienced Debian user; I have been using it from the very day Potato was released. And yet, a year ago it took me 2 days of googling around and reading many contradictory howtos to get network printing in a mixed environment working.

It seems like ESR, who - I hope - wont be labelled a 'lamer' by you, had a similar experience:

http://catb.org/~esr/writings/cups-horror.html

Go read his article and think about it. The truth is that CUPS is an experience in frustration, and on top of that its Debian packages leave a lot to be desired.

On a more positive side, last time I've tried configuring printing from Ubuntu, it just worked, so maybe this whole mess *can* be rectified afterall :)

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (62.252.xx.xx) on Tue 5 Sep 2006 at 21:00
I appreciated the help thank you very much. If you're going to be so offensive in your response I think we all would appreciate you go and post elsewhere, you cretin!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (81.159.xx.xx) on Sun 10 Dec 2006 at 14:55
If your so smart, why can't you learn how to spell??!!!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (69.139.xx.xx) on Wed 10 Oct 2007 at 05:30
your = belonging to you
you're = you are

It's bad form to make a glaring grammatical error while making fun of someone's spelling.

For the record.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (75.38.xx.xx) on Thu 1 Nov 2007 at 18:36
atleast h(is/er) post doesn't take effort to read.

love,
Isaac

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (80.176.xx.xx) on Fri 2 Jul 2010 at 18:19
Well, why don't you, before lecturing others?

Although I agree that he's quite offensive, you're just being funny :)

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by purves (198.166.xx.xx) on Thu 26 Oct 2006 at 20:00
I agree with the above poster that the most straight-forward way of sharing a CUPS printer with Windows XP is to print directly to CUPS, but some of the information is inaccurate, as far as I can tell.

Set up a network printer with http://yourdebianhost:631/printers/Yourprintersnamehere (not ipp://, at least that didn't work for me)

I think if your printer includes a postscript driver you can use that, but if not then you will need to user either the adobe postscript driver http://www.adobe.com/support/downloads/product.jsp?product=44& ;platform=Windows or the CUPS postscript printer driver (I couldn't actually find a Windows binary, but the CUPS documentation claims there is one). The postscript driver will ask for your ppd file, which you can get from /etc/cups/???/yourprinter.ppd

If you run winbind on your CUPS server then you can use the hostname for the network printer address, if not you can use the IP address directly.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by purves (198.166.xx.xx) on Thu 26 Oct 2006 at 20:11
The CUPS windows postscript driver can be downloaded from http://www.cups.org/windows/index.php

[ Parent ]

A bit off topic but...
Posted by rob (72.192.xx.xx) on Mon 31 Jul 2006 at 21:20
[ View Weblogs ]
Still a sad state of affairs in GNU/Linux printing in my opinion and no single, agreed upon solution.

I used to get printing up and running on my Debian systems with the apsfilter package. It was/is simple to configure and required extra packages only in a few special cases. I needed to add hpijs for two of my printers and, for example, html2ps would have to be added if you wanted to print web pages. Programs were happy with apsfilter as the configured filter was written to /etc/printcap and sharing printers through Samba was no problem.

A few years ago, I decided to switch to CUPS as it seemed to be the way everyone was going (except for the Debian Project, still ;) ). I installed the six or seven packages I needed and then proceeded to read documentation and try various configurations for the next several days to get shared printers usable. I guess it was just me and ESR that found the information on linuxprinting.org/cups.org very confusing back then: go here, go there but first check this link or you may have to use these other links before you download this and that and go here and there and configure those and them. In the end, the best help I found was on random linux-help pages. It was around this time too that I realized that half the CUPS/Foomatic programs I downloaded I didn't need.

To think that all I needed to type to get my laptop to used a samba shared printer through my desktop was:
smb://user_name:password@work_group/host_name/printer_name
What could be more intuitive than that? And, back then, you had to intuit it because it was nowhere to be found in the documentation.

A pre-installed printing solution agreed upon by most in the GNU/Linux community would be a good thing.

[ Parent ]

Re: A bit off topic but...
Posted by Anonymous (200.121.xx.xx) on Mon 31 Jul 2006 at 22:03
Rob:
Same thing here. I started reading the official CUPS and SAMBA documentation and ended visiting a gazillion different web pages in english, spanish and french. I also realized that I didn't need some of the packages I had installed. I hate to admit it, but once CUPS and SAMBA are installed things from the Windows side are a no brainer.

Cesar

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (145.253.xx.xx) on Tue 1 Aug 2006 at 22:53
Sorry, nice article but installing the right driver by hand/foot on Windows is definitely not the best way to do this in an enterprise environment.

With the solution you choose the windows client is the RIP and therefore requires the right driver on the (Windows) client (Spooling RAW Files to CUPS). IMHO the better way (for lots of clients) would be to make CUPS the RIP and acting as a generic postscript-printer towards Windows (by using PPDs and CUPS Filter Queues). And i qoute:

"This feature enables CUPS to do a few tricks no other spooler can do:

* act as a networked PostScript RIP (Raster Image Processor), handling printfiles from all client platforms
in a uniform way;
* act as a central accounting and billing server, as all files are passed through the pstops Filter and are
therefor logged in the CUPS page_log. - NOTE: this can not happen with "raw" print jobs, which always
remain unfiltered per definition;
* <b>enable clients to consolidate on a single PostScript driver, even for many different target printers.</b>"

To cut it short please see/read Point 1. 3. and 5. of:
http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/ IX.CUPS-Samba/IX.Samba-HOWTO-Collection-Chapter-7.html

The whole document can be found under:
http://www.linuxprinting.org//kpfeifle/LinuxKongress2002/Tutorial

No offense - but I spent months myself getting this right for 200+ clients.





[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (142.20.xx.xx) on Wed 25 Oct 2006 at 21:37
Cesar,

Thanks. Far too many web pages that claim to "explain" something skip over the mistakes that were made, and as a result, the reader learns much less than they could have! By exposing your mistakes (or perhaps the questionable choices made by your distribution and the ports you installed) you allowed us all to learn much more.

Life is different from the man pages. :)

eastpole

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (84.48.xx.xx) on Sat 4 Nov 2006 at 07:49
Hi,

Thanks for writing this article. I used a lot of time figuring out how to get XP to print on my Debian. However, I have a problem I need some help on: The docs I print out is never removed from the printing queue (viewing from the local XP).

I AM able select the doc that was printed out and delete it manually in the queue, but that really should be unneccessary.. :)

Any hints?


thomahawk

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (71.88.xx.xx) on Thu 25 Jan 2007 at 19:50
This site is a great resource for the Debian community! Although installing a ppa printer was difficult (nightmares as indicated), I could not have done it without the info in this article. Works Perfectly. Thanks.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by wolfvorkian (216.67.xx.xx) on Tue 23 Oct 2007 at 21:19
Thanks Cesar.... clearest article I've found on how to share my printer with my windows machines. Practically all the web links I've read previously on this networking problem might as well have been in Egyptian hieroglyphics for all the good I could get out of them.

The fact that you write with a little personality is helpful too.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (202.162.xx.xx) on Mon 29 Oct 2007 at 22:40
Thank you for writing this article. I have read and try it on my Debian GNU/Linux 4.0 (Sarge) and I could print a Windows XP Printer Test Page from another computer running Windows XP.

This article is very good and helpfull.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (202.162.xx.xx) on Mon 29 Oct 2007 at 22:41
Thank you for writing this article. I have read and try it on my Debian GNU/Linux 4.0 (Etch) and I could print a Windows XP Printer Test Page from another computer running Windows XP.

This article is very good and helpfull.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (212.109.xx.xx) on Fri 9 Nov 2007 at 14:18
Great article!
Short and simple, if only I have found it earlier would have saved days of "read read type type type read type oops doesn't work"

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (83.35.xx.xx) on Sun 30 Dec 2007 at 17:23
Thank you very much! With your article it took me 15 minutes to get a shared printer running.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (83.250.xx.xx) on Sat 15 Mar 2008 at 22:15
Hi,

Good article.

I have an HP CLJ 2700 connected to my Etch computer, that I wanted to share with Windows computers at home.

I was hoping that by now, it would work a little more out of the box than a few years ago. I first made a few tests with small changes in the original smb.conf that comes with SAMBA, without success.

I then just copied the smb.conf file from this article and changed it with my local names. Then I could immediately see the printer from Windows, but when I tried to install it with the Windows drivers from the printer's CD, the Windows wizard hanged while trying to connect to the printer.

Since I was trying to use an out of the box-configuration as much as possible, I didn't edit the file /etc/cups/mime.convs, which might explain the problem I was having (the CUPS-printer I was trying to set up on Windows was installed with an HPLIP-driver in CUPS).

Finally, my working solution is the following:
- Two printers created under CUPS for the same physical printer connected to USB: one with the HPLIP driver for local printing, one with RAW-configuration for printing from Windows.
- The smb.conf from the article (I used "kill -HUP `pidof smbd`" to reload smb.conf for testing changes)
- Installation in Windows (XP and 2000) as explained in the article, with the Windows drivers from the HP-CD.

Nothing more, the rest is all standard aptitude-installation (I had installed CUPS earlier, and installed SAMBA for the occasion from the "samba"-virtual package).

Works perfectly on both Linux and Windows.

Cheers,

Alain

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (70.191.xx.xx) on Thu 8 May 2008 at 01:36
Fantastic article, I use CentOS 5 and this still worked great, no spooling issues either. I was able to add this to my Domain controller and now over 1000 employees can see it and simply drag and drop it or simply double click it from the Domain controller's list of printers and bada bing bada boom! Once the drivers were loaded on the Domain controller, no other client had to search for the drivers. I'm sure this could be set up with the next version of Samba (currently 3.x as of this writing). I heard it will be able to completely replace a Windows Domain controller.

All in all this article helped me take a printer that had no NIC (only parralel) and turn it into a network printer that users can add to their windows XP machines at the double click of a mouse! No additional Windows license neccesary! Just a Dell GX1 to act as a print server that would have other wise been garbage!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (189.217.xx.xx) on Sat 28 Jun 2008 at 06:02
THANK YOU SO MUCH!!! really I had a lot of problems trying to share my printer
your tutorial is very clear and so easy that a newbe like me can follow it.
really thanks
Bolth

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (89.233.xx.xx) on Mon 30 Jun 2008 at 20:39
Thank You so much for a great article.

My first Linux experience dates all the way back to 1994 but I have not used Linux for a very long time so I recognize almost nothing except bash, hehe.

Your information was really valuable, thank you for taking time and sharing your experience.

Regards
Henrik

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (75.149.xx.xx) on Thu 24 Jul 2008 at 19:20
I use Linux pretty much everyday for 90% of my work (we run a webdesign and programming company and we do a lot of server work for clients). Been using Linux for a good 6+ years by this point, but never gotten around to setting up a CUPS server. Great tutorial, you covered pretty much everything that needed to be covered to get it up and going so much appreciate there. If you don't like the tutorial, then write a better one, people who bitch over advice they sought out for free, that wasn't 100% dead-on are a bunch of a idiots.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (124.109.xx.xx) on Thu 21 Aug 2008 at 10:48
I agree with the comments of the poster, its a very good guide, i have even shared my HP 1020 printer with this guide on fedora 8 successfully. It works great and fast.

If its not helpful to any other person, or if he thinks this guide is not good please write one of your own which is understandable to everyone who wants to use linux in home or small office setups.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (81.208.xx.xx) on Thu 20 Nov 2008 at 13:51
I thought your article was excellent. In quarter of an hour I was able to finally print a page from my XP laptop to the printer attached to my Fedora 9 box. I would not listen too much to the people who knocked your article. I really appreciate you sharing your experience.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (72.198.xx.xx) on Sat 29 Nov 2008 at 23:19
This article was exactly what I needed. I'm configuring a fat slug (nslu2) to act as a print server (among other things) and you spelled out everything I needed without forcing me to spend days drilling into volumes of generic documentation. Thanks, man!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (81.56.xx.xx) on Thu 7 May 2009 at 17:13
Excellent article, thank you.

I spent 3 days trying to set up a networked printer on a Centos 5 system and was near to giving up when I found this page.

Worked a treat!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by gheorghiua (76.170.xx.xx) on Fri 24 Jul 2009 at 02:39
Hi, I thank you so much for the beautifully written document about setting up printers. After I implemented the changes you mentioned, I endlessly tried to start up smbd to no avail. Then, my eyes fell on the part where you give the steps to configure the printer locally from the KDE Control Center or from http://localhost:631; btw mine was already set-up from the gnome panel and was working fine if I printed to it from the debian installation of my laptop which is dual boot with XP. I configured the http and called it with the IP address:631/printers/printer name on the Add printer wizzard on the XP and was able to perform successfully the rest of the steps. Maybe this tip can help other people that have hard-time with Samba, as I did.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (99.241.xx.xx) on Wed 23 May 2012 at 20:05
Thanks for the tip, and thanks (again!) to Cesar for the article! I used the article when I set up a printer under Ubuntu 10.10 and I sure needed that tip now that I'm using Ubuntu 12.04.

I've been sweating through getting Ubuntu 12.04 set up on the system I use as my desktop and our file/print server here (upgrade/upgrade/upgrade, back to back, from Ubuntu 10.10, which was the last point where everything worked) and Samba's printer service had me totally stopped.

That last tip did the job: Just use http: //hostname:631/printers/printername, and accessing that URL from Firefox on the the server gave me the additional clue I needed, which was the *exact* name of the printer ("DESKJET-960C", all caps, hyphen not dash, no "hp" prefix, and so forth...) So I finally got printing working again on my Windows XP box, this time without Samba. Yay!

I would still like to know why I couldn't get Samba's print service working. The ability to browse for a printer is nice, and it sure *ought* to work, but every attempt at accessing the printer that way from the XP system left me at a blank wall, with Windows asking for a driver, and then bombing out, claiming that either the name was misspelled (but I browsed to it??) or the printer had been disconnected from the server (which it hadn't). However, setting up Linux systems is something I do in order to do other stuff, it's not like it's my hobby or something (at least in principle), so I will stop at this point and rejoice in the 3 years of stability I'm looking forward to after an LTS install of Ubuntu.

-- Steve Lawrence

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (203.122.xx.xx) on Sat 24 Jul 2010 at 07:21
Thank you, this was VERY useful!

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (129.33.xx.xx) on Mon 18 Apr 2011 at 16:30
This is a nice article and I am surprized how bad comments were posted in the beginning by one idiot. A bad fish makes whole pond dirty. This is the trouble when annonymous comments are allowed to post as people can say anything as they know that their identities are not known. This is cowardiceness and not a good character on the part of the person writing nasty comments. Be a good citizen and if you have so much negative thinking in your mind, your place is not in a civilized society.

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by Anonymous (87.217.xx.xx) on Wed 11 May 2011 at 13:21
"missing is the lp module in the kernel."
"So, we edit the file /etc/modules and add in a new line."

I am newbie.
How doe this new line look like?

[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by robinh3123 (210.242.xx.xx) on Mon 27 Apr 2015 at 04:25
The CUPS printing share to windows is really tricky.

Luckily, my Linux distributions (I use Ubuntu, and Knoopix), has configured CUPS correctly. I don't need other packages.

Sadly, after some information digging, and some experiments, I have to give up configuring CUPS + Samba. CUPS + IPP doesn't work well too.
The reasons:
* Samba: The printer driver comes with an executable installer, not a regular driver disk.
=> I can't install printer driver when choosing network printer. Thus samba does not work well.

* CUPS+IPP: add printer -> type in URL =>ã&Atil de;ƒÂ¢Ã¢â‚¬Å&iex cl;‰Ã& cent;€šÂ¬as ked to choose printer driver: At this stage, I choose a *any* WinXP build-in Postscript
printer (suggested by some web page I dig): Just to get this error message: "Printer Driver not installed. The process
cannot access the file, because it is being used by another process."
Yet in this thread, purves (198.166.xx.xx) mentioned that adobe has free generic postscript printer driver on the web. Maybe I can try that.

At the end, I use the following working approach:
I use CUPS + P910ND

P910ND => printing from port 910x daemon. (Just search p910nd on sourceforge)
The 9100 network printing port, in the windows language, is a local printer, attached at a "Standard TCP/IP port".

Server side setup:
1. download p910nd from sourceforge.
2. "make" to make it on your linux machine.
3. "make install" to install on your linux machine. It will show what files are installed.
4. Depending on your distribution, and the version of p910nd, you may need some tweaks:
* old version of p910nd installed configuration at /etc/default, while new version installed at /etc/sysconfig
You may want to put it the same place as your Linux distribution.
* However, if you change the place of the configuration file, you need to modify the script /etc/init.d/p910nd too.
For example, if you move from /etc/sysconfig to /etc/default, you need to search all "sysconfig" in /etc/init.d/p910nd,
and replace it with "default".
5. p910nd comes with a man page, you may want to man it.
6. p910nd program is installed, by default, in /usr/sbin. The name of the executalbe is p910nd (i.e. /usr/sbin/p910nd).
7. The executable accepts parameters. You normally need to modify /etc/sysconfig/p910nd (the configuration file, see step 4).
In my case, I add "-f /dev/usb/lp0", since my raw printing device is usb/lp0.
8. The new version comes with a script /etc/init.d/p910nd requiring "start_proc" to start a daemon. "start_proc" package may need to be installed.
In my case, I am too lazy to install it. Thus I use my old version of script, (with new version of p910nd.). That version does not require "start_proc".
*Note: I have been using p910nd on my printing server for a long time. I have the old backup, i.e. the old script. Recently, my server is broken, and thus I have to install it on some other machine.
* The default port is 9100. (910n means 910x, you can setup more printers in 9101, 9102, etc..)
In case you are lazy to install start_proc, and you don't have the old script (perhaps you can download old version of p910nd, I am not sure), you may need to refer to how other scripts in /etc/init.d starts daemon, and tweak the script the same way similar to those.

Client side setup:
1. For many cases, you just have to "Add printer"->"add local printer" -> "standard tcp/ip port". and select your printer driver. => Done.
2. In may case, I need to get every windows computer connected first (via USB) directly to my printer. Then I installed my printer driver (since it comes with
executable files). Then, I can disconnect the USB, and click to open the property of the printer, and select change port. I then change port from "USB port"
to "Standard tcp/ip port" (which means port 9100) with my server's IP address. This completes the configuration.
*Note: Since I mentioned that in may case, it's a server replacement, this time, in fact, I don't have to setup my windows machine. It's already setup to print
to port 9100 of my server.



[ Parent ]

Re: Sharing a printer to Windows XP clients with Samba and Cups
Posted by robinh3123 (210.242.xx.xx) on Mon 27 Apr 2015 at 04:31
Sorry I didn't notice those scrambled characters in the preview (due to some special treatment of some character combinations of the editor of this webpage).

It should read as:

* CUPS+IPP: add printer -> type in URL -> asked to choose printer driver: At this stage, I choose a *any* WinXP build-in Postscript
printer (suggested by some web page I dig): Just to get this error message: "Printer Driver not installed. The process
cannot access the file, because it is being used by another process."

[ Parent ]