Debugging Samba/CUPS printer sharing with Windows

4

I've got a HP Deskjet hooked up to a Slackware 12.2 box. I've got CUPS set up and can print a test page from the box just fine. I've also got Samba set up and have a couple file shares that work fine.

I'm trying to share that HP Deskjet out via Samba, but I can't get it to show up in any Windows system. I see the server and its file shares in Windows networking, but when I open the Printers, no printer shows up. Running net view \\servername from the command line lists the file shares, but no printers.

Here's the pertinent part of my smb.conf, if that helps:

[global]
workgroup = HOMENET
security = share
hosts allow = 192.168.1. 192.168.2. 127.
load printers = yes
printcap name = cups
printing = cups
log file = /var/log/samba.%m
max log size = 50

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
writable = no
printable = yes
guest only = yes

Can anyone give me some pointers as to where to start looking for potential causes?


Update: Running testparm shows no errors. Here's the output (minus the file shares):

[global]
workgroup = HOMENET
security = SHARE
log file = /var/log/samba.%m
max log size = 50
printcap name = cups
hosts allow = 192.168.1., 192.168.2., 127.

[printers]
comment = All Printers
path = /var/spool/samba
guest only = Yes
guest ok = Yes
printable = Yes
browseable = No

mrdrbob

Posted 2009-09-03T02:43:16.100

Reputation: 141

does your path /var/spool/samba exist? – Kurt Pfeifle – 2010-07-29T23:12:58.880

Which version of Samba have you installed? Which version(s) of Windows clients have you tested? – Kurt Pfeifle – 2010-07-29T23:16:04.440

Is your CUPS configured to share printers? Is your smbd compiled with support for libcups? [Run ldd smbd | grep libcups to find out...] – Kurt Pfeifle – 2010-07-29T23:21:34.710

can you do a testparm and update your question? – caliban – 2009-09-03T03:21:53.587

Do you still have this problem? – Der Hochstapler – 2012-04-26T23:38:32.080

Answers

1

My fresh install of Windows 7 Home Premium on a Gateway ML-3109, with NOD32 could not see my samba shares and shared printers on my Debian computer.

Windows 7 could ping the Debian machine, but the Debian machine could not ping the Windows 7 laptop (because Windows 7 was not listening).

I suspected my Samba settings were correct, because the prior Vista install on the same laptop as well as an XP install on another laptop were functioning correctly, so I focused on the Windows 7 install.

Tried all the various windows registry hacks, compatibility levels, credentials and etc. that I've seen in multiple forums without success, plus a handful of firewall adjustments no joy at all.

Frustrated, I decided to start from scratch and nuked the windows 7 install. During the windows install Windows asks you if this is a home or work computer. First time around I had selected home computer so this time I selected "work computer."

PooF! That was the trick. Turns out the "HOMEGROUP" garbage assumes your home network is homogeneous Windows 7 machines only, and shuts out all others. No doubt another Microsoft "undocumented security feature."

As a "work computer" I could add printers, browse the network, map to network drives and use all the normal network functionality with ease.

Note this is not the same as telling Windows 7 the network you're connecting to is home, work or public. If you're at that step it's too late. The dialog box you're looking for to solve this problem is during the actual install.

I realize this solution might not be an option for some, but this is what worked for me (and it was more fun to wipe the hard drive than create/registry keys all afternoon anyway).

user50791

Posted 2009-09-03T02:43:16.100

Reputation: 11

0

Have you checked the settings in /etc/cups/cupsd.conf? You may not have told CUPS to allow browsing. From my cupsd.conf:

Browsing On
BrowsOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL

There's also a BrowseLocalProtocols directive that can limit to SMB.

charlesbridge

Posted 2009-09-03T02:43:16.100

Reputation: 1 119

0

Shouldn't that be browsable = yes to allow them to show up in net view

Edit This was wrong, on looking at this page http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/classicalprinting.html#id2622601 I found the current setting was correct.

Col

Posted 2009-09-03T02:43:16.100

Reputation: 6 995

I updated the smb.conf and restarted samba, but it didn't seem to make a difference. Strangely, running testparm after changing the setting still shows browseable = No. No idea why. – mrdrbob – 2009-09-07T01:19:29.690

No, you were right at the start have a look at the link I've added – Col – 2009-09-08T08:01:02.807

0

Here's the Samba page on printing with CUPS. I'm not a CUPS wizard (last time I did this, LPRng was still the new hotness) but apparently part of the CUPS setup is to create a print queue.

If you've already done that, you should be able to install a printer on the Windows machine and give it the network address

\\smbserver\print_q

.. even if you can't browse directly to the printer. Obviously, replace "smbserver" with the name of the server and "print_q" with the name of the print queue.

You should be able to access CUPS configuration at http://localhost:631 and documentation at http://localhost:631/documentation.html (open these on your Linux system; they may be firewalled from remote access). If you haven't configured a print queue, that's where to start; if you have, it will probably be listed there.

quack quixote

Posted 2009-09-03T02:43:16.100

Reputation: 37 382

0

Don't you need to fill in all octets on the addresses? For example:

hosts allow = 192.168.1.0 192.168.2.0 127.0.0.0

I used these steps to print from an XP laptop to an Ubuntu 9.04 PC with an HP 5600 printer/fax

Add shared Ubuntu printer to XP laptop

Just replace the IP address and printer name with what you have on your LAN. Using the generic manufacturer and MS Publisher imagesetter allowed successful printing.

Chris U.

Posted 2009-09-03T02:43:16.100

Reputation:

that might work, but it looks like you're contacting CUPS directly over HTTP. that's not going via Samba -- this loses Samba access controls, for one. tho that may not matter for the OP. – quack quixote – 2009-10-19T07:55:00.160