LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   XP wont print to Samba, but Linux works (https://www.linuxquestions.org/questions/linux-networking-3/xp-wont-print-to-samba-but-linux-works-503639/)

msmarino 11-21-2006 12:48 PM

XP wont print to Samba, but Linux works
 
Hi all.

I have a small LAN:
  • Server (Debian Sarge)
  • Workstation (XP)
  • Laptop (Dual-Boot XP/Ubuntu)

Printer (HP 970Cxi) is connected via USB to Server, configured with Cups (1.1) and shared via Samba (3.0.14a-Debian).

Code:

# Samba config file created using SWAT
# from 192.168.11.6 (192.168.11.6)
# Date: 2006/11/21 18:50:51

# Global parameters
[global]
        workgroup = GRUPO_TRABAJO
        server string = %h server (Samba %v)
        security = SHARE
        encrypt passwords = No
        passdb backend = tdbsam, guest
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        printcap name = cups
        dns proxy = No
        ldap ssl = no
        panic action = /usr/share/samba/panic-action %d
        invalid users = root
        printing = cups
        print command =
        lpq command = %p
        lprm command =
        include = /etc/samba/dhcp.conf

[homes]
        comment = Home Directories
        create mask = 0700
        directory mask = 0700
        browseable = No

[printers]
        comment = All Printers
        path = /tmp
        printer admin = marcos, root
        guest ok = Yes
        printable = Yes
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers

[Compartido]
        path = /var/shared
        guest ok = Yes

[HP970]
        path = /tmp
        guest ok = Yes
        printable = Yes
        printer name = HP970

The point is, I can't print from XP, either the laptop or the workstation although Ubuntu prints perfectly via the same share.

Symptoms are
  • printer shows as "access denied" in xp control panel
  • printer properties dialog is slow appearing
  • attempting to print a test page hangs the printer property dialog

Folder shares all work perfectly on all systems.

XP Firewalls are deactivated. I've tried removing and reinstaling the share, all to no avail.

What am I missing?

Thanks in advance.

allend 11-22-2006 07:10 AM

I have XP machines printing using Samba and CUPS.
In my configuration, the printers are set as raw print queues in CUPS and printer drivers are installed on the XP machines. i.e. The XP machines format the print output and this is piped to the printers via CUPS.

The "access denied" message can be made to go away by setting the security permissions in XP so that XP does not have permissions to administer the printers.

The printer properties page being slow to appear is a problem that I observe on one XP machine, and I am yet to find an answer.

msmarino 11-22-2006 12:30 PM

Thanks for the response.

Quote:

Originally Posted by allend
I have XP machines printing using Samba and CUPS.
In my configuration, the printers are set as raw print queues in CUPS and printer drivers are installed on the XP machines. i.e. The XP machines format the print output and this is piped to the printers via CUPS.

This is my case too.

Quote:

Originally Posted by allend
The "access denied" message can be made to go away by setting the security permissions in XP so that XP does not have permissions to administer the printers.

The printer properties page being slow to appear is a problem that I observe on one XP machine, and I am yet to find an answer.

These are symptoms I can live with.

What I can't live with is not being able to print. :confused:

I have had this configuration working but it recently broke and I'm not entirely sure it wasn't something I touched or a Debian or XP update.

allend 11-22-2006 06:38 PM

Have you tried reinstalling the printer driver on the XP machines?

It may pay to check that the printer driver is up to date. I know that I had problems with printing to an HP4200tn following an XP update that was resolved by installing an updated driver.

zetabill 11-22-2006 08:01 PM

I hope you don't mind me piggybacking on this but it seems senseless to make another thread to ask the same question.

It seems as though setting this up is as simple as setting up the printer on the samba machine with the "driver" as Raw in CUPS, even though my model is listed, and then just running the driver installation CD on the Windows clients. I was going to go ahead and use the KDE Samba plugin to set up Samba as well.

Any thoughts? If the driver is set to raw then would it have problems printing from the Samba host itself? I want to cover all my bases because sometimes this server occasionally gets called to duty in the desktop arena. Just looking for some insight.

Thanks ahead of time.

allend 11-23-2006 12:39 AM

zetabill

I actually have two print queues per printer on my Linux servers.
One print queue is a raw print queue to which I direct the output from the Windows boxes.
The second print queue uses a CUPS printer driver to which I direct output from Linux/Unix boxes.
I do this because some of the applications on the Windows boxes perform their own print formatting and do not play nice with Linux (especially graphics).

You are correct in that you will need to configure both CUPS and Samba. How difficult this will be will depend on the level of security that you want to have. The CUPS and Samba documentation is very complete and takes a long time to digest. It may pay you to look for a HOWTO that provides guidance for the setup that you want.


msmarino

Another thought that I had regarding your problem. Check your /etc/cups/cupsd.conf to make sure that within the Location section you have allowed the IP address of your XP box.
My entries are like:

Deny all # Deny all unknown hosts
Allow 127.0.0.1 # To allow the Linux host to print
Allow 192.168.1.2 # To allow the host at 192.168.1.2 to print

msmarino 11-23-2006 10:04 AM

Quote:

Originally Posted by allend
Another thought that I had regarding your problem. Check your /etc/cups/cupsd.conf to make sure that within the Location section you have allowed the IP address of your XP box.
My entries are like:

Deny all # Deny all unknown hosts
Allow 127.0.0.1 # To allow the Linux host to print
Allow 192.168.1.2 # To allow the host at 192.168.1.2 to print

I've checked that, but thanks anyway.

I can print from linux on a dual boot laptop, but not from XP, and that is what has got me so confused.

Now, you say you have 2 print queues for your printers? How is that done? Is it possible I am inadvertantly using a CUPS queue from linux? When I select my printer in Ubuntu it shows as CUPS/hp970, even though I have configured it to use the Samba share.

allend 11-23-2006 07:13 PM

What happens when you change:
security = SHARE to security = user #in the [global] section of smb.conf and add
valid users = marcos, root #in the [printers] section of smb.conf
and then restart samba and cups?

Adding a second print queue is simply adding another printer with a different name, but with all other settings the same except the specification of the printer model rather than raw.

jiml8 11-23-2006 10:49 PM

Samba security should be set to user. Password encryption should be set to "yes". Make sure your users on the client system who might be printing are added to the samba user database.

Add this line to smb.conf global section:
print command = lpr-cups -P %p -o raw %s -r

I also have these commands under the [printers] section (not sure if one is redundant or not):

print command = lpr -P %p -o raw %s -r
lpq command = lpstat -o %p
lprm command = cancel %p-%j

Printer should be set up as a raw printer with all driver activity on the client.

Now edit these cups files (this is critically important):

In /etc/cups/mime.conv, toward the end of the file, uncomment this line:

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

Then, in /etc/cups/mime.types, toward the end of the file, uncomment this line:

application/octet-stream

I just went through all this three days ago when I upgraded my distro to Mandriva 2007, so it is fresh in my mind. Previously I had been network printing, and I reconfigured to make the printer local. This is how I shared it out, and it works just fine with Win2K and WinXP.

msmarino 11-27-2006 03:08 PM

Sorry it's been so long without an answer. Had hardware problems :eek:

Quote:

Originally Posted by jiml8
Samba security should be set to user. Password encryption should be set to "yes". Make sure your users on the client system who might be printing are added to the samba user database.

This shouldn't be necessary unless something important has changed lately. I've had this setup working for a few months on SHARE security without problems... until now :confused:

Quote:

Originally Posted by jim18
Add this line to smb.conf global section:
print command = lpr-cups -P %p -o raw %s -r

I also have these commands under the [printers] section (not sure if one is redundant or not):

print command = lpr -P %p -o raw %s -r
lpq command = lpstat -o %p
lprm command = cancel %p-%j

Printer should be set up as a raw printer with all driver activity on the client.

Now edit these cups files (this is critically important):

In /etc/cups/mime.conv, toward the end of the file, uncomment this line:

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

Then, in /etc/cups/mime.types, toward the end of the file, uncomment this line:

application/octet-stream

I just went through all this three days ago when I upgraded my distro to Mandriva 2007, so it is fresh in my mind. Previously I had been network printing, and I reconfigured to make the printer local. This is how I shared it out, and it works just fine with Win2K and WinXP.

I've changed the rest to exactly what you have here and... nada! nothing! exactly the same!

Thanks anyway.


All times are GMT -5. The time now is 09:03 AM.