Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO CUPS+Samba: printing from Windows & Linux
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3 ... 9, 10, 11  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Mon Dec 01, 2003 2:31 am    Post subject: HOWTO CUPS+Samba: printing from Windows & Linux Reply with quote

CUPS+Samba Printer Serving/Sharing with Windows, Linux, BSD---plus automagical Windows Driver Upload

You may have noticed that I posted this HOWTO over a year ago. A lot of things have changed and there are other ways to accomplish printing from Windows to a CUPS/Samba server. Please note also that I can't really support or look after this HOWTO anymore (no time, no nerve). And finally note, despite all that, it still works when followed step by step. Problems may arise depending on your Windows clients, your ppd and typos or other (stupid) mistakes in command lines and config files.

Someone should write a better, more up to date HOWTO. Volunteers?

Version 1.2 (purely arbitrary version numbering -- I am sure some things are still missing, please send me any suggestions you have to improve this guide).

Changes:

  • Added manual CUPS printer driver installation procedure (when the included install script wont work, i.e. on BSD systems).
  • Added corrections to work with CUPS 1.1.20 and above.
  • Added link to troubleshooting page from Kurt Pfeifle's CUPS-Samba printing manual "Printing Support in Samba 3.0" (see Links and Resources)
  • Updated to use the new version of cups-samba.tar.gz
  • Added some troubleshooting tips to help with common problems when running cupsaddsmb.
  • Added a warning not to forget to create and use a user to access the printer from the Windows clients.
  • Added a warning about the Samba option guest only = yes. Don't use it!
  • Added a warning (right after the "The Printerserver" heading) about having a working domain name system setup or a working /etc/hosts file to have all hostnames resolve correctly.
  • Added problem description and workaround about /var/spool/samba not being accessible for Windows client users to print to the server (permission problem).
  • Added information about using pdbedit to add users and the Samba 3.x passdb backend tdbsam.
  • Added a possible solution for the dreaded NT_STATUS_BAD_NETWORK_NAME error some people seem to have encountered. See the section about configuring Samba for the [print$] share here in the guide.


Abstract
If all works the way it is supposed to, after following this guide you should have a printer on a Unix machine (which runs CUPS) which can be used by any other Unix machine (with CUPS) on the network PLUS any Windows NT/2000/XP box WITHOUT having to install printer drivers on each of the boxes manually.

