Notes on Samba / CUPS printer configuration
I've finally gotten my Samba / CUPS interactions to work, after lots of fiddling and unsuccessful experimentation, so I thought it might be useful to note here a few critical points that I missed the first time around. Corrections are invited. There are two separate configuration challenges: Windows client/Linux server, and Linux client/Windows server. To keep things straight, the server machine is the one that has the printer and the client machine is the one that wants to print something. I'm working with Windows ME, but I assume that most of this works for other Wins also. Linux client is the easier case, assuming that the Windows printer is working correctly within Windows. On the Windows side, you have to bring it up in Control Panel and give it a share name (WINPRINT, say). Now supposedly that should make it available for Linux printing without further ado under the name WINPRINT@HOST, but I have not been able to get that to work. So what you need to do is to create an appropriate printer (let's call it WPR) on the Linux client such that printing to that printer will cause the print file to print on the Windows server. There are three ways to create the printer: using the CUPS configurator via the local webpage http:// localhost:631/admin, using Yast2 via Hardware / Printer, or adding the necessary entries to the file /etc/cups/printers.conf. Using Yast2, you choose to add a printer named WPR. The critical choice is the next one, where you select to print via an SMB network server; the following choices are straightforward. Using the CUPS configurator, you choose Add Printer, then set the name as WPR and the location as the hostname of the Windows machine (I'm not sure if that's really necessary, though). For the device, choose Windows Printer via Samba. For the Device URI, choose smb://workgroup/HOST/WINPRINTER (you can usually omit the workgroup, though). The rest is straightforward. For the case of a Linux server and a Windows client, the configuration is best done via the Samba configuration program SWAT, available as a webpage at http://localhost:901. (Bug: you may need to run /etc/init.d/xinit restart to get SWAT to work.) You should create a spooling directory at /var/spool/ samba with all permissions turned on and the sticky bit (t) set, though /tmp can also be used for the spooling directory. Now go to the PRINTERS section and create a printer with the same name as the Linux printer you want to print on. Using any other name won't work. (The name is the same one you'd use in an lpr command.) Set the path to /var/spool/samba. Note that this is the path of the spool directory, not of the printer itself; /dev/lp0 will *not* work here. Set "guest OK", "printable", "browseable", and "available" all to "yes" and "printing to "CUPS". Now you can create the printer. Next, go to the GLOBALS section of SWAT and under Printing Options, set the printcap name to CUPS and printing to cups. Confirm the changes and you're ready to print to your new printer. To do all this under Yast2 (not possible in pre-9.0 versions of Yast2), you go to the Samba Server section of Network Services, then Next, then Advanced, then Add. Then add the new printer, again with the same name as the Linux printer you want to print on. The path should be /var/spool/samba as with SWAT. Now for the Windows side. Bring up Network Neighborhood, then look at the available hosts. One of them should be your Linux machine. Click on that to see what's available. The name of your printer should appear. Right-click on that, then choose Install. The rest should be straightforward, and you'll have a new printer in the Printers section of Control Panel. Good luck!! Paul Abrahams
participants (1)
-
Paul W. Abrahams