What you need:

  • A printer (PS or non-PS, maybe not TOO new or fancy)
  • A working network (home/office/whatever) consisting of more than one machine (or following this guide wouldn't make much sense, would it?)

This is what we will do:

  • On the printserver:

    • Install and configure Samba
    • Install and configure CUPS
    • Adding the printer to CUPS
    • Adding the PS drivers for the Windows clients

  • On the Unix clients:

    • Install and configure CUPS

  • On the Windows Clients:

    • Almost nothing to be done


Software needed and versions:

Before you use this guide:

I see there are a few other guides for CUPS and/or Samba, please read them as well! They might tell you things I forgot to mention here. Also, read the very useful and well written Gentoo Printing Guide, as I don't cover kernel configuration issues and the like here.

The Printserver

First of all: be sure that all your hostnames resolve correctly. Either have a working domain name system running on your network or appropriate entries in your /etc/hosts file. cupsaddsmb often borks if hostnames don't point to the correct machines.

The printserver is any Unix machine that runs CUPS (I've set all this up on my FreeBSD machine and have a Gentoo Laptop and 2 Windows 2000 boxes using the printer, but it should make no difference---using a Gentoo machine as a server, a dozen RedHat boxes as clients and 42 Windows XP installations works the same way). For this guide I will use a Gentoo 1.4 machine named PrintServer (how original) and a HP DeskJet 930C printer. I have no experience with other printers, so you may need to adjust certain steps according to your needs.

Emerging the Software

Very straightforward:

Code:

emerge samba
emerge cups
emerge foomatic
emerge hpijs # if you have an HP


Configuring Samba

The main Samba configuration file is smb.conf. In Gentoo it is located at /etc/samba/smb.conf. It is divided in sections indicated by [sectionname]. Comments are either `#' or `;'. I will only explain a few parameters for the defined sections/shares, not the trivial ones. Look at the man page for smb.conf or the installed smb.conf.example or the Samba Web site or any of the numerous Samba books available or or or...

At least the following should be added to smb.conf:

Code:

[global]
  workgroup = YOUR_WORKGROUP    # set your windows network
  workgroup name here
  load printers = yes
  browseable = yes
  printing = cups               # tell samba that we'd like CUPS for printing
  printcap name = cups
  encrypt passwords = yes
  lock directory = /usr/local/samba/var/lock
  interfaces = eth1             # the interface to the local network
  security = user

Be advised (thanks to graybeard and numerodix): If you like to use Samba's guest account to do anything concerning printing from Windows clients: don't.

Don't set guest only = yes in the global section.

I don't know why exactly, but the guest account seems to cause problems when running cupsaddsmb and sometimes when trying to connect from Windows machines. See below, too, when we talk about cupsaddsmb and the problems that can arise. Use a dedicated printer user, like "printeruser" or "printer" or "printme" or whatever. It doesn't hurt and it will certainly protect you from a lot of problems.

If anyone knows why this is, or how this works/works not, please tell me.

Do not set anything else than security = user (it's the default) in your smb.conf. Only causes trouble and bears many security risks if set to share, server, whatever. Read up on the topic in the official Samba HOWTO collection.

The following section allows for the PS drivers for Windows clients to be uploaded when needed. See later in this document how this works.

Code:

[print$]
  comment = Printer Drivers
  # this path holds the driver structure
  path = /etc/samba/printer
  guest ok = no
  browseable = yes
  read only = yes
  # add a username to the write list
  # if you don't want root to be the only
  # printer admin
  write list = username,root

Attention To avoid the dreaded NT_STATUS_BAD_NETWORK_NAME error it seems to be necessary to put the comment ("this path holds the driver structure") BEFORE or AFTER the line with path =/etc/samba/printer! Especially if you just cut'n'paste the stuff I wrote here (you shouldn't :) because it's always safer to write such things on your own, as can be seen here). If it is on the same line then Samba seeks for a share with the path "/etc/samba/printer # this path holds..." which of course cannot be found.

Thanks an effing lot to Dan Herrington who noticed that problem and told me about it!

The following creates a printer share so Windows clients can access the printer via Network Neighborhood or whatever.

Code:

[HPDeskJet930C] # the name is arbitrary, but should be consistent throughout
                # Samba and CUPS!
  comment = HP DeskJet 930C Network Printer
  printable = yes
  path = /var/spool/samba
  public = yes
  guest ok = yes
  printer admin = printer_username,root

[printers]      # here all printers will be shown; this becomes the Printers
                # share/section under Network Neighborhood
  comment = All Printers
  path = /var/spool/samba
  browseable = no
  public = yes
  guest ok = yes
  writable = no
  printable = yes
  printer admin = printer_username,root


You will most certainly have to create the directories manually (mkdir /etc/samba/printer, the spool directory and so on). That should be it for the minimum configuration for Samba to share the installed printer throughout the (Windows) network.

IMPORTANT: There seems to be a problem with the permissions of the Samba spool directory (at least on my and TriGuN's machines) as of (not exactly sure) Samba 3.0.3, which wouldn't let Windows clients print to the server, even when logged on an authenticated correctly.

To resolve this problem, I had to do a
Code:

# chmod 777 /var/spool/samba

Not exactly a solution but it worked. I am not sure whether the problem still exists in any newer (or older) Samba version, but that's how to get rid of it.

I recently saw that /var/spool/samba gets created with 777 permissions anyway, so the above IS a solution ;)

Now we have to add at least two Samba users to be able to install the printer drivers and to allow users to connect to the printer. Note that both users have to exist in the system's /etc/passwd file.

Be advised: It is important to have a printer user which will be used when logging in from the clients. Using the guest account doesn't really seem to work very well, please don't forget that step!

Of course the printer user can be any vaild Samba user you have on your system. Just be sure to add them to the list of valid users in smb.conf.

Code:

# smbpasswd -a printer_username
# smbpasswd -a root


root needs to be added to allow adding the PS drivers for Windows clients, and printer_username will be used by Windows clients when logging into PrintServer to connect to the printer. The Samba passwords need not (should not) be the same as the system passwords in /etc/passwd.

New versions of Samba (3.0+) use a different passdb backend than Samba 2.x. Refer to this section of the official HOWTO collection to learn how to convert your smbpasswd backend to the new tdbsam.

After converting (or if you freshly installed Samba 3.x and did not update from 2.x) you should set passdb backend = tdbsam in your smb.conf's [global] section. It would be a good idea to restart Samba now.

Now you can add users to your Samba password database (again, those users must already exist in the UNIX password database /etc/passwd) using the pdbedit command.
Code:

# pdbedit -a -u printer_username
# pdbedit -a -u root

That's it.

The last step is to add Samba to the default runlevel:

Code:

# rc-update add samba default


Configuring CUPS

This is a little more complicated (not much). CUPS' main config file is /etc/cups/cupsd.conf. It's structure is similar to Apache's httpd.conf file, so many of you might find it familiar. I'll outline the directives that need to be changed:

Code:

cupsd.conf:

ServerName PrintServer          # your printserver name
ServerAdmin root@PrintServer    # the person for printer-related hate-mail, eg you

AccessLog /var/log/cups/access_log # probably doesn't need changing
ErrorLog  /var/log/cups/error_log  # doesn't really need changing either

LogLevel  debug # only while isntalling and testing, should later be changed to 'info'

MaxClients 100 # I've had to set this to 1000000000 or so because some time back,
               # there seemed to be a bug in CUPS' controlling of the web interface,
               # making CUPS think a denial of service attack was in progress when
               # I tried to configure a printer with the web interface. weird.

BrowseAddress @IF(your_internal_interface_here) # eg @IF(eth1) or @IF(dc0)

<Location />
Order Deny,Allow
Deny From All
Allow From 192.168.0.*  # the addresses of your internel network
                        # eg 192.168.0.* will allow connections from any host on
                        # the 192.168.0.0 network. change to whatever suits you
</Location>

<Location /admin>
AuthType Basic
AuthClass System
Allow From 192.168.0.*  # same as above, allow any host on the 192.168.0.0 network
                        # to connect and do administrative tasks after authenticating
Order Deny,Allow
Deny From All
</Location>


The next items that need changing are mime.convs und mime.types.

Code:

mime.convs:

# The following line is found at near the end of the file. Uncomment it.
application/octet-stream        application/vnd.cups-raw        0       -

mime.types:

# Again near the end of the file.
application/octet-stream


The changes to mime.convs and mime.types are needed to make CUPS print Microsoft Office document files. Many people seem to need that :)

CUPS is started via
Code:

# /etc/init.d/cupsd start


Add it to the default runlevel via
Code:

# rc-update add cupsd default


Installing a printer for and with CUPS

First, hope that your printer is supported (many many many printers are). Then go to LinuxPrinting.Org to find and download the correct PPD file for your printer and CUPS. To do so, click the link Printer Listings to the left. Select your printers manufacturer and the model in the pulldown menu, eg HP and DeskJet 930C. Click "Show". On the page coming up click the "recommended driver" link after reading the various notes and information. Then fetch the PPD file from the next page, again after reading the notes and introductions there. You may have to select your printers manufacturer and model again. Reading the CUPS quickstart guide is also very helpful when working with CUPS.

Now you have a PPD file for your printer to work with CUPS. Very nice. Place it in /usr/share/cups/model. The PPD for the HP DeskJet 930C was named HP-DeskJet_930C-hpijs.ppd. You should now install the printer. This can be done via the CUPS web interface or via command line. The web interface is found at http://PrintServer:631 once CUPS is running. If you use the web interface you need to restart CUPS once you put the PPD file in /usr/share/cups/model. Issue
Code:

# /etc/init.d/cupsd restart


Using the command line is quicker and you have more control. The following
Code:

# lpadmin -p HPDeskJet930C -E -v usb:/dev/ultp0 -m HP-DeskJet_930C-hpijs.ppd

is for my setup on my FreeBSD machine. On a Gentoo machine it would look somewhat like this:
Code:

# lpadmin -p HPDeskJet930C -E -v usb:/dev/usb/lp0 -m HP-DeksJet_930C-hpijs.ppd

Be sure to have the name (-p) right (the name you set above during the Samba configuration!) and to put in the correct usb:/dev/usb/blah, parallel:/dev/lpt0 or whatever device you have the printer on.

If all worked you can access the printer now from the web interface. You should now be able to print a test page. If you aren't, you did something wrong or I forgot something :) Please correct me.

Installing the Windows printer drivers

Now that the printer should be working it is time to install the drivers for the Windows clients to work. Samba 2.2 introduced this functionality I think. Browsing to the print server in the Network Neighbourhood, right-clicking on the printershare and selecting "connect" downloads the appropriate drivers automagically to the connecting client, avoiding the hassle of manually installing printer drivers locally.

There are two sets of printer drivers for this. First, the Adobe PS drivers which can be obtained via http://www.adobe.com/support/downloads/main.html ("PostScript printer drivers"). Second, there are the CUPS PS drivers, to be obtained via http://www.cups.org/software.php and selecting "CUPS Driver for Windows" from the pull down menu.

I don't know exactly which of the two are better, but AFAIK the Adobe PS drivers need to be extracted on a Windows System since it's in .exe format. Also the whole procedure of finding and copying the correct files is a bit more hassle. The CUPS drivers seem to support some options the Adobe drivers don't. But I might be wrong. If anyone knows the steps involved in this please add them or send me a note about it.

The information in the following paragraphs is out of date since the CUPS developers are working on a new version of these drivers. Doing so they have pulled the old ones from the site but you can still use them as described in the cupsaddsmb man page.

Here I'll use the CUPS drivers for Windows. The downloaded file is called cups-samba-5.0rc2.tar.gz (EDIT: the old version was cups-samba-1.1.19.tar.gz). Extract the files contained into a directory.

Code:

# tar -xvzf cups-samba-5.0rc3.tar.gz


cd into that directory. The files in there are
Code:

cups-samba.install*
cups-samba.license
cups-samba.readme
cups-samba.remove*
cups-samba.ss


cups-samba.ss is a TAR archive containing three files:
cups5.hlp, cupsdrvr5.dll and cupsui5.dll. These are the actual driver files.

The script called cups-samba.install might work installing the drivers. Try it! It didn't work for me because under FreeBSD, almost everything which is not part of the base system is installed somewhere under the prefix /usr/local/. This seems not to be the case for most things you install under Linux. So if anything like this is the case, I'll go through this manually, just to be sure. Suppose your CUPS installation resides under /usr/local/share/cups/, and you want to install the drivers there. Do the following:
Code:

# cd /path/you/extracted/the/CUPS-driver/tarball/into
# tar -xvzf cups­samba.ss
---this extracts the files to usr/share/cups/drivers under the CURRENT WORKING DIRECTORY
# cd usr/share/cups/drivers
---no leading `/'!
# cp cups* /usr/local/share/cups/drivers


Now we'll use the script cupsaddsmb provided by the CUPS distribution. It's man page is an interesting read.
Code:

# cupsaddsmb -H PrintServer -U root -h PrintServer -v HPDeskJet930C


Instead of HPDeskJet930C you could also specify "-a", which will "export all known printers".

Be advised: The execution of this command often causes the most trouble. Reading through the posts in this thread, you'll see some errors, maybe you can solve the problems you might be having by carefully reading the suggested solutions and hints.

A correct output has to look somethin like this:
Code:

Password for root required to access pelargir via SAMBA:
Running command: smbclient //pelargir/print\$ -N -U'root%######' -c 'mkdir W32X86;put /var/spool/cups/tmp/411b688237af4 W32X86/HPDeskJet930C.ppd;put /usr/share/cups/drivers/cupsdrv5.dll W32X86/cupsdrv5.dll;put /usr/share/cups/drivers/cupsui5.dll W32X86/cupsui5.dll;put /usr/share/cups/drivers/cups5.hlp W32X86/cups5.hlp'
Domain=[PELARGIR] OS=[Unix] Server=[Samba 3.0.5]
putting file /var/spool/cups/tmp/411b688237af4 as \W32X86/HPDeskJet930C.ppd (6269.3 kb/s) (average 6269.5 kb/s)
putting file /usr/share/cups/drivers/cupsdrv5.dll as \W32X86/cupsdrv5.dll (4718.9 kb/s) (average 4795.2 kb/s)
putting file /usr/share/cups/drivers/cupsui5.dll as \W32X86/cupsui5.dll (14292.9 kb/s) (average 6669.8 kb/s)
putting file /usr/share/cups/drivers/cups5.hlp as \W32X86/cups5.hlp (6949.9 kb/s) (average 6677.0 kb/s)
 
Running command: rpcclient pelargir -N -U'root%######' -c 'adddriver "Windows NT x86" "HPDeskJet930C:cupsdrv5.dll:HPDeskJet930C.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'
Printer Driver HPDeskJet930C successfully installed.
 
Running command: rpcclient pelargir -N -U'root%######' -c 'setdriver HPDeskJet930C HPDeskJet930C'
Succesfully set HPDeskJet930C to driver HPDeskJet930C.


Anyway, here are two things that happened more than once:

  • The hostname given as a parameter for -h and -H (PrintServer) often does not resolve correctly and doesn't identify the print server for CUPS/Samba interaction.

    If an error like
    Code:

    Warning: No PPD file for printer "CUPS_PRINTER_NAME" - skipping!

    occurs, the first thing you should do is substitute PrintServer with localhost and try it again.
  • The command fails with an NT_STATUS_UNSUCCESSFUL. This error message is quite common, but can be triggered by many problems. It's unfortunately not very helpful.

    If you do have anything other than security = user (you have been warned above!) then put it away and never let it return! Always have security = user in your smb.conf unless you have a really sane reason no to. Thanks to numerodix!


This should install the correct driver directory structure under /etc/samba/printer. That would be /etc/samba/printer/W32X86/2/. The files contained should be the 3 driver files and the PPD file, renamed to YourPrinterName.ppd (the name which you gave the printer when installing it (see above).

So, we're done now with the Windows printer drivers (if I didn't forget anything).

Restarting Samba and CUPS

You should now issue
Code:

/etc/init.d/cupsd stop
/etc/init.d/samba stop
/etc/init.d/samba start
/etc/init.d/cupsd start

to be sure CUPS and Samba get everything correctly. Check the log files and see if everything was OK.

The clients

Here we'll deal with what has to be done on the clients which will use PrintServer as their print server.

UNIX/Linux/BSD

Whatever you use, the only thing needed is CUPS. On Gentoo install it
by
Code:

# emerge cups
# /etc/init.d/cupsd start
# rc-update add cupsd default


Do the equivalent on any other UNIX/Linux/BSD client.

That should be it. Nothing else will be needed. Just point your web browser
to http://localhost:631 (on the CLIENT!) and you'll see that PrintServer broadcasts all available printers to all CUPS clients.

To print, use for example
Code:

# lpr -pHPDeskJet930C anything.txt
# lpr -PHPDeskJet930C foobar.whatever.ps


Whatever. Very convenient. I am not sure how to make a specific printer the default on the client (so using only "lpr foobar.whatever.ps" will print to HPDeskJet930C on PrintServer), so if anyone knows this, please post it below :)

EDIT:
While reading A n00b's guide to printing with cups by sessionID I stumbled across a reply by MasonMouse which explains exactly the above.


You have to edit /etc/cups/client.conf and set the directive ServerName to your printserver. In the case of this guide that would be the following:
Code:

/etc/cups/client.conf:

ServerName PrintServer

That allows for just entering
Code:

lpr foobar.whatever.ps

which will print foorbar.whatever.ps directly to the print server. VERY conventient.

Setting the ServerName in client.conf seems to work well for only one printer, I don't know what would happen if PrintServer had 2 or more printers installed. So maybe there is still another way to set a client's default remote printer.

Also, when accessing http://localhost:631 on the client now, no printers seem to be "found" by the client-CUPS. I think this is to be expected when setting ServerName in client.conf,

/EDIT

Windows NT/2000/XP

That's just a bit of point-and-click. Browse to \\PrintServer and right click on the printer (HPDeskJet930C) and click connect. This will download the drivers to the Windows client and now every application (such as Word or Acrobat) will offer HPDeskJet930C as an available printer to print to. Blah :)

Done

Well that should be it. Although I may have forgotten something. If you found that guide useful or if anything didn't work the way it should, please post feedback and responses here, PM me or send them to daff at dword dot org.

Links and Resources

CUPS Homepage
Samba Homepage
LinuxPrinting dot Org
Kurt Pfeifle's Samba Print HOWTO
Note that this HOWTO really covers ANYTHING and EVERYTHING I've written here, plus a LOT more concerning CUPS and Samba, and generally printing support on networks. A really interesting read, with lots and lots of details. Unfortunately, it doesn't seem to be very popular; I've only now discovered HOW detailed and useful it is. If I knew about it earlier I would have saved myself a lot of time and work and wouldn't have had to find out everything by myself...Then again, it's not been around very long, maybe that's why I knew not about it :D
FreeBSD Diary's CUPS Topic

Troubleshooting
See this page from Kurt Pfeifle's "Printing Support in Samba 3.0" manual. Lots of useful tips there! Be sure to look this one up first, before posting questions and problems! Maybe the solution you're looking for is right there.
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.


Last edited by daff on Mon Jan 10, 2005 2:31 am; edited 25 times in total
Back to top
View user's profile Send private message
gwarf
n00b
n00b


Joined: 15 Apr 2003
Posts: 39
Location: Strasbourg, France

PostPosted: Tue Dec 02, 2003 10:07 pm    Post subject: Reply with quote

Thanks a lot, I'm gona try this, I was too lazy to do it before, now I have no more excuses, there's not too much work left to do :)
_________________
My opinion may have changed, but not the fact that I am right.
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Tue Dec 09, 2003 12:54 am    Post subject: Reply with quote

Please do so and tell me if everything works the way it should!
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Tue Dec 09, 2003 1:08 am    Post subject: Reply with quote

What about having no print server, just a windows box (that i can see and login to on samba) with a usb printer (hp officejet v40) hooked up to it?
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
graybeard
Tux's lil' helper
Tux's lil' helper


Joined: 16 Mar 2003
Posts: 118
Location: a blue state

PostPosted: Tue Dec 09, 2003 5:19 am    Post subject: Reply with quote

Thanks for this tutorial. Here is where it takes me:

Code:

root@gentoo dan # cupsaddsmb -H gentoo.home -U root -h gentoo.home -v Lexmark
Password for root required to access gentoo.home via SAMBA:
Running command: smbclient //gentoo.home/print\$ -N -U'root%######' -c 'mkdir W32X86;put /var/spool/cups/tmp/3fd50da8d55c2 W32X86/Lexmark.ppd;put /usr/share/cups/drivers/cupsdrv5.dll W32X86/cupsdrv5.dll;put /usr/share/cups/drivers/cupsui5.dll W32X86/cupsui5.dll;put /usr/share/cups/drivers/cups5.hlp W32X86/cups5.hlp'
session setup failed: NT_STATUS_LOGON_FAILURE
 
Password for root required to access gentoo.home via SAMBA:
Running command: smbclient //gentoo.home/print\$ -N -U'root%' -c 'mkdir W32X86;put /var/spool/cups/tmp/3fd50da8d55c2 W32X86/Lexmark.ppd;put /usr/share/cups/drivers/cupsdrv5.dll W32X86/cupsdrv5.dll;put /usr/share/cups/drivers/cupsui5.dll W32X86/cupsui5.dll;put /usr/share/cups/drivers/cups5.hlp W32X86/cups5.hlp'
Anonymous login successful
NT_STATUS_NETWORK_ACCESS_DENIED making remote directory \W32X86
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/Lexmark.ppd
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/cupsdrv5.dll
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/cupsui5.dll
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/cups5.hlp
 
ERROR: Unable to copy Windows printer driver files (256)!
root@gentoo dan #

As you can see when running cupsaddsmb, it asks for a root password. So I enter the pw and it stops with an error and asks again. So the second time I just hit return to see if it would go without it. It seems to have gotten a little farther but still is unable to make the remote directory.

Here is my smb.conf:

Code:

[global]
   workgroup = HOME
   server string = Samba Server Gentoo!
   interfaces = eth0
   printcap name = cups
   load printers = yes
   printing = cups
   log file = /var/log/samba/log.%m
   max log size = 50
   log level = 5
   hosts allow = 192.168.2. 127.0.0.1
   guest account = guest
   security = user
   encrypt passwords = yes
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 IPTOS_LOWDELAY
   name resolve order = lmhosts host bcast
   dns proxy = no
   guest only = yes
   unix password sync = Yes
   passwd program = /usr/bin/passwd %u
   case sensitive = no
 
[printers]
   comment = All Printers
   path = /var/spool/samba
   printable = yes
;  print command = lpr -P %p -o raw %s -r   # using client side printer drivers.;  print command = lpr -P %p %s # using cups own drivers (use generic PostScript on clients).
;  lpq command = lpq -P %p
;  lprm command = cancel %p-%j
   guest ok = yes
   browseable = yes
   public = yes
   writable = no
   printer admin = rosie,root
 
   [print$]
   comment = Printer Drivers
   path = /usr/share/cups/drivers
   browseable = yes
   guest ok = no
   read only = yes
   write list = rosie,root


The printer is a Lexmark X63 using a Z52 driver from gimp-print. Local printing works fine. I don't need to share anything but the printer for now. Any suggestions appreciated. Thanks.

-dan
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Tue Dec 09, 2003 7:29 am    Post subject: Reply with quote

graybeard: Did you add root to the Samba password file with
Code:

# smbpasswd -a root

? That NT_STATUS_LOGON_FAILURE thing usually means a wrong password or that a user doesn't exist (and therefore supplies a wrong password). The second time it seems to get farther is just a result of the first error, because it tries to add the printer drivers as an unprivileged, anonymous user (which, to my knowledge, doesn't and shouldn't work).

Also, have you added a section [Lexmark] to your smb.conf file? See the Configuring Samba section of my how-to.

Hope that helps a little.
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Tue Dec 09, 2003 4:29 pm    Post subject: Reply with quote

floam wrote:
What about having no print server, just a windows box (that i can see and login to on samba) with a usb printer (hp officejet v40) hooked up to it?


That's not the topic of my howto here :) I'm sure it's covered elsewhere though, I think I've seen a guide or two on this topic in the past. Anyway, that should be entirely possible. You might want to search the forum.
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
steel300
Veteran
Veteran


Joined: 10 Jul 2003
Posts: 1155

PostPosted: Wed Dec 10, 2003 11:55 pm    Post subject: Reply with quote

After having some troubles with the cups driver for windows, I decided to try the Adobe PostScript drivers for windows. They were a breeze to install. You just download the self-extracting executable, then run it on the Windows machine. It then displays the standard EULA, click accept and next. Then it asks if it is a local or network printer. Select network printer, and hit next. Type the location of your printer (mine was \\192.168.1.101\Epson). Then click next. Keep clicking next until the installation finishes. It was an absolute breeze. I'm just slightly disappointed that I couldn't get the CUPS drivers working. Oh well. Great How-To though. Thanks!
_________________
Rationality is the recognition of the fact that nothing can alter the truth and nothing can take precedence over that act of perceiving it.
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Thu Dec 11, 2003 1:35 am    Post subject: Reply with quote

That sounds cool! My experience was quite vice versa. Once I found the CUPS drivers (which wasn't SO easy, although they are on the CUPS web site) I just copied the 3 files plus the ppd-file CUPS uses into the correct directory and ran cupsaddsmb (but I described all that above in the guide). That's what I call a breeze :) On Linux the included install script should do just about everything for you. What were your problems with the CUPS drivers, anyway?

The Adobe drivers gave me a hard time finding the correct files, extracting them (after installing them locally I had to search through some weird folders in the WINNT directory, brrr) and renaming them (uppercase mostly). I also don't recall being able to install them directly from a Windows onto the print server. Maybe Adobe have changed the self extracting install file. I am going to try this out when I have time and add it to the guide. Thanks!
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Thu Dec 11, 2003 2:02 am    Post subject: Reply with quote

Hm, from what I have seen, the Adobe drivers install in a way that Windows thinks of the remote network printer as a local (PostScript) one. Am I right when I think that these need to be installed on every Windows client there is, since I don't see any files getting copied to the print server?

That's somewhat quite the contrary from what I want to do, which is to install printer drivers only on the print server, and then have the Windows clients automatically download the drivers from there when accessing the printer via the Network Neighborhood, right-clicking on it and clicking "Connect".

Admittedly, it's really not MUCH work to do, since the installation really IS a breeze, but when you have to administer, say, 50 Windows clients on a network, things like that can become boring :) It also does not fit in the concept of the automagical driver download/upload which I am very fond of (I'd say that's the only thing I really like about Windows 2000/XP).

That's also why I had to mess around so much with finding the correct files (ADOBEPS5.DLL, ADOBEPS.HLP, etc and the like) and putting them into CUPS' drivers directory manually (/usr/share/cups/drivers/).

Please correct me if I'm wrong!
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
steel300
Veteran
Veteran


Joined: 10 Jul 2003
Posts: 1155

PostPosted: Thu Dec 11, 2003 4:56 am    Post subject: Reply with quote

I know it's not what you intended to do with the Adobe drivers, but I just couldn't get the CUPS drivers to work. I thought this would be the best place to explain how to install the Adobe drivers. I agree with you that the automatic driver download is the best way to do it, but I just couldn't get it to work. It never set up the proper drivers directory for windows. If you've seen that before, maybe I could abandon the Adobe drivers and try again with CUPS.
_________________
Rationality is the recognition of the fact that nothing can alter the truth and nothing can take precedence over that act of perceiving it.
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Sat Dec 13, 2003 1:45 am    Post subject: Reply with quote

Well you could tell me what it is exactly that's not working. Please post the error messages, the cupsaddsmb commandline you're using and your [print$] section.
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
steel300
Veteran
Veteran


Joined: 10 Jul 2003
Posts: 1155

PostPosted: Sun Dec 14, 2003 6:22 pm    Post subject: Reply with quote

Sorry it's been so long since I replied. Nothing actually returned an error message. Mainly, Windows (2000) kept trying to install local drivers, instead of grabbing the drivers from the printserver. I have been able to fix it by manually copying the drivers where they're supposed to be on the server. Thanks for the great tutorial.
_________________
Rationality is the recognition of the fact that nothing can alter the truth and nothing can take precedence over that act of perceiving it.
Back to top
View user's profile Send private message
HoGiHung
n00b
n00b


Joined: 22 Dec 2003
Posts: 8

PostPosted: Mon Dec 22, 2003 2:24 am    Post subject: CUPS Printing - Server can print but Windows Clients Cant. Reply with quote

I'm hoping there is something real easy that I missed as I've spent the better part of two days+ trying to get printing to work on my new Gentoo box.

I've emerged Samba, CUPS, FooMatic and hpijs. I've downloaded the latest Windows drivers from the CUPS website and installed it. I've updated my smb.conf file as I was using an older method (lpd & lpr) on my old RedHat server from which I'm upgrading.

I've also removed the comment marks as indicated in some How-To's in the files mime.convs and mime.types.

I can print fine from the new server (Gentoo of course) but I cannot print from the windows clients. I've been manually installing the drivers as I've had trouble getting the auto-download driver to work. From any of my Windows Machines, they can see the printer on the samba server. They can even see when I do test prints from the server. But whenever I try to print from the Windows clients, nothing happens. No jobs go into the queue.

Can anyone assist? In my smb.conf file I added the following:

[global]
load printers = yes
browseable = yes
printing = cups
printcap = cups

[print$]
comment = Print Drivers
path = /etc/samba/printer
guest ok = no
read only = yes
write list = myname, wife, root

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
printer admin = myname, wife, root

I'm new to this so if you need more info, please let me know. Maybe even include where to obtain. For example, I'm still trying to figure out if my emerge of samba has the module for CUPS built in. :-(

Ho...
Back to top
View user's profile Send private message
HoGiHung
n00b
n00b


Joined: 22 Dec 2003
Posts: 8

PostPosted: Mon Dec 22, 2003 3:02 am    Post subject: Reply with quote

UPDATE. I have a suspicion my problem has to do with not being able to download the drivers. I grabbed the Adobe driver like someone else mentioned above. It installed and I was able to print. But with limited capabliity - only get the Generic Option and it doesn't do color.

I'll take another crack at it tomorrow. Hopefully someone will enlighten me.

Thanks.

Ho...
Back to top
View user's profile Send private message
HoGiHung
n00b
n00b


Joined: 22 Dec 2003
Posts: 8

PostPosted: Tue Dec 23, 2003 12:42 am    Post subject: Reply with quote

UPDATE:

I really don't know what to say other than it is working now. After work today I came back to work on this printing problem. The one thing I did before attacking the problem was to verify that the *.ppd file and the three cups files were in my /etc/samba/printer/W32X86 directory:

HP-DeskJet_970C-hpijs.ppd
cups5.hlp
cupsdrv5.dll
cupsui5.dll

The other thing I did was, using smbaddusr, added the account nobody. Think it already existed, as it prompted me for new password. So I put one in.

Just for grins and giggles I went to each of my Windows PCs. I was trying to see if there was an option to load the CUPS drivers. Didn't find one. But I did a test print and it worked. So I re-installed the printer on all three machines and they all can now print.

I never could get cupsaddsmb to work. *shrug*

Ho...
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Tue Dec 23, 2003 2:11 pm    Post subject: Reply with quote

Well, the most important thing is that you got it working now I suppose :P You do have a share in your smb.conf with the same name of the printer you added in CUPS? I.e. [HPDeskJet970] for example?. Also, maybe cupsaddsmb didn't like the read only=yes option in your [print$] section (my [print$] section only has comment =, path = and write list =, and nothing else, that should be enough)? And third, I believe the 3 CUPS files and the .ppd file need to be (in your case) under /etc/samba/printer/W32X86/2/.

Could you tell what kind of error messages cupsaddsmb gave you, also what the exact command line was you used?

PS: I think the Windows clients get the printer drivers from the server whenever you do a right-click on the network printer (browsing to \\printserver, for example) and click "Connect" (only if the local copy of the drivers is different from the previously downloaded).
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
HoGiHung
n00b
n00b


Joined: 22 Dec 2003
Posts: 8

PostPosted: Tue Dec 23, 2003 5:07 pm    Post subject: Reply with quote

The error I've been getting when trying to do cupsaddsmb is as follows:

error connecting to 127.0.0.1:139 (Connection refused)
Error connecting to 127.0.0.1 (Connection refused)
Connection to kiragentoo failed

Password for root required to access kiragentoo via SAMBA:

I keep putting in my password but I get that message over and over.

When I try to use cupsaddsmb, the syntax is as follows:

cupsaddsmb -H kiragentoo -U root -h kiragentoo -v HPDeskjet

I've tried with my user account and the nobody account. Neither work.

I'll go back and look at those other things you suggested. At them moment I'm now trying to figure out why the DHCP server isn't working.

Thanks,

Ho...
Back to top
View user's profile Send private message
daff
Apprentice
Apprentice


Joined: 02 Jul 2003
Posts: 232
Location: Vienna, Austria

PostPosted: Tue Dec 23, 2003 6:09 pm    Post subject: Reply with quote

HoGiHung wrote:
The error I've been getting when trying to do cupsaddsmb is as follows:

error connecting to 127.0.0.1:139 (Connection refused)
Error connecting to 127.0.0.1 (Connection refused)
Connection to kiragentoo failed

That seems to be a more deeper-lying problem...is Samba really running and is it running without any problems? Maybe have a look at the log files. Or look below.
HoGiHung wrote:

Password for root required to access kiragentoo via SAMBA:

I keep putting in my password but I get that message over and over.

When I try to use cupsaddsmb, the syntax is as follows:

cupsaddsmb -H kiragentoo -U root -h kiragentoo -v HPDeskjet

I've tried with my user account and the nobody account. Neither work.

I'll go back and look at those other things you suggested. At them moment I'm now trying to figure out why the DHCP server isn't working.

Good luck :)
HoGiHung wrote:

Thanks,

Ho...

Well, cupsaddsmb should be run as root (the system user, UID 0) with the commandline you posted above which seems to be correct. Other than that...I don't know what the problem could be...
_________________
Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.
Back to top
View user's profile Send private message
HoGiHung
n00b
n00b


Joined: 22 Dec 2003
Posts: 8

PostPosted: Tue Dec 23, 2003 8:56 pm    Post subject: Reply with quote

There might be an issue with my Samba install. I removed the read-only line as you suggested. I also did a test:

smbclient - L kiragentoo -U root

I could not connect.

But if I ran: smclient -L 192.168.1.10 -U root and hit enter for blank password, I get the usually listing of shares and domain info.

Perhaps my Samba install is not on the mark. I've noticed that it is not processing my login scripts either. Grrr.

Ho...
Back to top
View user's profile Send private message
HoGiHung
n00b
n00b


Joined: 22 Dec 2003
Posts: 8

PostPosted: Tue Dec 23, 2003 9:04 pm    Post subject: Reply with quote

/e smack head! Found part of the problem. Smclient now works with -L kiragentoo. Had to do some minor editing of /etc/hosts.

Now on to the other issues. :-)

Ho...
Back to top
View user's profile Send private message
petrjanda
Veteran
Veteran


Joined: 05 Sep 2003
Posts: 1557
Location: Brno, Czech Republic

PostPosted: Fri Dec 26, 2003 11:56 pm    Post subject: Reply with quote

i have a problem:
root@TNT ezekiel # modprobe usbcore
FATAL: Module usbcore not found.

but I do have USB printing support in the kernel...
Back to top
View user's profile Send private message
Vagabond
Apprentice
Apprentice


Joined: 19 Jan 2003
Posts: 192

PostPosted: Sat Dec 27, 2003 3:28 pm    Post subject: Reply with quote

Modprobe will only work if you built it as a module, if its built as a module, parhaps you forgot to do "make modules_install"

Vag
Back to top
View user's profile Send private message
blight01
n00b
n00b


Joined: 26 Sep 2003
Posts: 24
Location: Belgium

PostPosted: Mon Jan 05, 2004 1:34 am    Post subject: Reply with quote

man cupsaddsmb:

"The CUPS printer drivers are preferred over the Adobe drivers since
they support page accounting, banner pages, and page labels on all
printers. However, currently only Windows NT, 2000, and XP are sup-
ported by the CUPS drivers, so you will also need to get the Adobe
driver to support Windows 95, 98, and Me clients."

Both are useful to be installed...

@+
Back to top
View user's profile Send private message
shwag
n00b
n00b


Joined: 24 Sep 2003
Posts: 24
Location: Los Angeles, CA

PostPosted: Mon Jan 05, 2004 4:53 am    Post subject: CUPS Reply with quote

The client section on configuring CUPS to print to a samba printer was great. I said to emerge cups and configure it. Maybe in the next version it can actually go into HOW to configure CUPS.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3 ... 9, 10, 11  Next
Page 1 of 11

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum