# HOWTO CUPS+Samba: printing from Windows & Linux

## daff

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:

CUPS 1.1.20

Samba 2.2.8a (also works with Samba 3.0)

Foomatic 3.0

hpijs 1.4.1 (if you have an HP printer)

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:

```

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:

```

[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.

```

[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  :Smile:  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.

```

[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 

```

# 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  :Wink: 

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.

```

# 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.

```

# pdbedit -a -u printer_username

# pdbedit -a -u root

```

That's it.

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

```

# 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:

```

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.

```

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  :Smile: 

CUPS is started via

```

# /etc/init.d/cupsd start

```

Add it to the default runlevel via

```

# 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

```

# /etc/init.d/cupsd restart

```

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

```

# 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:

```

# 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  :Smile:  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.

```

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

```

cd into that directory. The files in there are

```

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:

```

# 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.

```

# 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:

```

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 

```

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

```

/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

```

# 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

```

# 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  :Smile: 

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:

```

/etc/cups/client.conf:

ServerName PrintServer

```

That allows for just entering

```

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  :Smile: 

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  :Very Happy: 

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.

----------

## gwarf

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  :Smile: 

----------

## daff

Please do so and tell me if everything works the way it should!

----------

## floam

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?

----------

## graybeard

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

```

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:

```

[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

----------

## daff

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

```

# 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.

----------

## daff

 *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  :Smile:  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.

----------

## steel300

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!

----------

## daff

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  :Smile:  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!

----------

## daff

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  :Smile:  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!

----------

## steel300

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.

----------

## daff

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.

----------

## steel300

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.

----------

## HoGiHung

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.   :Sad: 

Ho...

----------

## HoGiHung

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...

----------

## HoGiHung

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...

----------

## daff

Well, the most important thing is that you got it working now I suppose  :Razz:  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).

----------

## HoGiHung

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...

----------

## daff

 *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)
> ...

 

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.
> ...

 

Good luck  :Smile: 

 *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...

----------

## HoGiHung

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...

----------

## HoGiHung

/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.   :Smile: 

Ho...

----------

## petrjanda

i have a problem:

root@TNT ezekiel # modprobe usbcore

FATAL: Module usbcore not found.

but I do have USB printing support in the kernel...

----------

## Vagabond

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

----------

## blight01

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...

@+

----------

## shwag

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.

----------

## vdboor

Sorry for bothering you.. I've solved the problem I've just asked here.. ..and I've installed the printer in windowxp/vmware..  :Cool:  whoa.

I had to download the file called "Adobe Universal PostScript Windows Driver Installer 1.0.6 - English", and unzip it. the cupsaddsmb -v -a command failed, because it missed a few files..

thanks for this great tutorial.  :Very Happy: 

----------

## tj

this howto worked brilliantly for me first time so my eternal thanks to daff  :Smile: 

that said, I now need help - my 2 gentoo boxes + 1 win2k laptop + 1 winXP laptop all play fine on this home network (using the same workgroup, not domain) - this particular gentoo box has the usb printer attached and the other comps see and print to it fine

now my question - I recently added a mac powerbook to the mix running os-x 10.2.8 - used the same workgroup and username - it sees the network and the printer but won't connect

I can mount shares as gentoo root from the powerbook but that is it, however, I have no problems mounting the win2k/XP shares from the powerbook and vice-versa

I can also browse the mac share from gentoo as a regular user but can't write files

so, my question is, what am I missing? the biggest thing is access to the printer, though music would be a (non-)essential second

all constructive suggestions appreciated

tj

----------

## daff

 *tj wrote:*   

> this howto worked brilliantly for me first time so my eternal thanks to daff 
> 
> 

 

That's nice to hear  :Very Happy: 

 *tj wrote:*   

> 
> 
> that said, I now need help - my 2 gentoo boxes + 1 win2k laptop + 1 winXP laptop all play fine on this home network (using the same workgroup, not domain) - this particular gentoo box has the usb printer attached and the other comps see and print to it fine
> 
> now my question - I recently added a mac powerbook to the mix running os-x 10.2.8 - used the same workgroup and username - it sees the network and the printer but won't connect
> ...

 

I'm sorry, don't know much about MacOS and connecting to specific shares with it, but doesn't MacOX 10.1 (or so) has CUPS installed by default? So when you have CUPS running on the Powerbook just do a little configuration (don't know exactly what is needed for MacOS, but try starting CUPS and connecting to http://localhost:631 on the Powerbook) to it and it should see the printer on the print server (and be able to print to it).

That's at least what I've seen on the Powerbook of a guy for whom I installed a NetBSD firewall for his home network.

----------

## TriGuN

Hmm...I can't get this to work right.  Everything appears to work fine but whe n I right click on the printer, and click "connect", it asks to download the driver and then fails and says it couldn't download the driver.

I used the CUPS drivers but I found your documentation a teeny bit confusing.  If ya can help out, I would greatly appreciate it, thanks.  :Smile: 

----------

## daff

 *TriGuN wrote:*   

> Hmm...I can't get this to work right.  Everything appears to work fine but whe n I right click on the printer, and click "connect", it asks to download the driver and then fails and says it couldn't download the driver.
> 
> 

 

Hm, normally (if everything works correctly) when clicking "connect", Windows will download the drivers and connect quite silently, not notifying you or asking for permission at all. 

Seems that something with the drivers on the server side didn't work out right, or maybe the Samba share definitions/configuration contain a flaw. It might help if you post the revlevant parts of your smb.conf ([$print], [PRINTERNAME] and [printers]).

 *TriGuN wrote:*   

> 
> 
> I used the CUPS drivers but I found your documentation a teeny bit confusing.  If ya can help out, I would greatly appreciate it, thanks. 

 

Well you could tell me what part you found confusing and I can try to explain it to you as good as I can.

----------

## TriGuN

```

[print$]

   comment = Printer Drivers

   path = /etc/samba/printer

   guest ok = no

   browseable = yes

   read only = yes

   write list = @adm,steve,root

                                                                                

[HPPSC1210]

        comment = HP PSC 1210 Network Printer

        path = /var/spool/samba

        browseable = no

        public = yes

        guest ok = yes

        writable = no

        printable = yes

        printer admin = root

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

   printer admin = root

# to allow user 'guest account' to print.

   guest ok = yes

   writable = no

   printable = yes

   create mode = 0700

# =====================================

# print command: see above for details.

# =====================================

   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).

# The following two commands are the samba defaults for printing=cups

# change them only if you need different options:

;   lpq command = lpq -P %p

;   lprm command = cancel %p-%j

```

I honestly don't know why it's not working, afaik, I did everything according to the docs  :Smile: 

*edit*

It seems to work if I install the AdobePS drivers on my laptop, but since you recommend the CUPS drivers, I'd rather use those.  The only thing is, I don't know how to uninstall the AdobePS drivers now  :Sad: 

----------

## daff

 *TriGuN wrote:*   

> 
> 
> ```
> 
> [print$]
> ...

 

This seems ok. Do you have printing = cups and printcap name = cups in your [global] section (and do you have something 'unusual' defined in there?  :Smile: )?

 *TriGuN wrote:*   

> 
> 
> ```
> 
> [HPPSC1210]
> ...

 

This seems ok, too. Maybe you could add @adm and steve to the printer admin = entry, just for the sake of consistency.

 *TriGuN wrote:*   

> 
> 
> ```
> 
> [printers]
> ...

 

The only thing I don't think I like here (which may or may not be  part of the problem) is the print command = entry. As far as I know this is no needed when using Samba with CUPS for printing. Maybe try commenting that out and restarting both Samba and CUPS? But don't quote me on that, might be total BS  :Smile: 

 *TriGuN wrote:*   

> 
> 
> *edit*
> 
> It seems to work if I install the AdobePS drivers on my laptop, but since you recommend the CUPS drivers, I'd rather use those.  The only thing is, I don't know how to uninstall the AdobePS drivers now 

 

Yeah well, the AdobePS drivers "only" locally set you up a generic PostScript printer, suggesting Windows that the network printer (the HPPSC1210 you have) is really directly connected to the laptop. Not quite the "right" thing when you want to use a print server (but it is quite certain that it'd work, when all else fails).

I also don't know how to uninstall those drivers, but wouldn't Windows fetch the drivers from the print server again (if they are different from the local copies it got the first time you clicked 'connect') when you do a new right-click-'connect' to the printer? Just a thought...would be interesting to know.

What is the cupsaddsmb command line and you used? Can you post it along with the output it produces?

----------

## TriGuN

Yeah..when I click "connect" again, It just uses the AdobePS drivers again  :Sad: 

Here is the [global]: 

```

[global]

                                                                                                          

# 1. Server Naming Options:

# workgroup = NT-Domain-Name or Workgroup-Name

   workgroup = MSHOME

                                                                                                          

# netbios name is the name you will see in "Network Neighbourhood",

# but defaults to your hostname

;  netbios name = <name_of_this_server>

                                                                                                          

# server string is the equivalent of the NT Description field

   server string = Samba Server %v

                                                                                                          

# Message command is run by samba when a "popup" message is sent to it.

# The example below is for use with LinPopUp:

; message command = /usr/bin/linpopup "%f" "%m" %s; rm %s

                                                                                                          

# 2. Printing Options:

# CHANGES TO ENABLE PRINTING ON ALL CUPS PRINTERS IN THE NETWORK

# if you want to automatically load your printer list rather

# than setting them up individually then you'll need this

   printcap name = cups

   load printers = yes

                                                                                                          

# It should not be necessary to spell out the print system type unless

# yours is non-standard. Currently supported print systems include:

# bsd, sysv, plp, lprng, aix, hpux, qnx, cups

   printing = cups

                                                                                                          

# Samba 2.2 supports the Windows NT-style point-and-print feature. To

# use this, you need to be able to upload print drivers to the samba

# server. The printer admins (or root) may install drivers onto samba.

# Note that this feature uses the print$ share, so you will need to

# enable it below.

# This parameter works like domain admin group:

# printer admin = @<group> <user>

;   printer admin = @adm

                                                                                                          

# 3. Logging Options:

# this tells Samba to use a separate log file for each machine

# that connects

   log file = /var/log/samba/log.%m

                                                                                                          

# Put a capping on the size of the log files (in Kb).

   max log size = 50

                                                                                                          

# Set the log (verbosity) level (0 <= log level <= 10)

; log level = 3

                                                                                                          

# 4. Security and Domain Membership Options:

# This option is important for security. It allows you to restrict

# connections to machines which are on your local network. The

# following example restricts access to two C class networks and

# the "loopback" interface. For more examples of the syntax see

# the smb.conf man page. Do not enable this if (tcp/ip) name resolution does

# not work for all the hosts in your network.

;   hosts allow = 192.168.1. 192.168.2. 127.

                                                                                                          

# Uncomment this if you want a guest account, you must add this to /etc/passwd

# otherwise the user "nobody" is used

;  guest account = pcguest

                                                                                                          

# Security mode. Most people will want user level security. See

# security_level.txt for details.

   security = user

# Use password server option only with security = server or security = domain

# When using security = domain, you should use password server = *

;   password server = <NT-Server-Name>

;   password server = *

                                                                                                          

# Password Level allows matching of _n_ characters of the password for

# all combinations of upper and lower case.

;  password level = 8

;  username level = 8

                                                                                                          

# You may wish to use password encryption. Please read

# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.

# Do not enable this option unless you have read those documents

# Encrypted passwords are required for any use of samba in a Windows NT domain

# The smbpasswd file is only required by a server doing authentication, thus

# members of a domain do not need one.

  encrypt passwords = yes

  smb passwd file = /etc/samba/private/smbpasswd

# The following are needed to allow password changing from Windows to

# also update the Linux system password.

# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.

# NOTE2: You do NOT need these to allow workstations to change only

#        the encrypted SMB passwords. They allow the Unix password

#        to be kept in sync with the SMB password.

;  unix password sync = Yes

;  passwd program = /usr/bin/passwd %u

;  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n

;*passwd:*all*authentication*tokens*updated*successfully*

                                                                                                          

# Unix users can map to different SMB User names

;  username map = /etc/samba/smbusers

                                                                                                          

# Using the following line enables you to customise your configuration

# on a per machine basis. The %m gets replaced with the netbios name

# of the machine that is connecting

;   include = /etc/samba/smb.conf.%m

# Options for using winbind. Winbind allows you to do all account and

# authentication from a Windows or samba domain controller, creating

# accounts on the fly, and maintaining a mapping of Windows RIDs to unix uid's

# and gid's. winbind uid and winbind gid are the only required parameters.

#

# winbind uid is the range of uid's winbind can use when mapping RIDs to uid's

;  winbind uid = 10000-20000

#

# winbind gid is the range of uid's winbind can use when mapping RIDs to gid's

;  winbind gid = 10000-20000

#

# winbind separator is the character a user must use between their domain

# name and username, defaults to "\"

;  winbind separator = +

#

# template homedir determines the home directory for winbind users, with

# %D expanding to their domain name and %U expanding to their username:

;  template homedir = /home/%D/%U

#

# template shell determines the shell users authenticated by winbind get

;  template shell = /bin/bash

                                                                                                          

# 5. Browser Control and Networking Options:

# Most people will find that this option gives better performance.

# See speed.txt and the manual pages for details

   socket options = TCP_NODELAY

                                                                                                          

# Configure Samba to use multiple interfaces

# If you have multiple network interfaces then you must list them

# here. See the man page for details.

;   interfaces = 192.168.12.2/24 192.168.13.2/24

   interfaces = eth0

                                                                                                          

# Configure remote browse list synchronisation here

#  request announcement to, or browse list sync from:

#       a specific host or from / to a whole subnet (see below)

;   remote browse sync = 192.168.3.25 192.168.5.255

# Cause this host to announce itself to local subnets here

;   remote announce = 192.168.1.255 192.168.2.44

# set local master to no if you don't want Samba to become a master

# browser on your network. Otherwise the normal election rules apply

;   local master = no

                                                                                                          

# OS Level determines the precedence of this server in master browser

# elections. The default value should be reasonable

;   os level = 33

                                                                                                          

# Domain Master specifies Samba to be the Domain Master Browser. This

# allows Samba to collate browse lists between subnets. Don't use this

# if you already have a Windows NT domain controller doing this job

;   domain master = yes

                                                                                                          

# Preferred Master causes Samba to force a local browser election on startup

# and gives it a slightly higher chance of winning the election

;   preferred master = yes

                                                                                                          

# 6. Domain Control Options:

# Enable this if you want Samba to be a domain logon server for

# Windows95 workstations or Primary Domain Controller for WinNT and Win2k

;   domain logons = yes

# if you enable domain logons then you may want a per-machine or

# per user logon script

# run a specific logon batch file per workstation (machine)

;   logon script = %m.bat

# run a specific logon batch file per username

;   logon script = %U.bat

                                                                                                          

# Where to store roaming profiles for WinNT and Win2k

#        %L substitutes for this servers netbios name, %U is username

#        You must uncomment the [Profiles] share below

;   logon path = \\%L\Profiles\%U

                                                                                                          

# Where to store roaming profiles for Win9x. Be careful with this as it also

# impacts where Win2k finds it's /HOME share

; logon home = \\%L\%U\.profile

                                                                                                          

# The add user script is used by a domain member to add local user accounts

# that have been authenticated by the domain controller, or by the domain

# controller to add local machine accounts when adding machines to the domain.

# The script must work from the command line when replacing the macros,

# or the operation will fail. Check that groups exist if forcing a group.

# Script for domain controller for adding machines:

; add user script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u

# Script for domain member for adding local accounts for authenticated users:

; add user script = /usr/sbin/useradd -s /bin/false %u

                                                                                                          

# Domain groups:

# domain admin group is a list of unix users or groups who are made members

# of the Domain Admin group

; domain admin group = root @wheel

#

# domain guest groups is a list of unix users or groups who are made members

# of the Domain Guests group

; domain guest group = nobody @guest

                                                                                                          

# 7. Name Resolution Options:

# All NetBIOS names must be resolved to IP Addresses

# 'Name Resolve Order' allows the named resolution mechanism to be specified

# the default order is "host lmhosts wins bcast". "host" means use the unix

# system gethostbyname() function call that will use either /etc/hosts OR

# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf

# and the /etc/resolv.conf file. "host" therefore is system configuration

# dependant. This parameter is most often of use to prevent DNS lookups

# in order to resolve NetBIOS names to IP Addresses. Use with care!

# The example below excludes use of name resolution for machines that are NOT

# on the local network segment

# - OR - are not deliberately to be known via lmhosts or via WINS.

; name resolve order = wins lmhosts bcast

                                                                                                          

# Windows Internet Name Serving Support Section:

# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server

;   wins support = yes

                                                                                                          

# WINS Server - Tells the NMBD components of Samba to be a WINS Client

#       Note: Samba can be either a WINS Server, or a WINS Client, but NOT both

;   wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on

# behalf of a non WINS capable client, for this to work there must be

# at least one  WINS Server on the network. The default is NO.

;   wins proxy = yes

                                                                                                          

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names

# via DNS nslookups. The built-in default for versions 1.9.17 is yes,

# this has been changed in version 1.9.18 to no.

   dns proxy = no

                                                                                                          

# 8. File Naming Options:

# Case Preservation can be handy - system default is _no_

# NOTE: These can be set on a per share basis

;  preserve case = no

;  short preserve case = no

# Default case is normally upper case for all DOS files

;  default case = lower

# Be very careful with case sensitivity - it can break things!

;  case sensitive = no

                                                                                                          

# Enabling internationalization:

# you can match a Windows code page with a UNIX character set.

# Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),

# 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),

# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean Hangul),

# 950 (Trad. Chin.).

# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),

# ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)

# This is an example for french users:

;   client code page = 850

;   character set = ISO8859-1

```

And the cupsaddsmb output:

```

gentoo steve # cupsaddsmb -H gentoo -U root -h gentoo -v -a

Password for root required to access gentoo via SAMBA:

Running command: smbclient //gentoo/print\$ -N -U'root%######' -c 'mkdir W32X86;put /var/spool/cups/tmp/4001c5b2961fb W32X86/printer.PPD;put /usr/share/cups/drivers/ADOBEPS5.DLL W32X86/ADOBEPS5.DLL;put /usr/share/cups/drivers/ADOBEPSU.DLL W32X86/ADOBEPSU.DLL;put /usr/share/cups/drivers/ADOBEPSU.HLP W32X86/ADOBEPSU.HLP'

added interface ip=192.168.1.129 bcast=192.168.1.255 nmask=255.255.255.0

Domain=[MSHOME] OS=[Unix] Server=[Samba 2.2.8a]

NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86

putting file /var/spool/cups/tmp/4001c5b2961fb as \W32X86/printer.PPD (1458.4 kb/s) (average 1458.4 kb/s)

/usr/share/cups/drivers/ADOBEPS5.DLL does not exist

/usr/share/cups/drivers/ADOBEPSU.DLL does not exist

/usr/share/cups/drivers/ADOBEPSU.HLP does not exist

 

Running command: rpcclient gentoo -N -U'root%#####' -c 'adddriver "Windows NT x86" "printer:ADOBEPS5.DLL:printer.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"'

cmd = adddriver "Windows NT x86" "printer:ADOBEPS5.DLL:printer.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"

result was NT_STATUS_UNSUCCESSFUL

 

Running command: rpcclient gentoo -N -U'root%#####' -c 'setdriver printer printer'

cmd = setdriver printer printer

Succesfully set printer to driver printer.

 

gentoo steve #

```

Hope this helps  :Smile: 

----------

## daff

Hm your [global] section looks quite ok! As for the AdobePS driver on the laptop, how do you tell they are still being used?

But as you can see, cupsaddsmb doesn't do what it should do, failing with "/usr/share/cups/drivers/ADOBEPS5.DLL does not exist". This usually means you have not installed the CUPS drivers correctly so they do not reside in /usr/share/cups/drivers and cupsaddsmb tries to use the AdobePS drivers instead (the default is to first look for the CUPS files, then for the Adobe drivers).

Have you downloaded the drivers from the CUPS web site? And installed them with the included install script?

----------

## TriGuN

Ah whoops.  I must have skipped that step. I know the laptop is still using the AdobePS drivers because when I right click and view the printer properties, under "advanced", it says "Driver: AdobePS"  :Smile: 

*edit*

Okay so I install the CUPS drivers, as shown here:

```

gentoo root # ls /usr/share/cups/drivers

cups5.hlp  cupsdrv5.dll  cupsui5.dll

gentoo root #

```

And I run the cupsaddsmb command again, and I get the same output as before:

```

gentoo root # cupsaddsmb -H gentoo -U root -h gentoo -v -a

Password for root required to access gentoo via SAMBA:

Running command: smbclient //gentoo/print\$ -N -U'root%####' -c 'mkdir W32X86;put /var/spool/cups/tmp/4001cd4fc4f8b W32X86/printer.PPD;put /usr/share/cups/drivers/ADOBEPS5.DLL W32X86/ADOBEPS5.DLL;put /usr/share/cups/drivers/ADOBEPSU.DLL W32X86/ADOBEPSU.DLL;put /usr/share/cups/drivers/ADOBEPSU.HLP W32X86/ADOBEPSU.HLP'

added interface ip=192.168.1.129 bcast=192.168.1.255 nmask=255.255.255.0

Domain=[MSHOME] OS=[Unix] Server=[Samba 2.2.8a]

NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86

putting file /var/spool/cups/tmp/4001cd4fc4f8b as \W32X86/printer.PPD (18957.1 kb/s) (average 18959.0 kb/s)

/usr/share/cups/drivers/ADOBEPS5.DLL does not exist

/usr/share/cups/drivers/ADOBEPSU.DLL does not exist

/usr/share/cups/drivers/ADOBEPSU.HLP does not exist

 

Running command: rpcclient gentoo -N -U'root%####' -c 'adddriver "Windows NT x86" "printer:ADOBEPS5.DLL:printer.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"'

cmd = adddriver "Windows NT x86" "printer:ADOBEPS5.DLL:printer.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"

result was NT_STATUS_UNSUCCESSFUL

 

Running command: rpcclient gentoo -N -U'root%####' -c 'setdriver printer printer'

cmd = setdriver printer printer

Succesfully set printer to driver printer.

 

gentoo root # 

```

*edit again*

Okay It appears I was able to get rid of the AdobePS drivers by deleting the printer from the "Printers and Faxes" on the laptop.  Now when I try to connect to the print server, it says "you are about to install a printer which will automatically download a driver blah blah", so I hit OK, and then it says "the server does not have the correct driver installed blah blah"

 :Sad: 

----------

## daff

Hm. This gives me an idea: what version of CUPS are you using? If it is less than 1.1.20, please upgrade. The CUPS drivers of the new version all have a '5' in the filename, as you can see. The drivers of CUPS 1.1.19 and below don't. So the cupsaddsmb command of CUPS 1.1.19 looks for the files that are named cups.hlp, cupsdrv.dll and cupsui.dll. It can't find them, because you use the newer drivers with and older CUPS installation.

If this is not the problem, I'll have to think of something else  :Smile: 

PS: -U'root%******' I hope that's not your REAL root password  :Smile: 

----------

## TriGuN

I believe you are right my friend. 

```

*  net-print/cups

      Latest version available: 1.1.19-r1

      Latest version installed: 1.1.19-r1

      Size of downloaded files: 3,604 kB

      Homepage:    http://www.cups.org

      Description: The Common Unix Printing System

```

but 1.1.19 is the stable version.  I guess I'll just use ~x86 and get 1.1.20  :Smile: 

----------

## daff

I use 1.1.20 on my main FreeBSD box without problems at all, I believe it's fairly stable and safe to use. If you don't want to use the unstable package, you can try to find the old CUPS drivers here or  here.

----------

## TriGuN

nah don't worry I'm compiling 1.1.20 as we speak  :Smile:  and I'll let you know how everything goes  :Smile: 

----------

## daff

Very well  :Smile:  I'll be around for another hour or two I think.

----------

## TriGuN

And it works perfectly!!! Thanks a lot man, you saved me a lot of hassle  :Very Happy: 

I printed a test page and it even showed the cups drivers instead of the adobePS drivers, so we're sure it's not using those  :Smile: 

Just curious, are printers automatically started when CUPS is started?

*edit* also, is there a way to not have to log in when I go to "\\printserver" on my laptop?  :Smile: 

----------

## daff

Great to hear!  :Very Happy: 

Do you mean that CUPS will turn on the printer if it is offline/powered off? I don't know, but I think not. If it's online/powered on though, it will of course load the ppd and the drivers and all.

For not having to log in: add another user on the printserver, just like the printer user I believe you created according to the guide, and give this user the same name and password as he has on your Windows system (odd that you don't have that already? That was one of the first things I did when I started using Samba). That way, Windows will send the username/password combination you use to log into your Windows system and both will match on the printserver. No need for manually supplying username and password thus.

----------

## TriGuN

What I meant was, when you go to http://localhost:631 , and you go to printers, there is a button that says "Start Printer" or "Stop Printer".  I was just wondering if it is automatically started when CUPS is started  :Smile: 

And Thanks again  :Very Happy: 

----------

## daff

 *TriGuN wrote:*   

> What I meant was, when you go to http://localhost:631 , and you go to printers, there is a button that says "Start Printer" or "Stop Printer".  I was just wondering if it is automatically started when CUPS is started 
> 
> And Thanks again 

 

Uh, yeah, I think CUPS starts the printers automatically.

No problem, glad to have helped  :Smile: 

----------

## TriGuN

Um...the user on laptop has a space in it [my full name] ...How do I add that in the samba config?  :Smile: 

*edit*

Ah n/m.  If you set security = share in [global], you won't have to log in at all either  :Smile: 

----------

## daff

Good to know, since the system wont let you have a space in your username, and Samba, which has no problems with spaces, requires that its usernames match with the ones in the /etc/passwd file.

----------

## VanDan

I followed the instructions in the original post, and ( after adding a 'root' account on the NT4 domain controller ) the 'cupsaddsmb' thing added my printers and the downloaded CupsSamba drivers to my samba setup. Good how-to, by the way!

I then went into the network neighbourhood and clicked on my samba server, clicked 'connect' and the drivers were downloaded and the printer set up properly.

However ... the margins are very wrong. Test pages on both my Laserjet 4500 and Ricoh Aficio AP3200 start *way* too far down the page, and the Laserjet4500 also starts *way* too far to the right.

I should note now that I am using the correct ppd files, downloaded from the LinuxPrinting site ( HP ) and the Ricoh site ( Aficio ). Both printers' margin setups are *perfect* under Linux - the cups test pages appear in exactly the right place.

I have looked at the ppd files that Windows is downloading, and they are the same ( respective ) ones I have working under CUPS.

There are no windows-client options for setting up the margins.

Anyone know what the problem is?

----------

## daff

 *VanDan wrote:*   

> 
> 
> I have looked at the ppd files that Windows is downloading, and they are the same ( respective ) ones I have working under CUPS.
> 
> There are no windows-client options for setting up the margins.
> ...

 

Sounds odd, never heard of that before...you say everything works fine under Linux? Also when printing from Linux to the print server?

Can you not access any properties or printer options on the Windows clients before printing? I.e. accessing the print server via \\printserver and then opening 'Printers', right-clicking on (one of) the printer(s) and clicking 'Properties'. There's a property window with some tabs (General, Sharing, Ports, Advanced, etc). Opening 'Advanced' and there 'Printing Defaults'. Again an 'Advanced' button, and there are at least some options to configure (Paper size maybe).

That's all I can think of ATM.

Maybe someone else knows more?

----------

## Ateo

Thanks for post a MOST useful printing HOWTO....

Regards

----------

## TriGuN

Okay, well, I sold that computer, and I'm trying to setup this again on my new server.  Unfortunately, it doesn't work.  Linux to linux printing does work, just not windows to linux (from my laptop).

the laptop just complains about the server not having the correct drivers installed blah blah.

My SMB.conf: http://steve.neoturbine.net:8000/smb.conf

eh?  :Sad: 

*edit*

The cupsaddsmb command did not report anything particularly bad, and it did copy the 3 cups drivers to /usr/share/cups/drivers, and yes, I am using cups 1.1.20  :Smile: 

Here's the cupsaddsmb output:

```

neoturbine root # cupsaddsmb -a -v

Password for root required to access localhost via SAMBA:

Running command: smbclient //localhost/print\$ -N -U'root%<censored>' -c 'mkdir W32X86;put /var/spool/cups/tmp/40181d62afad6 W32X86/hp_psc_1210.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'

added interface ip=192.168.1.10 bcast=192.168.1.255 nmask=255.255.255.0

Domain=[MSHOME] OS=[Unix] Server=[Samba 2.2.8a]

NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86

putting file /var/spool/cups/tmp/40181d62afad6 as \W32X86/hp_psc_1210.ppd (19093.8 kb/s) (average 19095.7 kb/s)

putting file /usr/share/cups/drivers/cupsdrv5.dll as \W32X86/cupsdrv5.dll (8553.1 kb/s) (average 8872.6 kb/s)

putting file /usr/share/cups/drivers/cupsui5.dll as \W32X86/cupsui5.dll (8245.9 kb/s) (average 8596.4 kb/s)

putting file /usr/share/cups/drivers/cups5.hlp as \W32X86/cups5.hlp (13899.0 kb/s) (average 8684.8 kb/s)

Running command: rpcclient localhost -N -U'root%<censored>' -c 'adddriver "Windows NT x86" "hp_psc_1210:cupsdrv5.dll:hp_psc_1210.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'

cmd = adddriver "Windows NT x86" "hp_psc_1210:cupsdrv5.dll:hp_psc_1210.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"

result was NT_STATUS_UNSUCCESSFUL

Running command: rpcclient localhost -N -U'root%<censored>' -c 'setdriver hp_psc_1210 hp_psc_1210'

cmd = setdriver hp_psc_1210 hp_psc_1210

Succesfully set hp_psc_1210 to driver hp_psc_1210.

neoturbine root #

```

 :Sad: 

----------

## nielchiano

just a question:

how can I align my cardriges on an HP 916c? Under windows there is a tool for it, but under Linux ??????

----------

## daff

 *TriGuN wrote:*   

> Okay, well, I sold that computer, and I'm trying to setup this again on my new server.  Unfortunately, it doesn't work.  Linux to linux printing does work, just not windows to linux (from my laptop).
> 
> the laptop just complains about the server not having the correct drivers installed blah blah.
> 
> My SMB.conf: http://steve.neoturbine.net:8000/smb.conf
> ...

 

Well it seems, that cupsaddsmb didn't like some things there:

```

Domain=[MSHOME] OS=[Unix] Server=[Samba 2.2.8a]

NT_STATUS_OBJECT_NAME_COLLISION making remote directory

and

"hp_psc_1210:cupsdrv5.dll:hp_psc_1210.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"

result was NT_STATUS_UNSUCCESSFUL

```

This could mean some things, but I am not sure what the problem is. Most probably it's a misconfiguration in the smb.conf, but so far I didn't find anything wrong or missing in your config.

Maybe try that again with the /etc/samba/printer directory completely emtpy (it exists, doesn't it?)? Also, are Samba and CUPS running while you're doing this? And while we're at it: are the permissions on /etc/samba/printer set correctly? 

That's all I can think of at the moment...

----------

## daff

 *nielchiano wrote:*   

> just a question:
> 
> how can I align my cardriges on an HP 916c? Under windows there is a tool for it, but under Linux ??????

 

I'm sorry, but I have no idea for that problem.

----------

## TriGuN

Yes, the directory exists, Yes I am doing it while samba and CUPS are running, and I am not sure about the permissions, but it's owned by root:root  :Smile: 

hope this helps [you to help me]  :Very Happy: 

----------

## daff

 *TriGuN wrote:*   

> Yes, the directory exists, Yes I am doing it while samba and CUPS are running, and I am not sure about the permissions, but it's owned by root:root 
> 
> hope this helps [you to help me] 

 

Is it empty? The permissions should not matter though if you run cupsaddsmb as root.

I am running out of ideas here. In any case, your smb.conf is ok. I read somewhere that sometimes the .ppd file can cause problems, but I don't know if that applies here. If there is another .pdd you could use with your printer you may want to give it a try. BTW: which Samba version are you using? If it's 2.2.x maybe you could upgrade to 3.0 and try again.

Other than that I don't know at the moment. Error messages like NT_STATUS_OBJECT_NAME_COLLISION are a little too cryptic to get useful information out of...

I wonder: it worked the last time, why not now? Did you take the configuration over from the last setup?

----------

## TriGuN

Yeah I'm using 2.2.x...and no I didn't take anything over from the last setup  :Sad: 

I'll try 3.x and see how it goes..

----------

## L8Knight

I wanted to post this in case there are others out there that have a similar problem.  I followed all the instructions to a 'T'.  I used the correct versions of cups, samba, etc.  I went with the cups driver options (instead of Adobe's).  The two problems I had where:

#1 I had to change the security=share to security=user and add a root user to samba to get the cupsaddsmb utility to work correctly.  Once that was done, I changed the security setting back to share.

#2 The other problem I had was that my Windows XP machine would not download the drivers no matter what I did.  I went through and double checked everything and ended up resetting up my cups/samba config with one apparent change.  For all of my original settings I used [PhotoSmart] as the samba share for the printer and for the cups name of the printer (as instructed).  When I set the configs up for the last time I chagned the name to [HPPhotoSmart1115] and matched that with the cups name.  I also made sure the samba comment and the cups description matched.  This seemed to solve my problem although I'm not completely convinced that it was the cause - maybe I changed something when I redid the config files.  Who knows.

For completeness, here are my working configs.  First my smb.conf file:

```

[global]

   workgroup = WORKGROUP

   server string = Samba Server %v

   printcap name = cups

   load printers = yes

   printing = cups

   browseable = yes

   log file = /var/log/samba/log.%m

   max log size = 50

   hosts allow = 192.168.0. 127.

   security = share

   encrypt passwords = yes

   smb passwd file = /etc/samba/private/smbpasswd

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   dns proxy = no

   log level = 4

[print$]

   comment = Printer Drivers

   path = /var/lib/samba/printers

   browseable = yes

   guest ok = no

   read only = yes

   write list = @adm root

[HPPhotoSmart1115]

   comment = HP PhotoSmart 1115

   printable = yes

   path = /var/spool/samba

   guest ok = yes

   public = yes

   printable = yes

   printer admin = @adm root

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

   guest ok = yes

   public = yes

   writable = no

   printable = yes

   printer admin = @adm root

```

And my cups printers.conf file:

```

<DefaultPrinter HPPhotoSmart1115>

Info HP PhotoSmart 1115

Location Home

DeviceURI usb://hp/photosmart%201115

State Idle

Accepting Yes

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

</Printer>

```

----------

## olias2

 *daff wrote:*   

> 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.
> 
> The following
> 
> ```
> ...

 

Thank you daff for writting this HOWTO. I'm just having a wee problem. Here's what I get when I type 

```
# lpadmin -p HP-Laser -E -v parallel:/dev/lp0 -m HP-LaserJet_2_w_PS-Postscript.ppd

lpadmin: Unable to connect to server: Connection refused
```

Both samba and cupsd are running and here are my conf files...

```
#

# smb.conf

#

[global]

   workgroup = HOME-LAN

   netbios name = genlin

   server string = File and Print Server

   hosts allow = 192.168.1. 127.

   printcap name = cups

   load printers = yes

   browseable = yes

   printing = cups

   log file = /var/log/samba/log.%m

   max log size = 50

   security = user

   encrypt passwords = yes

   lock directory = /usr/local/samba/var/lock

   interfaces = eth0

   smb passwd file = /etc/samba/private/smbpasswd

   unix password sync = Yes

   passwd program = /usr/bin/passwd %u

   passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n

              *passwd:*all*authentication*tokens*updated*successfully*

   pam password change = yes

   obey pam restrictions = yes

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   dns proxy = no

[homes]

   comment = Home Directories

   browseable = no

   writable = yes

   valid users = %S

   create mode = 0664

   directory mode = 0775

[print$]

  comment = Printer Drivers

  path = /etc/samba/printer

  guest ok = no

  browseable = yes

  read only = yes

  write list = olias,root

[HP-Laser]

  comment = HP LaserJet Series II

  printable = yes

  path = /var/spool/samba

  public = yes

  guest ok = yes

  printer admin = olias,root

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

   public = yes

   guest ok = yes

   writable = no

   printable = yes

   printer admin = olias,root

[scratch]

   comment = Temporary file space

   path = /home/scratch

   only guest = yes

   writable = yes

   printable = no

[media]

   comment = MP3 Share

   path = /home/mp3

   valid users = olias

   public = no

   writable = yes

   printable = no

   create mask = 0765

```

```
#

# cupsd.conf

#

ServerName genlin.linbox.loc

ServerAdmin root@linbox.loc

AccessLog /var/log/cups/access_log

ErrorLog  /var/log/cups/error_log

LogLevel  debug

MaxClients 100

BrowseAddress @IF(eth0)

DataDir /usr/share/cups

DocumentRoot /usr/share/cups/docs

#

# Security Options

#

<Location />

Order Deny,Allow

Deny From All

Allow From 192.168.1.*

</Location>

<Location /admin>

AuthType Basic

AuthClass System

Allow From 192.168.1.*

Order Deny,Allow

Deny From All

</Location>

mime.convs:

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

mime.types:

application/octet-stream
```

 Where did I mess up?

Olias

----------

## olias2

Oh, I just looked at the previous post's date. I'm guessing this thread has gone stale.   :Sad: <mercy bump> :Sad: 

----------

## olias2

PLEASE help me!   :Embarassed:   lpadmin says ' Unable to connect to server: Connection refused but when I try to start cupsd, it says it's already running. What Gives?

Thanks, Olias

```
# lpadmin -p HP-Laser -E -v parallel:/dev/lp0 -m HP-LaserJet_2_w_PS-Postscript.ppd 

lpadmin: Unable to connect to server: Connection refused

# /etc/init.d/cupsd start

 * WARNING:  "cupsd" has already been started.

```

----------

## daff

Sorry it took me so long to get back to this topic, but I've been quite busy lately...

I'll try an help anyway, although I honestly have no real idea why you get that 'Connection refused' messages. The only thing that I can think of at the moment is that your network isn't configured in such a way that the localhost machine on 127.0.0.1 and the host with the IP address 192.168.1.n (also localhost, but with a 'real' IP address) are the same to CUPS (only allowing from 192.168.1.*, not from 127.0.0.1)...just a guess. Do you have a DNS running? If so then it is probably configured correctly, or else it wouldn't really run well, would it? (DNS always seemed a bit black-artish to me, before I figured it out.) If not, maybe check your /etc/hosts file so that entries like 

127.0.0.1 localhost

192.168.1.n hostname.domainname hostname localhost

or so exist.

Apart from that, try changing the Allow From rules in cupsd.conf to 127.0.0.* and see if it still doesn't want you to connect. If it lets you, then it really might be a network config problem. If it still wont let you then I don't know.

These are just guesses! From what you've posted I really can't make out what would cause the problems you're describing, sorry. The configurations seem just fine.

Good luck!

----------

## pubecon

(sorry to be posting here with a windows error!)

when trying to connect to the printers shared via samba I receive

The server on which the '<printername>' printer resides does not have the correct printer driver installed. If you want to install the driver on your local computer, click OK

printing from the linux machines works fine

I believe I have all the necessary files as installed by cups-samba.install and I have run 

```
cupsaddsmb -H server.ctu.local -U root -h server.ctu.local -a
```

what could I have missed?

thanks in advance

----------

## olias2

Thanks daff for your reply. My /etc/hosts file is as in your example. I'm thinking of reloading my server from scratch and I'll report back if this does the trick.

Olias

----------

## snorre

Daff - your HOW TO is great! my HP PSC 950 works just fine ... but I'm not able to install the cups driver to use them with my Win2k clients  :Sad: . whenever I try to run cupsaddsmb I get the following error ...

```

root # cupsaddsmb -v -a 

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

```

I added root to smb

```

smbpasswd -a root

```

my smb.conf is most similar to your's:

[print$]

        comment = Printer Drivers

        path = /etc/samba/printer

        write list = root

[HPPSC950]

        comment = HP PCS 950

        printable = yes

        path = /var/spool/samba

        public = yes

        guest ok = yes

        printer admin = root

the printer works fine - I can see it and print using the win drivers - but I can't get my Win2k clients to use the cups printers as I don't get them installed - any idea or feedback would be highly appreciated!

many thanks!

snorre

----------

## pubecon

 *snorre wrote:*   

> 
> 
> ```
> 
> root # cupsaddsmb -v -a 
> ...

 

don't meant to seem pedantic but, just to clarify, are you doing what the error message suggests and then looking to see if you have renamed the ppd file and put it in the appropriate place?

 *snorre wrote:*   

> 
> 
> the printer works fine - I can see it and print using the win drivers - but I can't get my Win2k clients to use the cups printers as I don't get them installed - any idea or feedback would be highly appreciated!

 

when you say you don't get them installed are you referring to the previous message of "no PPD file found..." or is it a client-side error like my 

 *pubecon wrote:*   

> The server on which the '<printername>' printer resides does not have the correct printer driver installed. If you want to install the driver on your local computer, click OK

 

----------

## Nossie

Hi,

I'm having the same problem as snorre. If I do:

```
root # cupsaddsmb -v QMS

Warning: No PPD file for printer "QMS" - skipping!
```

/etc/cups/ppd/QMS.ppd exists

contents of /etc/cups/printers.conf

```
# Printer configuration file for CUPS v1.1.20

# Written by cupsd on Thu Mar 18 22:48:50 2004

<DefaultPrinter QMS>

Info QMS Magicolor 2

Location 

DeviceURI socket://192.168.0.22:35

State Idle

Accepting Yes

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

</Printer>

```

contents of /etc/samba/smb.conf

```
#======================= Global Settings =====================================

[global]

   workgroup = SCHNABEL

   netbios name = PRINT_SERVER

   server string = File Server

   hosts allow = 192.168.0.0/24 192.168.1.0/24 127.0.0.1

   hosts deny = ALL

   browsable = yes

   load printers = yes

   printing = cups

   printcap name = cups

   interfaces = eth0

   guest account = nobody

   log level = 0

   log file = /var/log/samba/%m.log

   max log size = 50

   security = user

   encrypt passwords = yes

   socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   local master = yes

   os level = 64

   wins proxy = yes

   dns proxy = yes

   oplocks = false

   level2oplocks = false

   hide unreadable = yes

   username map = /etc/samba/smbusers

   map to guest = bad user

   domain master = no 

   preferred master = no

   wins support = no

   

#============================ Share Definitions ==============================

[print$]

    comment = Printer Drivers

    path = /etc/samba/drivers

    guest ok = no

    browseable = yes

    read only = yes

    write list = root

                

[printers]

    comment = All Printers

    path = /var/spool/samba

    browseable = no

    public = yes

    guest ok = yes

    writable = no

    printable = yes

    printer admin = root

[QMS]

    comment = QMS MagiColor 2

    printable = yes

    path = /var/spool/samba

    public = yes

    guest ok = yes
```

Since cupsaddsmb didn't work, I tried to install the files manually.

```
smbclient //PRINT_SERVER/print\$ -U root -c 'cd W32X86; put cups5.hlp; put cupsdrv5.dll; put cupsui5.dll; put QMS.ppd'
```

This puts the files in /etc/samba/drivers/W32X86/

After this the files need to be added to the driver database, and they must be placed in /etc/samba/drivers/W32X86/2/

The following command *should* do that.

```
rpcclient localhost -N -U'root%xxxxxx' -c 'adddriver "Windows NT x86" "QMS:cupsdrv5.dll:QMS.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'
```

This didn't work for me..... the first xxx times. Now, i'm duplicating the steps to write this post, and suddenly... it works... VERY strange, I didn't change anything        :Confused: 

Now the files are in the /etc/samba/drivers/W32X86/2/ folder.

*Maybe* it has something to do with the 'security = user' setting in the samba config. I Had that set to share yesterday, and late yesterday evening i read somewhere that that could be a problem. I changed it to user, but I can't remember if I reloaded samba after that   :Embarassed:   (well, it was very late, and I had to get up early in the morning....)

Maybe this will help someone else.

I am still not able to automatically download the driver from a windows XP workstation   :Sad: 

I get the following error :

 *Quote:*   

> The server for the printer does not have the correct driver installed. Blah blah blah....

 

gr,

NossieLast edited by Nossie on Sat Mar 20, 2004 2:31 pm; edited 1 time in total

----------

## snorre

pubecon,

aahem, well I had copied the .ppd File (HP_PSC_950-hpijs.ppd) to the folder "/usr/share/cups/model" but I did not rename it ...

I thought that this is not needed   :Embarassed: 

thanks for the "TIP" - but I still get the error on the Win2k clients ...

The Server on which the printer xxx resides does not have the correct printer driver installed. If bla, bla, bla ...

any ideas?

----------

## pubecon

I'm afraid, I too am experiencing much strangeness with this whole procedure (i.e I followed it all to the letter and it worked, then I went to add another printer and it's all come crashing down - none of the drivers upload to the windows clients now [fortunately I'd already added the essential ones)

since all my clients are win2k, my solution was to abandon this madness, duplicate all the printers as RAW in cups (see where this is going..)

then I, using win2ks built-in ipp support, added a 'network printer' with the address http://serveraddress.whatever.local:631/printers/printername and when the win2k clients noted that there was no driver associated with it I just pointed it to the .inf file I got off the manufacturers website (hp).

I'll come back to this samba magic if ever it is explained as less magic and more science (I managed to get a glimpse of a samba book and it appeared to explain this process in more detail.  I'm half-tempted to buy one just to fix this problem and gain some more insight into it all)...

----------

## xcable

I'm getting a error, in the samba log file gives:

```

Unable to print file to hpdeskjet970c - client-error-document-format-not-supported

```

Anyone know what this means?

heath

----------

## daff

Everyone: I am very sorry but I really haven't had the time lately to support this thread, and I am quite sure I am not going to have much time in the future either. Hopefully some of you who have got it running could help out.

Just a quick hint for xcable: did you uncomment the following lines in /etc/cups/mime.types and /etc/cups/mime.convs?

```

mime.convs:

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

mime.types:

application/octet-stream

```

As for the others, I may have some time the next two to three days to look into the reported problems as far as I can (I am no Samba or CUPS or IPP or whatever expert either  :Smile: ), if there's still need for this.

----------

## xcable

Thanks for the responce.  I had already modified mime.convs and mime.types.  

The major problem was that cups was not started up correctly, I fixed it be reverting to the example cupsd.conf, modifiing it and restarting cupsd.  I also had to point my printer spool in smb.conf to "/var/spool/cups/tmp" not "/var/spool/cups".

thanks,

heath

----------

## daff

 *pubecon wrote:*   

> I'm afraid, I too am experiencing much strangeness with this whole procedure (i.e I followed it all to the letter and it worked, then I went to add another printer and it's all come crashing down - none of the drivers upload to the windows clients now [fortunately I'd already added the essential ones)
> 
> since all my clients are win2k, my solution was to abandon this madness, duplicate all the printers as RAW in cups (see where this is going..)
> 
> 

 

It really can become a madness. Printing and print serving seem to be even more complicated and error- or misconfiguration-prone than mail servers and DNS.

 *pubecon wrote:*   

> 
> 
> I'll come back to this samba magic if ever it is explained as less magic and more science (I managed to get a glimpse of a samba book and it appeared to explain this process in more detail.  I'm half-tempted to buy one just to fix this problem and gain some more insight into it all.
> 
> 

 

True, true, the whole Samba stuff is WAY underdocumented if I may say so. The Samba website is quite worthless, and until recently it didn't even point to a main documentation project or manual or whatever.

It seems that this has changed, however: Here you'll find just about everything about Samba. See also Chapter 19, which explains everything I've written in my How-To, but had to gather from experience and trial & error: http://at.samba.org/samba/docs/man/

It still isn't as readable and good a manual as I'd like it to be.

One general word of advice: It seems like some of you are trying to install a a printer for the Windows clients without giving it the same name as the printer has in CUPS. Naming consistency seems to be really important when it comes to sharing printers across CUPS installations, Samba servers and Windows clients.

Also, the printer must be working within CUPS and Linux clients, before it can be shared with or exported to Windows clients!!! If you haven't got a working test page out of the CUPS administration Web interface, don't even bother with Samba and Windows.

I also can say that the How-To worked when I tested it recently when I set up a new server from scratch, so I don't think there are any major faults or mishaps inherent. But I sure might be wrong.

----------

## daff

 *xcable wrote:*   

> Thanks for the responce.  I had already modified mime.convs and mime.types.  
> 
> 

 

Ok. Whenever I ran across the error messages you posted it was very certain that someone forgot to edit these two lines, so that's the first thing that comes to mind  :Smile: 

 *xcable wrote:*   

> 
> 
> The major problem was that cups was not started up correctly, I fixed it be reverting to the example cupsd.conf, modifiing it and restarting cupsd.  I also had to point my printer spool in smb.conf to "/var/spool/cups/tmp" not "/var/spool/cups".
> 
> 

 

I don't know about the spool directories you use (never heard about /var/spool/cups/tmp), but they shouldn't really matter I think, as long as the permissions are correct. 

Very good that you seem to have it working now!

----------

## daff

I added a section about Troubleshooting to the How-To. It is from Kurt Pfeifle's "Printing Support in Samba 3.0", the manual which covers everything about CUPS and Samba in way more detail and great length. Be sure to have a look at it and check the Troubleshooting section there! It contains many answers to many common problems. 

Looky here: CLICK THIS!!!

I should have known about that from the beginning. Damn.

----------

## phantomlord

When I run cupsaddsmb I get this error message: NT_STATUS_BAD_NETWORK_NAME

Anyone who has any idea what is wrong?

```

root@phantom samba # cupsaddsmb -H phantom -U root -h phantom -v HPLaserJet4L

Password for root required to access phantom via SAMBA:

Running command: smbclient //phantom/print\$ -N -U'root%zaQrMfo9375' -c 'mkdir W32X86;put /var/spool/cups/tmp/4081545acbd7a W32X86/HPLaserJet4L.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'

added interface ip=192.168.0.133 bcast=192.168.0.255 nmask=255.255.255.0

Domain=[PROMETHEUS] OS=[Unix] Server=[Samba 2.2.8a]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

 

Password for root required to access phantom via SAMBA:

Running command: smbclient //phantom/print\$ -N -U'root%' -c 'mkdir W32X86;put /var/spool/cups/tmp/4081545acbd7a W32X86/HPLaserJet4L.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'

added interface ip=192.168.0.133 bcast=192.168.0.255 nmask=255.255.255.0

Domain=[PROMETHEUS] OS=[Unix] Server=[Samba 2.2.8a]

tree connect failed: NT_STATUS_WRONG_PASSWORD

 

ERROR: Unable to copy Windows printer driver files (256)!

```

----------

## numerodix

I've tried to follow your guide but cupsaddsmb gives me this...

```
# cupsaddsmb -H PrintServer -U root -h PrintServer -v HP_Desk_Jet_670C

Warning: No PPD file for printer "HP_Desk_Jet_670C" - skipping!
```

I've installed this printer with the gentoo printing guide and it's been working fine on the local machine. I also tried installing it a few times more according to your instructions with a ppd file from LinuxPrinting. Everytime I get the above message, everything else seems to be fine.

One small anomaly however, when I browse the web interface for cups, click on the printer, then the "Configure Printer" button, I get:

```
server-error-service-unavailable
```

I don't know if this might be helpful but here is the printer as cups knows it:

```
# cat printers.conf

# Printer configuration file for CUPS v1.1.20

# Written by cupsd on ons 21-04-2004 23:59:03 CEST

<DefaultPrinter HP_Desk_Jet_670C>

Info HP_Desk_Jet_670C

DeviceURI parallel:/dev/lp0

State Idle

Accepting Yes

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

</Printer>

```

Should there be a reference to a ppd file in there somewhere? I did indeed complete this command without error:

```
 lpadmin -p HP_Desk_Jet_670C -E -v parallel:/dev/lp0 -m HP-DeskJet_670C-hpijs.ppd
```

I haven't tried printing from the local machine since making these changes as I haven't been able to, I will try later. However, browsing the printer from a WinXP host, the printer shows up and I can connect to it, though it informs me that there's no driver available.

----------

## daff

numerodix: I have seen that this error can occur when the hostname 'PrintServer' doesn't really point to the actual printserver (do you have sane entries in /etc/hosts?). You can try using 

```

# cupsaddsmb -H localhost -U root -h localhost -v HP_Desk_Jet_670C 

or 

# cupsaddsmb -H localhost -U root -h localhost -v -a

```

Also try IP-adresses if the above doesn't work. If it's STILL not working then you might have other problems too. Try setting the LogLevel directive in cupsd.conf to debug, and then 

```

# tail -F /var/log/cups/error_log

```

in a terminal window while running cupsaddsmb. Might give you some information. 

About that other error...it might be related, although it looks like something else. Where you ever able to print a test page? Following the Gentoo Printer Guide should result in being able to get a working test page I reckon  :Smile: 

----------

## numerodix

Thanks for the tip, indeed it was a resolution problem. cupsaddsmb now executes without error and printing works fine locally. However I still can't get the drivers from a remote machine. I've looked at the error log and I don't really get what's wrong, here it is (starting cups and connecting from a WinXP client):

```
#  tail -F /var/log/cups/error_log

D [23/Apr/2004:16:38:47 +0200] LoadDevices: Added device "usb:/dev/usblp15"...

D [23/Apr/2004:16:38:47 +0200] LoadDevices: Added device "http"...

D [23/Apr/2004:16:38:47 +0200] LoadDevices: Added device "smb"...

I [23/Apr/2004:16:38:47 +0200] LoadPPDs: Read "/etc/cups/ppds.dat", 253 PPDs...

I [23/Apr/2004:16:38:47 +0200] LoadPPDs: No new or changed PPDs...

D [23/Apr/2004:16:38:47 +0200] LoadAllJobs: Scanning /var/spool/cups...

I [23/Apr/2004:16:38:47 +0200] Full reload complete.

D [23/Apr/2004:16:38:47 +0200] StartListening: NumListeners=1

D [23/Apr/2004:16:38:47 +0200] StartListening: address=00000000 port=631

D [23/Apr/2004:16:38:47 +0200] ResumeListening: setting input bits...

D [23/Apr/2004:16:39:54 +0200] AcceptClient() 5 from localhost:631.

D [23/Apr/2004:16:39:54 +0200] ReadClient() 5 POST / HTTP/1.1

D [23/Apr/2004:16:39:54 +0200] ProcessIPPRequest: 5 status_code=0

D [23/Apr/2004:16:39:54 +0200] ReadClient() 5 POST / HTTP/1.1

D [23/Apr/2004:16:39:54 +0200] ProcessIPPRequest: 5 status_code=0

D [23/Apr/2004:16:39:54 +0200] CloseClient() 5

D [23/Apr/2004:16:39:54 +0200] AcceptClient() 5 from localhost:631.

D [23/Apr/2004:16:39:54 +0200] ReadClient() 5 POST / HTTP/1.1

E [23/Apr/2004:16:39:54 +0200] get_printer_attrs: resource name '/printers/::{2227a280-3aea-1069-a2de-08002b30309d}' no good!

D [23/Apr/2004:16:39:54 +0200] Sending error: client-error-not-found

D [23/Apr/2004:16:39:54 +0200] ProcessIPPRequest: 5 status_code=406

D [23/Apr/2004:16:39:54 +0200] CloseClient() 5

D [23/Apr/2004:16:40:10 +0200] AcceptClient() 5 from localhost:631.

D [23/Apr/2004:16:40:10 +0200] ReadClient() 5 POST / HTTP/1.1

D [23/Apr/2004:16:40:10 +0200] ProcessIPPRequest: 5 status_code=0

D [23/Apr/2004:16:40:10 +0200] ReadClient() 5 POST / HTTP/1.1

D [23/Apr/2004:16:40:10 +0200] ProcessIPPRequest: 5 status_code=0

D [23/Apr/2004:16:40:10 +0200] CloseClient() 5
```

EDIT: I tried a couple more invocations of cupsaddsmb and I now get an error, I could swear it wasn't there before but I can't be completely sure.

```
#  cupsaddsmb -H localhost -U root -h localhost -v HPDeskJet670C

Password for root required to access localhost via SAMBA:

Running command: smbclient //localhost/print\$ -N -U'root%pass' -c 'mkdir W32X86;put /var/spool/cups/tmp/408931ea1be1e W32X86/HPDeskJet670C.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'

added interface ip=10.0.1.11 bcast=10.0.1.255 nmask=255.255.255.0

Domain=[MATUSIAK] OS=[Unix] Server=[Samba 2.2.8a]

putting file /var/spool/cups/tmp/408931ea1be1e as \W32X86/HPDeskJet670C.ppd (1110.0 kb/s) (average 1110.0 kb/s)

putting file /usr/share/cups/drivers/cupsdrv5.dll as \W32X86/cupsdrv5.dll (4718.9 kb/s) (average 3977.4 kb/s)

putting file /usr/share/cups/drivers/cupsui5.dll as \W32X86/cupsui5.dll (12611.4 kb/s) (average 5608.3 kb/s)

putting file /usr/share/cups/drivers/cups5.hlp as \W32X86/cups5.hlp (142340000.0 kb/s) (average 5762.7 kb/s)

 

Running command: rpcclient localhost -N -U'root%pass' -c 'adddriver "Windows NT x86" "HPDeskJet670C:cupsdrv5.dll:HPDeskJet670C.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'

cmd = adddriver "Windows NT x86" "HPDeskJet670C:cupsdrv5.dll:HPDeskJet670C.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"

result was NT_STATUS_UNSUCCESSFUL

 

Running command: rpcclient localhost -N -U'root%pass' -c 'setdriver HPDeskJet670C HPDeskJet670C'

cmd = setdriver HPDeskJet670C HPDeskJet670C

Succesfully set HPDeskJet670C to driver HPDeskJet670C.
```

NT_STATUS_UNSUCCESSFUL it is, the samba howto for v3 (my samba is 2.2.8a) says the CUPS printer must be known to Samba, otherwise the "  setdriver" subcommand fails with an NT_STATUS_UNSUCCESSFUL error.

Well the name of the printer in smb.conf is the exact same as it is known to cups.   :Question:  I've also restarted samba a dozen of times but the printer name has been unchanged for a long time, I really don't know why this is happening.

----------

## numerodix

A little update, I did install the driver now (had to change security to user temporarily) but it still won't work downloading it from the clients. I've been looking at the logs, the cups log looks the same still, the samba log (/var/log/samba/log.smbd) looks like this:

```
[2004/04/23 19:22:40, 1] smbd/service.c:close_cnum(880)

  frasier (127.0.0.1) closed connection to service print$

[2004/04/23 19:22:41, 0] printing/nt_printing.c:get_correct_cversion(1110)

  get_correct_cversion: Unable to connect

[2004/04/23 19:22:41, 0] lib/util_str.c:safe_strcpy_fn(577)

  ERROR: NULL dest in safe_strcpy

[2004/04/23 19:22:41, 0] lib/util_str.c:safe_strcpy_fn(577)

  ERROR: NULL dest in safe_strcpy

[2004/04/23 19:22:41, 0] lib/util_str.c:safe_strcpy_fn(577)

  ERROR: NULL dest in safe_strcpy

```

EDIT: I found out that the guest account for samba was not declared and was set to nobody. Apparently this wasn't good for gaining access from the clients. I changed it to "printer" which is an actual account on the server with regular permissions. Now I think it's finally working as it should, I was able to print a test page from the client and looking at the drivers it's using I see the files that are supposed to be served off the server. The only anomalities is that I get errors when opening the properties of the printer, having opened the printer window. I get those access permission errors from explorer.exe, no idea what they are even. Don't have time for more testing now but fingers crossed that it's finally coming together.   :Laughing: 

----------

## daff

 *numerodix wrote:*   

> 
> 
> EDIT: I found out that the guest account for samba was not declared and was set to nobody. Apparently this wasn't good for gaining access from the clients. I changed it to "printer" which is an actual account on the server with regular permissions. Now I think it's finally working as it should, I was able to print a test page from the client and looking at the drivers it's using I see the files that are supposed to be served off the server. The only anomalities is that I get errors when opening the properties of the printer, having opened the printer window. I get those access permission errors from explorer.exe, no idea what they are even. Don't have time for more testing now but fingers crossed that it's finally coming together.  

 

Now THAT'S the kind of problem solving that I like; the kind that works without me having to do anything  :Smile: 

You mention some access permission errors...and I thought I was the only one having those! I have no idea what they are, why they are or what the hell causes them. 

Must have something to do with Samba. I've never had those before, but I think they came with a Samba update...

And yes, a printer user should be used to connect and use the printers from the clients. guest is no good. This is why I mention it in the guide:

 *Quote:*   

> 
> 
> 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. 
> 
> ```
> ...

 

----------

## numerodix

 *daff wrote:*   

> 
> 
> 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.
> 
> 

 

Right, but I didn't really know where this comes in on the client side, short of demanding a "printer" user on each of the clients. So apparently setting the guest user to printer does the trick. Whenever I read these guides I'm always very aware of my own ignorance so I try to follow the text without considering the implications, thus these simple things like having a corresponding printer user on the server often escape me.  :Embarassed: 

Btw, not being able to execute cupsaddsmb without temporarily changing security to user has now happened at least twice, you might want to include that in your howto.  :Smile: 

----------

## daff

 *numerodix wrote:*   

>  *daff wrote:*   
> 
> 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.
> 
>  
> ...

 

I know what you mean, happens to me all the time  :Smile: 

Thanks for your input, I'll update the howto right away.

----------

## BlindSpy

good guide =)

----------

## IronMan

It's been a week or so since the last post in this thread, so I hope someone's listening. I'm getting the same problem Phantomlord got, 

```

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

```

I'm running:

```
 cupsaddsmb -v -a 
```

According to man cupsaddsmb, not specifying hosts defaults to the CUPS host. And I think Samba is working because I can see my system from a Windows XP Network Neighborhood.

The testparm output is:

```

Load smb config files from /etc/samba/smb.conf

Processing section "[homes]"

Processing section "[printers]"

Processing section "[backup]"

Loaded services file OK.

Press enter to see a dump of your service definitions

# Global parameters

[global]

   coding system = 

   client code page = 850

   code page directory = /var/lib/samba/codepages

   workgroup = SPARKY

   netbios name = IRONRING

   netbios aliases = 

   netbios scope = 

   server string = Marc's Computer

   interfaces = 

   bind interfaces only = No

   security = USER

   encrypt passwords = Yes

   update encrypted = No

   allow trusted domains = Yes

   hosts equiv = 

   min passwd length = 5

   map to guest = Never

   null passwords = No

   obey pam restrictions = No

   password server = 

   smb passwd file = /etc/samba/private/smbpasswd

   root directory = 

   pam password change = No

   passwd program = /usr/bin/passwd

   passwd chat = *new*password* %n\n *new*password* %n\n *changed*

   passwd chat debug = No

   username map = 

   password level = 0

   username level = 0

   unix password sync = No

   restrict anonymous = No

   lanman auth = Yes

   use rhosts = No

   ssl = No

   ssl hosts = 

   ssl hosts resign = 

   ssl CA certDir = 

   ssl CA certFile = 

   ssl server cert = 

   ssl server key = 

   ssl client cert = 

   ssl client key = 

   ssl egd socket = 

   ssl entropy file = 

   ssl entropy bytes = 256

   ssl require clientcert = No

   ssl require servercert = No

   ssl ciphers = 

   ssl version = ssl2or3

   ssl compatibility = No

   admin log = No

   log level = 10

   syslog = 1

   syslog only = No

   log file = /var/log/samba/log.%m

   max log size = 50

   timestamp logs = Yes

   debug hires timestamp = No

   debug pid = No

   debug uid = No

   protocol = NT1

   large readwrite = Yes

   max protocol = NT1

   min protocol = CORE

   read bmpx = No

   read raw = Yes

   write raw = Yes

   acl compatibility = 

   nt smb support = Yes

   nt pipe support = Yes

   nt status support = Yes

   announce version = 4.9

   announce as = NT

   max mux = 50

   max xmit = 16644

   name resolve order = lmhosts host wins bcast

   max ttl = 259200

   max wins ttl = 518400

   min wins ttl = 21600

   time server = No

   unix extensions = No

   change notify timeout = 60

   deadtime = 0

   getwd cache = Yes

   keepalive = 300

   lpq cache time = 10

   max smbd processes = 0

   max disk size = 0

   max open files = 10000

   name cache timeout = 660

   read size = 16384

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   stat cache size = 50

   use mmap = Yes

   total print jobs = 0

   load printers = Yes

   printcap name = cups

   disable spoolss = No

   enumports command = 

   addprinter command = 

   deleteprinter command = 

   show add printer wizard = Yes

   os2 driver map = 

   strip dot = No

   mangling method = hash

   character set = 

   mangled stack = 50

   stat cache = Yes

   domain admin group = 

   domain guest group = 

   machine password timeout = 604800

   add user script = 

   delete user script = 

   logon script = 

   logon path = \\%N\%U\profile

   logon drive = 

   logon home = \\%N\%U

   domain logons = No

   os level = 20

   lm announce = Auto

   lm interval = 60

   preferred master = Auto

   local master = Yes

   domain master = Auto

   browse list = Yes

   enhanced browsing = Yes

   dns proxy = No

   wins proxy = No

   wins server = 

   wins support = No

   wins hook = 

   kernel oplocks = Yes

   lock spin count = 3

   lock spin time = 10

   oplock break wait time = 0

   add share command = 

   change share command = 

   delete share command = 

   config file = 

   preload = 

   lock dir = /var/cache/samba

   pid directory = /var/run/samba

   utmp directory = 

   wtmp directory = 

   utmp = No

   default service = 

   message command = 

   dfree command = 

   valid chars = 

   remote announce = 

   remote browse sync = 

   socket address = 0.0.0.0

   homedir map = 

   time offset = 0

   NIS homedir = No

   source environment = 

   panic action = 

   hide local users = No

   host msdfs = No

   winbind uid = 

   winbind gid = 

   template homedir = /home/%D/%U

   template shell = /bin/false

   winbind separator = \

   winbind cache time = 15

   winbind enum users = Yes

   winbind enum groups = Yes

   winbind use default domain = No

   comment = 

   path = 

   alternate permissions = No

   username = 

   guest account = nobody

   invalid users = 

   valid users = 

   admin users = 

   read list = 

   write list = 

   printer admin = @adm root

   force user = 

   force group = 

   read only = Yes

   create mask = 0744

   force create mode = 00

   security mask = 0777

   force security mode = 00

   directory mask = 0755

   force directory mode = 00

   directory security mask = 0777

   force directory security mode = 00

   force unknown acl user = 00

   inherit permissions = No

   inherit acls = No

   guest only = No

   guest ok = No

   only user = No

   hosts allow = 

   hosts deny = 

   status = Yes

   nt acl support = Yes

   profile acls = No

   block size = 1024

   max connections = 0

   min print space = 0

   strict allocate = No

   strict sync = No

   sync always = No

   use sendfile = No

   write cache size = 0

   max print jobs = 1000

   printable = No

   postscript = No

   printing = cups

   print command = lpr -r -P%p %s

   lpq command = lpq -P%p

   lprm command = lprm -P%p %j

   lppause command = 

   lpresume command = 

   queuepause command = 

   queueresume command = 

   printer name = 

   use client driver = No

   default devmode = No

   printer driver = 

   printer driver file = /etc/samba/printers.def

   printer driver location = 

   default case = lower

   case sensitive = No

   preserve case = Yes

   short preserve case = Yes

   mangle case = No

   mangling char = ~

   hide dot files = Yes

   hide unreadable = No

   delete veto files = No

   veto files = 

   hide files = 

   veto oplock files = 

   map system = No

   map hidden = No

   map archive = Yes

   mangled names = Yes

   mangled map = 

   browseable = Yes

   blocking locks = Yes

   csc policy = manual

   fake oplocks = No

   locking = Yes

   oplocks = Yes

   level2 oplocks = Yes

   oplock contention limit = 2

   posix locking = Yes

   strict locking = No

   share modes = Yes

   copy = 

   include = 

   exec = 

   preexec close = No

   postexec = 

   root preexec = 

   root preexec close = No

   root postexec = 

   available = Yes

   volume = 

   fstype = NTFS

   set directory = No

   wide links = Yes

   follow symlinks = Yes

   dont descend = 

   magic script = 

   magic output = 

   delete readonly = No

   dos filemode = No

   dos filetimes = No

   dos filetime resolution = No

   fake directory create times = No

   vfs object = 

   vfs options = 

   msdfs root = No

[homes]

   comment = Home Directories

   read only = No

   browseable = No

[printers]

   comment = Printer Drivers

   path = /var/lib/samba/printers

   write list = @adm root

   create mask = 0700

   printable = Yes

   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

   browseable = No

[backup]

   comment = Backup

   path = /opt/backup

   read only = No

   guest ok = Yes

```

I didn't see anything in there that was wrong, but I'm new at this.

Any ideas?

-Marc

----------

## chino_

Man, this one is one hell of an awesome tutorial. Worked out of the box like a charm!

Just set up printserver for linux clients, I will test windows clients tomorrow but I think it will work.

Very nice one !

Thanks a LOT!

----------

## yokem55

Okay, I finally got this working.  Our winxp (the fiance is loathe to give up windows, sigh) laptop now can print to the printer hooked up to the desktop using the autodownloaded cups drivers.  However, whenever I try to go to the printer properties page under windows, I get an ugly error box instead. 

```
Function address 0xa90450e caused a protection fault.  (exception code 0xc0000005) Some or all property page(s) may not be displayed.
```

Some googleing turned up this post in a news group.  Apparently the ppd might be at fault, but my error message does not match this person's while the general symptoms do.  Any advice on solving this one?

----------

## tkdfighter

ok, so now I have installed everything and downloaded the drivers to my winxp machine. I just have one problem: everytime I print something on the windows computer, the printer doesn't do anything. I can see samba working in top but not cups. Could anyone please give me some advise?

BTW: great tutorial!!

----------

## tkdfighter

*bump*

I was looking at the logs today. It's telling me printing/pcap.c:pcap_printer_fn(361)

Unable to open printcap file cups for read!

So now what do I do?

----------

## CB2206

Hi,

thx for this great howto. unfortunately i cannot get the whole thing working. cups is running well and i am able to print from another linux machine. but i have some problems with samba.

when executing 

```
cupsaddsmb -v -a -U root
```

 i get this:

```

Password for root required to access localhost via SAMBA:

Running command: smbclient //localhost/print\$ -N -U'root%XXXX' -c 'mkdir W32X86;put /var/spool/cups/tmp/40b3a0aae9a5c W32X86/HPLaserJet1200.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=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.2a]

tree connect failed: Call returned zero bytes (EOF)

Password for root required to access localhost via SAMBA:

```

what am i doing wrong?

i set a samba password for root and my smb.conf is this:

```

[global]

# Replace MYWORKGROUPNAME with your workgroup/domain

workgroup = WORKGROUP

netbios name = P300

encrypt passwords = no

# Of course this has no REAL purpose other than letting

# everyone know its not Windows!

# %v prints the version of Samba we are using.

server string = CB's fileserver

# We are going to use cups, so we are going to put it in here ;-)

printcap name = cups

printing = cups

load printers = yes

# We want a log file and we do not want it to get bigger than 50kb.

log file = /var/log/samba/log.%m

max log size = 50

# We are going to set some options for our interfaces...

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo br0

bind interfaces only = yes

# Now we are going to specify who we allow, we are afterall

# very security conscience, since this configuration does

# not use passwords!

hosts allow = 127.0.0.1 192.168.0.0/24

hosts deny = 0.0.0.0/0

# Other options for this are USER, DOMAIN, ADS, and SERVER

# The default is user

security = user

# No passwords, so we're going to use a guest account!

guest account = samba

guest ok = yes

# We now will implement the on access virus scanner.

# NOTE: By putting this in our [Global] section, we enable

# scanning of ALL shares, you could optionally move

# these to a specific share and only scan it.

#vfs object = /usr/lib/samba/vfs/vscan-clamav.so

#vfs options = config-file = /etc/samba/vscan-clamav.conf

# Now we setup our print drivers information!

[print$]

comment = Printer Drivers

path = /etc/samba/printer # this path holds the driver structure

guest ok = no

browseable = yes

read only = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

write list = cb,root

# Now we'll setup a printer to share, while the name is arbitrary

# it should be consistent throughout Samba and CUPS!

[HPLaserJet1200]

comment = HP LaserJet 1200 Network Printer

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = cb,root

# Now we setup our printers share.  This should be

# browseable, printable, public.

[printers]

comment = All Printers

browseable = yes

printable = yes

public = yes

guest ok = yes

path = /var/spool/samba

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = cb,root

# We create a new share that we can read/write to from anywhere

# This is kind of like a public temp share, anyone can do what

# they want here.

[upload]

comment = Upload

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /share/upload

```

thx for help!

----------

## KShots

Hey, great stuff!

Going from linux->linux, I got it to work fine (via samba)... the on the client side, cups shows no printers (lpr works fine with .ps files). I figure I could work with this, and moved over to my windows computer.

Here's where I encountered the problem - when I did the windows driver portion, I ran the script, it gave me no errors, I thought life was good and continued on. Now on Windows, it says *Quote:*   

> The server for the printer does not have the correct printer driver installed. If you want to search for the proper driver, click OK. Otherwise, click Cancel and contact your network administrator or original equipment manufacturer for the correct printer driver

 I believe I followed the instructions pretty well... I also symlinked where the drivers are installed (/usr/share/cups/driver) to /etc/samba/printer hoping that would kick-start the process (from the [print$] entry in smb.conf). No dice. Any idea where to start?

----------

## tkdfighter

Yeah, I had the same problem. Check if it installed the drivers correctly and if you installed them with security = user. If that worked, check out the access rights. If that doesn't work, I can post you my now working smb.conf file.

----------

## tkdfighter

Now if anybody could see what's up with the printer properties under Windows and get a fix, it'd be cool.

----------

## haven

Here's whats up with the windows property box:

http://www.cups.org/str.php?L488+P0+S-2+C0+I0+E0+QWindows+driver

I came a cropper on that one too. Now waiting for cups-samba 6.0rc1 to be released which will hopefully fix the problems. In the meantime I'm off to try the adobe drivers instead.

 *Quote:*   

> Everyone - we've dumped the 5.0 code (it is a modified version of the NT PostScript driver) and are going to release a 6.0rc1 in a few weeks that is based on the Win2k PS driver instead.  We've wanted to move to the new driver for a long time now anyways, and since MS won't support the NT driver code anymore and since we can't track the problem down (only crashes outside the debugger, and there is no way to do a post mortem of the application or UI component...) we are "cutting our losses" and focusing exclusively on the (modular) Win2k driver.

 

Regards

----------

## fatboyjim

I get the same problem, with the properties box, both from within Printers and Faxes and from other problems

However, I can't actually print from windows either. On the gentoo server the printer works fine (to print local files)

Windows seems to be giving generic error messages

 *Outlook wrote:*   

>  There was an error when printing started

 

 *Notepad wrote:*   

>  Please ensure your printer is connected properly

 

It can see the printer however, because it downloaded the drivers for it from the gentoo machine earlier

Sob

Jim

----------

## fatboyjim

Any tips at all? I'm sure I've followed all of the instructions to the letter but if there's anything I can paste here to help you to help me I'd gladly do it  :Neutral: 

Thanks again

Jim

----------

## daff

You could start by posting the relevant parts of your CUPS error log (/var/log/cups/error_log), i.e. the last 30 lines or so, and if that doesn't show much, try increasing the LogLevel in cupsd.conf and then print again. Windows error messages usually don't provide much help or insight.

Apart from that, are you sure you installed the Windows drivers correctly? No NT_OBJECT_NAME_COLLISION, no NT_NETWORK_NAME_NOT_FOUND, no NT_I_HATE_LINUX_SO_I_WONT_WORK, or anything like it when running cupsaddsmb? You could post the output of that command, too. 

Windows being able to see the printer doesn't mean it downloaded or found the drivers correctly, mind you. That usually just means that at least Samba is configured with a working print$ and PrinterName share.

Just guessing wildly here, please post the log and the output of cupsaddsmb.

----------

## fatboyjim

```
I [10/Jul/2004:23:46:00 +0000] Listening to 0:631

I [10/Jul/2004:23:46:00 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [10/Jul/2004:23:46:00 +0000] Configured for up to 100 clients.

I [10/Jul/2004:23:46:00 +0000] Allowing up to 100 client connections per host.

I [10/Jul/2004:23:46:00 +0000] Full reload is required.

I [10/Jul/2004:23:46:22 +0000] LoadPPDs: Wrote "/etc/cups/ppds.dat", 1895 PPDs...

I [10/Jul/2004:23:46:22 +0000] Full reload complete.

I [10/Jul/2004:23:46:59 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=7306)

I [10/Jul/2004:23:47:11 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=7307)

I [10/Jul/2004:23:52:50 +0000] Setting queue printer-is-accepting-jobs to 1 (was 0.)

I [10/Jul/2004:23:52:50 +0000] Setting queue printer-state to 3 (was 5.)

I [10/Jul/2004:23:52:50 +0000] Saving printers.conf...

I [10/Jul/2004:23:52:50 +0000] New printer 'queue' added by 'root'.

I [10/Jul/2004:23:52:50 +0000] Saving printers.conf...

I [10/Jul/2004:23:52:50 +0000] Printer 'queue' modified by 'root'.

I [10/Jul/2004:23:52:50 +0000] Saving printers.conf...

I [10/Jul/2004:23:52:50 +0000] Printer 'queue' modified by 'root'.

I [10/Jul/2004:23:52:50 +0000] Setting queue device-uri to "usb://3550" (was "file:/dev/null".)

I [10/Jul/2004:23:52:50 +0000] Saving printers.conf...

I [10/Jul/2004:23:52:50 +0000] Printer 'queue' modified by 'root'.

I [10/Jul/2004:23:53:17 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=7459)

I [10/Jul/2004:23:53:24 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=7461)

I [10/Jul/2004:23:53:24 +0000] Adding start banner page "none" to job 1.

I [10/Jul/2004:23:53:24 +0000] Adding end banner page "none" to job 1.

I [10/Jul/2004:23:53:24 +0000] Job 1 queued on 'queue' by ''.

I [10/Jul/2004:23:53:24 +0000] Started filter /usr/lib/cups/filter/pstops (PID 7462) for job 1.

I [10/Jul/2004:23:53:24 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 7463) for job 1.

I [10/Jul/2004:23:53:24 +0000] Started backend /usr/lib/cups/backend/usb (PID 7464) for job 1.

W [10/Jul/2004:23:53:25 +0000] [Job 1] Media tray empty!

I [10/Jul/2004:23:53:37 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=7472)

E [11/Jul/2004:00:09:34 +0000] get_printer_attrs: resource name '/printers/::{2227a280-3aea-1069-a2de-08002b30309d}' no good!

E [11/Jul/2004:00:19:34 +0000] get_printer_attrs: resource name '/printers/PrintServer' no good!

E [11/Jul/2004:00:22:13 +0000] get_printer_attrs: resource name '/printers/PrintServer' no good!

E [11/Jul/2004:00:23:02 +0000] get_printer_attrs: resource name '/printers/localhost' no good!

E [11/Jul/2004:10:49:35 +0000] get_printer_attrs: resource name '/printers/::{2227a280-3aea-1069-a2de-08002b30309d}' no good!

E [11/Jul/2004:11:14:36 +0000] get_printer_attrs: resource name '/printers/::{2227a280-3aea-1069-a2de-08002b30309d}' no good!

I [11/Jul/2004:11:15:14 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=20446)

I [11/Jul/2004:11:15:29 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=20447)

I [11/Jul/2004:11:15:41 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=20449)

I [11/Jul/2004:11:15:41 +0000] Saving printers.conf...

I [11/Jul/2004:11:15:41 +0000] Printer 'queue' modified by 'root'.

I [11/Jul/2004:11:15:43 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=20450)

I [11/Jul/2004:11:15:46 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=20451)

I [11/Jul/2004:11:15:50 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=20452)

I [11/Jul/2004:11:15:55 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=20453)

I [11/Jul/2004:11:16:14 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=20455)

I [11/Jul/2004:11:16:21 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=20456)

I [11/Jul/2004:11:43:55 +0000] Scheduler shutting down normally.

I [11/Jul/2004:11:44:00 +0000] Listening to 0:631

I [11/Jul/2004:11:44:00 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [11/Jul/2004:11:44:00 +0000] Configured for up to 100 clients.

I [11/Jul/2004:11:44:00 +0000] Allowing up to 100 client connections per host.

I [11/Jul/2004:11:44:00 +0000] Full reload is required.

I [11/Jul/2004:11:44:01 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [11/Jul/2004:11:44:01 +0000] LoadPPDs: Wrote "/etc/cups/ppds.dat", 1895 PPDs...

I [11/Jul/2004:11:44:01 +0000] Full reload complete.

E [11/Jul/2004:11:44:17 +0000] StartListening: Unable to find IP address for server name "PrintServer" - Host name lookup failure

I [11/Jul/2004:12:02:32 +0000] Setting HP-DeskJet_3550 printer-is-accepting-jobs to 1 (was 0.)

I [11/Jul/2004:12:02:32 +0000] Setting HP-DeskJet_3550 printer-state to 3 (was 5.)

I [11/Jul/2004:12:02:32 +0000] Saving printers.conf...

I [11/Jul/2004:12:02:32 +0000] New printer 'HP-DeskJet_3550' added by 'root'.

I [11/Jul/2004:12:02:32 +0000] Saving printers.conf...

I [11/Jul/2004:12:02:32 +0000] Printer 'HP-DeskJet_3550' modified by 'root'.

I [11/Jul/2004:12:02:32 +0000] Saving printers.conf...

I [11/Jul/2004:12:02:32 +0000] Printer 'HP-DeskJet_3550' modified by 'root'.

I [11/Jul/2004:12:02:32 +0000] Setting HP-DeskJet_3550 device-uri to "usb://3550" (was "file:/dev/null".)

I [11/Jul/2004:12:02:32 +0000] Saving printers.conf...

I [11/Jul/2004:12:02:32 +0000] Printer 'HP-DeskJet_3550' modified by 'root'.

I [11/Jul/2004:12:02:44 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=21320)

I [11/Jul/2004:12:02:57 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=21321)

I [11/Jul/2004:12:02:59 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=21322)

I [11/Jul/2004:12:03:00 +0000] Printer 'queue' deleted by 'root'.

I [11/Jul/2004:12:03:00 +0000] Saving printers.conf...

I [11/Jul/2004:12:03:03 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=21323)

I [11/Jul/2004:12:03:31 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=21324)

I [11/Jul/2004:12:03:33 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=21325)

I [11/Jul/2004:12:03:37 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=21326)

I [11/Jul/2004:12:03:56 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=21367)

I [11/Jul/2004:12:06:04 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=21369)

I [11/Jul/2004:12:26:39 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=26998)

I [11/Jul/2004:14:30:43 +0000] Scheduler shutting down normally.

I [11/Jul/2004:14:54:47 +0000] Listening to 0:631

I [11/Jul/2004:14:54:47 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [11/Jul/2004:14:54:47 +0000] Configured for up to 100 clients.

I [11/Jul/2004:14:54:47 +0000] Allowing up to 100 client connections per host.

I [11/Jul/2004:14:54:47 +0000] Full reload is required.

I [11/Jul/2004:14:54:50 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [11/Jul/2004:14:54:54 +0000] LoadPPDs: No new or changed PPDs...

I [11/Jul/2004:14:54:54 +0000] Full reload complete.

E [11/Jul/2004:14:55:02 +0000] StartListening: Unable to find IP address for server name "PrintServer" - Host name lookup failure

I [11/Jul/2004:16:31:25 +0000] Scheduler shutting down normally.

I [11/Jul/2004:16:31:26 +0000] Listening to 0:631

I [11/Jul/2004:16:31:26 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [11/Jul/2004:16:31:26 +0000] Configured for up to 100 clients.

I [11/Jul/2004:16:31:26 +0000] Allowing up to 100 client connections per host.

I [11/Jul/2004:16:31:26 +0000] Full reload is required.

I [11/Jul/2004:16:31:27 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [11/Jul/2004:16:31:27 +0000] LoadPPDs: No new or changed PPDs...

I [11/Jul/2004:16:31:27 +0000] Full reload complete.

E [11/Jul/2004:16:34:41 +0000] get_jobs: resource name '/printers/HPDeskJet3550' no good!

I [11/Jul/2004:16:37:19 +0000] Setting HPDeskJet3550 printer-is-accepting-jobs to 1 (was 0.)

I [11/Jul/2004:16:37:19 +0000] Setting HPDeskJet3550 printer-state to 3 (was 5.)

I [11/Jul/2004:16:37:19 +0000] Saving printers.conf...

I [11/Jul/2004:16:37:19 +0000] New printer 'HPDeskJet3550' added by 'root'.

I [11/Jul/2004:16:37:19 +0000] Setting HPDeskJet3550 device-uri to "usb:/dev/usb/lp0" (was "file:/dev/null".)

I [11/Jul/2004:16:37:19 +0000] Saving printers.conf...

I [11/Jul/2004:16:37:19 +0000] Printer 'HPDeskJet3550' modified by 'root'.

I [11/Jul/2004:16:37:19 +0000] Saving printers.conf...

I [11/Jul/2004:16:37:19 +0000] Printer 'HPDeskJet3550' modified by 'root'.

I [11/Jul/2004:16:38:35 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=6966)

I [11/Jul/2004:16:38:46 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=6967)

I [11/Jul/2004:16:38:47 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=6968)

I [11/Jul/2004:16:38:49 +0000] Printer 'HP-DeskJet_3550' deleted by 'root'.

I [11/Jul/2004:16:38:49 +0000] Saving printers.conf...

I [11/Jul/2004:16:38:50 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=6969)

I [11/Jul/2004:16:38:56 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=6970)

I [11/Jul/2004:16:38:56 +0000] Adding start banner page "none" to job 1.

I [11/Jul/2004:16:38:56 +0000] Adding end banner page "none" to job 1.

I [11/Jul/2004:16:38:56 +0000] Job 1 queued on 'HPDeskJet3550' by ''.

I [11/Jul/2004:16:38:56 +0000] Started filter /usr/lib/cups/filter/pstops (PID 6971) for job 1.

I [11/Jul/2004:16:38:56 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 6972) for job 1.

I [11/Jul/2004:16:38:56 +0000] Started backend /usr/lib/cups/backend/usb (PID 6973) for job 1.

W [11/Jul/2004:16:38:56 +0000] [Job 1] Media tray empty!

I [11/Jul/2004:16:39:07 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=6981)

I [11/Jul/2004:16:51:30 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=7208)

I [11/Jul/2004:16:52:38 +0000] Adding start banner page "none" to job 2.

I [11/Jul/2004:16:52:38 +0000] Adding end banner page "none" to job 2.

I [11/Jul/2004:16:52:38 +0000] Job 2 queued on 'HPDeskJet3550' by 'root'.

I [11/Jul/2004:16:52:38 +0000] Started filter /usr/lib/cups/filter/pstops (PID 7218) for job 2.

I [11/Jul/2004:16:52:38 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 7219) for job 2.

I [11/Jul/2004:16:52:38 +0000] Started backend /usr/lib/cups/backend/usb (PID 7220) for job 2.

W [11/Jul/2004:16:52:38 +0000] [Job 2] Media tray empty!

I [11/Jul/2004:21:48:58 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=22145)

I [11/Jul/2004:21:49:04 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=22148)

I [11/Jul/2004:21:49:06 +0000] Saving printers.conf...

I [11/Jul/2004:21:49:06 +0000] Printer 'HPDeskJet3550' modified by 'root'.

I [11/Jul/2004:21:49:07 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=22149)

I [11/Jul/2004:21:49:12 +0000] Started "/usr/lib/cups/cgi-bin/printers.cgi" (pid=22150)

I [11/Jul/2004:21:49:22 +0000] Started "/usr/lib/cups/cgi-bin/jobs.cgi" (pid=22151)

E [11/Jul/2004:21:49:23 +0000] restart_job: job #2 cannot be restarted - no files!

I [11/Jul/2004:21:49:27 +0000] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=22152)

I [11/Jul/2004:22:34:43 +0000] Scheduler shutting down normally.

I [12/Jul/2004:08:35:46 +0000] Listening to 0:631

I [12/Jul/2004:08:35:46 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [12/Jul/2004:08:35:46 +0000] Configured for up to 100 clients.

I [12/Jul/2004:08:35:46 +0000] Allowing up to 100 client connections per host.

I [12/Jul/2004:08:35:46 +0000] Full reload is required.

I [12/Jul/2004:08:35:49 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [12/Jul/2004:08:35:53 +0000] LoadPPDs: Wrote "/etc/cups/ppds.dat", 1895 PPDs...

I [12/Jul/2004:08:35:53 +0000] Full reload complete.

I [13/Jul/2004:17:45:11 +0000] Adding start banner page "none" to job 3.

I [13/Jul/2004:17:45:11 +0000] Adding end banner page "none" to job 3.

I [13/Jul/2004:17:45:11 +0000] Job 3 queued on 'HPDeskJet3550' by 'root'.

I [13/Jul/2004:17:45:11 +0000] Started filter /usr/lib/cups/filter/pstops (PID 19748) for job 3.

I [13/Jul/2004:17:45:11 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 19749) for job 3.

I [13/Jul/2004:17:45:11 +0000] Started backend /usr/lib/cups/backend/usb (PID 19750) for job 3.

W [13/Jul/2004:17:45:11 +0000] [Job 3] Media tray empty!

I [13/Jul/2004:17:46:45 +0000] Adding start banner page "none" to job 4.

I [13/Jul/2004:17:46:45 +0000] Adding end banner page "none" to job 4.

I [13/Jul/2004:17:46:45 +0000] Job 4 queued on 'HPDeskJet3550' by 'root'.

I [13/Jul/2004:17:46:45 +0000] Started filter /usr/lib/cups/filter/pstops (PID 19776) for job 4.

I [13/Jul/2004:17:46:45 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 19777) for job 4.

I [13/Jul/2004:17:46:45 +0000] Started backend /usr/lib/cups/backend/usb (PID 19778) for job 4.

W [13/Jul/2004:17:46:45 +0000] [Job 4] Media tray empty!

I [13/Jul/2004:17:49:45 +0000] Adding start banner page "none" to job 5.

I [13/Jul/2004:17:49:45 +0000] Adding end banner page "none" to job 5.

I [13/Jul/2004:17:49:45 +0000] Job 5 queued on 'HPDeskJet3550' by 'root'.

I [13/Jul/2004:17:49:45 +0000] Started filter /usr/lib/cups/filter/pstops (PID 19815) for job 5.

I [13/Jul/2004:17:49:45 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 19816) for job 5.

I [13/Jul/2004:17:49:45 +0000] Started backend /usr/lib/cups/backend/usb (PID 19817) for job 5.

W [13/Jul/2004:17:49:45 +0000] [Job 5] Media tray empty!

I [14/Jul/2004:09:58:47 +0000] Adding start banner page "none" to job 6.

I [14/Jul/2004:09:58:47 +0000] Adding end banner page "none" to job 6.

I [14/Jul/2004:09:58:47 +0000] Job 6 queued on 'HPDeskJet3550' by 'root'.

I [14/Jul/2004:09:58:47 +0000] Started filter /usr/lib/cups/filter/pstops (PID 2419) for job 6.

I [14/Jul/2004:09:58:47 +0000] Started filter /usr/lib/cups/filter/foomatic-rip (PID 2420) for job 6.

I [14/Jul/2004:09:58:47 +0000] Started backend /usr/lib/cups/backend/usb (PID 2421) for job 6.

W [14/Jul/2004:09:58:47 +0000] [Job 6] Media tray empty!

I [14/Jul/2004:20:23:23 +0000] Scheduler shutting down normally.

I [15/Jul/2004:01:41:07 +0000] Listening to 0:631

I [15/Jul/2004:01:41:07 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [15/Jul/2004:01:41:07 +0000] Configured for up to 100 clients.

I [15/Jul/2004:01:41:07 +0000] Allowing up to 100 client connections per host.

I [15/Jul/2004:01:41:07 +0000] Full reload is required.

I [15/Jul/2004:01:41:10 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [15/Jul/2004:01:41:14 +0000] LoadPPDs: No new or changed PPDs...

I [15/Jul/2004:01:41:14 +0000] Full reload complete.

I [15/Jul/2004:02:12:40 +0000] Scheduler shutting down normally.

I [17/Jul/2004:18:28:34 +0000] Listening to 0:631

I [17/Jul/2004:18:28:34 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [17/Jul/2004:18:28:34 +0000] Configured for up to 100 clients.

I [17/Jul/2004:18:28:34 +0000] Allowing up to 100 client connections per host.

I [17/Jul/2004:18:28:34 +0000] Full reload is required.

I [17/Jul/2004:18:28:37 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [17/Jul/2004:18:28:41 +0000] LoadPPDs: No new or changed PPDs...

I [17/Jul/2004:18:28:41 +0000] Full reload complete.

I [18/Jul/2004:02:43:22 +0000] Scheduler shutting down normally.

I [18/Jul/2004:10:07:47 +0000] Listening to 0:631

I [18/Jul/2004:10:07:47 +0000] Loaded configuration file "/etc/cups/cupsd.conf"

I [18/Jul/2004:10:07:47 +0000] Configured for up to 100 clients.

I [18/Jul/2004:10:07:47 +0000] Allowing up to 100 client connections per host.

I [18/Jul/2004:10:07:47 +0000] Full reload is required.

I [18/Jul/2004:10:07:50 +0000] LoadPPDs: Read "/etc/cups/ppds.dat", 1895 PPDs...

I [18/Jul/2004:10:07:54 +0000] LoadPPDs: No new or changed PPDs...

I [18/Jul/2004:10:07:54 +0000] Full reload complete.

E [19/Jul/2004:00:12:12 +0000] get_printer_attrs: resource name '/printers/var' no good!

E [19/Jul/2004:00:12:13 +0000] get_printer_attrs: resource name '/printers/var' no good!

E [19/Jul/2004:00:12:14 +0000] get_printer_attrs: resource name '/printers/var' no good!

E [19/Jul/2004:00:12:14 +0000] get_printer_attrs: resource name '/printers/var' no good!

E [19/Jul/2004:00:12:15 +0000] get_printer_attrs: resource name '/printers/var' no good!

E [19/Jul/2004:00:12:16 +0000] get_printer_attrs: resource name '/printers/var' no good!

```

I was a bit of an idiot at the start and added a printer called "Queue"  :Very Happy: 

cupsaddsmb gives no output

Jim[/code]

----------

## jeffrice

OK everybody seemed happy... printing from linux to my Samsung ML1710 works great and most printing from Windows works... except PDFs!  Only the first page that is sent gets printed... I can print the whole doc from Linux OR print it page-by-page in Windows... printing to another printer (different server) works, so I think it is the samba/cupsd somewhere.  

Any tips on where I should start troubleshooting this?

Jeff

----------

## daff

 *fatboyjim wrote:*   

> 
> 
> ```
> 
> ...snip...
> ...

 

Well from looking at that log output I see at least 4 different entries marked with an E (the first character on the line), and also some with a W

 *Quote:*   

> StartListening: Unable to find IP address for server name "PrintServer" - Host name lookup failure

 

Is your printer server really called that? Do you have the correct entries in your DNS configuration or in /etc/hosts? 

I see a lot of references to /printer and /printer/var, do these directories exist? Permissions ok?

Empty media tray? 

/printer/HPDeskJet3550 seems to be "no good", why would this be? See the second entry in this list regarding the /printer directory.

Seems you have a bit of a mess in there, and the fact that cupsaddsmbd did not produce any output should worry you, shouln't it? 

I'd start over and really follow the guide step by step, but not blindly and to the letter, because you'll have to make substitutions for things like PrintServer and the like. Also read through the other posts in this thread, maybe you'll see some information that's interesting for you.

Please do also post your smb.conf entries for [print$], [HPDeskJet3550] and [printers].

----------

## daff

 *jeffrice wrote:*   

> OK everybody seemed happy... printing from linux to my Samsung ML1710 works great and most printing from Windows works... except PDFs!  Only the first page that is sent gets printed... I can print the whole doc from Linux OR print it page-by-page in Windows... printing to another printer (different server) works, so I think it is the samba/cupsd somewhere.  
> 
> Any tips on where I should start troubleshooting this?
> 
> 

 

I think I had that problem once, too. Unfortunately I don't remember how I solved it, but it might help to delete the printer driver on the Windows machine and re-add it by connecting to the printer on the printserver again.

Are you sure you are using the correct driver for your printer? And the correct CUPS-Samba-Windows drivers?

You should also follow your log files (/var/log/cups/error_log) with tail -f when printing a PDF from Windows, maybe you'll notice something wrong.

I'm afraid I can't help more on that problem, I know it drove me crazy some time ago. 

Maybe someone else?

----------

## pubecon

I had an unrelated pdf problem where the printer itself was complaining about instructions being sent to it. 

The solution was to check the "print as image" box in the adobe acrobat print dialogue.

I know this is completely unrelated but sometimes it is nice for a random suggestion work and not ever have to care why than have to learn the core of a topic just to comprehend such a one-off problem. 

surely it isn't something as simple as "Print Page 1 to 1"?!

----------

## Benji-Boy

Hey guys,

Thanks for the great tutorial so far. Learning.

Ok. I am tryin to print from my linux box to a network print server called printserv on a HP LaserJet 4300 called hp228. (it's in room 228   :Laughing:  )

Thus far I have Samba and cups installed and they're running.

I have downloaded the correct .ppd file and put it in the right place.

I have also made sure the smb backend is running alright in the logs etc.

Now. I am running KDE so i did most of the server configuration through the settings-print manager.

Server config:

I set the name of the host to my 'computer_name', also tried 'localhost' and '127.0.0.1'.

Printer:

add printer/class

I can browse and find the workgroup/host/name

in this specific case it is

CS-NT

printserv

hp228

(i can also ping them FYI)

However... when i go to print a test page it says that the test page has been set and is printing successfully.

However in the "jobs" for the newly added printer it tells me that the job was aborted-by-system.

I had a look in the error_lod file and it is having trouble resolving the host name. this happens with my_computer_name, localhost, 127.0.0.1, the IP of the network printer also.

I have successfully printed using:

```

smbclient //printserv/hp228 -I IP.AD.DR.ESS -N -c 'print <filename>.ps'

```

I'd really like to get this sorted out soon as i have yet to tackel gettin Open office and other apps to print using this printer.

Any assistance is greatly appreciated.

Thanks in advance,

Benji-Boy

I am happy to post any logs, configs etc

----------

## daff

Benji-Boy: I am not exactly sure what you are trying to do. Print from a Linux client to a Linux (print)server? Print from a Linux client to a Windows (print)server? What do you mean by "network print server"? One of those small devices with an ethernet and a parallel port?

If it's Linux --> Linux printing you don't need Samba, only working CUPS installations on both machines. The server needs to be configured correctly (see the how-to), the client doesn't really need any special attention. You would simply print by using lpr -Pprintername

If it's Linux --> Windows printing then I am sorry, but I am not very familiar with that and as you can see I didn't cover it in the guide.

Ditto for the third possibility with the network print server device.

If none of these is the case please explain your setup and your environment. 

Anyway, make sure your DNS entries are correct or your /etc/hosts files on the printer server and on the client contain at least these lines:

127.0.0.1 localhost

AA.BB.CC.DD local_machine_name

----------

## Benji-Boy

Daff: Sorry I put the goal in the subject line but I should have been more clear.

I know you didn't cover it in the guide but hey, I know you're a clever guy so i had a stab at asking on this thread.

Thanks for you help.

This guide worked beautifully for printers that are physically attached to the machine operating as the printserver listenining for connections on port 631.

However my goall in short is:

To run a CUPS server on my linux box which listens for local jobs (essentially printing open office docs and pdf files etc) then prints the postscript file to a remote windows print queue (via samba backend) located on a LAN hosted by a machine called 'printserv' which controlls a HP LaserJet 4300 called hp228 (among other printers). 

clearer? :Laughing: 

Which according to the error logs it is having trouble resolving:

```

E [23/Jul/2004:19:24:40 +1000] httpGetHostByName("//printserv/hp228") failed - Unknown host!

E [23/Jul/2004:19:24:40 +1000] Bad BrowseAddress //printserv/hp228 at line 736.

```

What do the letters down the left hand side of the error logs stand for.

I set the logs to debug detailed. (and yes there is a lot of stuff which is much more helpful than before.)

Yes DNS is all working fine.

I can 'ping' both printserv and hp228.

here is /etc/hosts

```

127.0.0.1       localhost

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

So according to your suggestion I'll add MY_CLIENT_MACHINE_IP and Client_machine_name on the second line.

Additional info:

I can select and configure the printer by scanning the network using KDE Printer Manager and the online admin. So CUPS CAN _find_ the printer. I can go through the wizard but, no test page print results.

According to the local CUPS Job manager the system aborts the jobs both as a regular user and root. (which makes perfect sense if it can't resolve the printer address.)

I'll try putting the IP of the printserver and the printserv name in /etc/hosts too.

I think you have solved at least part of the problem. I'll let you know monday after i have along chat with sys admin about host resolution.

Thanks heaps Daff.  :Very Happy: 

Benji-Boy

----------

## Benji-Boy

Ok fixed the first problem.

I added the local hosts and the printserver host to /etc/hosts

The following is Debug level errorlog with some irrelevant bits snipped.

```

I [24/Jul/2004:13:24:08 +1000] Job 11 queued on 'hp228' by 'root'.

D  StartJob() id = 11, file = 0/1

D  StartJob: argv = "hp228","11","root","KDE Print Test","1","m

ultiple-document-handling=separate-documents-uncollated-copies orientation-requested=3","/v

ar/spool/cups/d00011-001"

D  StartJob: envp[0]="PATH=/usr/lib/cups/filter:/bin:/usr/bin"

D  StartJob: envp[2]="USER=root"

D  StartJob: envp[5]="PPD=/etc/cups/ppd/hp228.ppd"

----------------------

*This is the ppd generated by printer configuration from */usr/share/cups/model/HP-LaserJet_4300-Postscript.ppd

--------------------------

D  StartJob: envp[9]="CONTENT_TYPE=application/postscript"

D  StartJob: envp[10]="DEVICE_URI=smb://CS-NT/PRINTSERV/hp228"

D StartJob: envp[11]="PRINTER=hp228"

D StartJob: envp[14]="CUPS_SERVER=localhost"

D StartJob: envp[15]="IPP_PORT=631"

D [24/Jul/2004:13:24:08 +1000] StartJob: statusfds = [ 8 9 ]

D [24/Jul/2004:13:24:08 +1000] StartJob: filterfds[1] = [ 10 -1 ]

I Started filter /usr/lib/cups/filter/pstops (PID 24130) for job 11.

I Started filter /usr/lib/cups/filter/foomatic-rip (PID 24131) for job 11.

I Started backend /usr/lib/cups/backend/smb (PID 24132) for job 11.

E PID 24131 stopped with status 22!

D [Job 11] /usr/lib/cups/filter/foomatic-rip: No such file or directory

D [24/Jul/2004:13:24:08 +1000] CloseClient() 7

--------------------

*The log described the resuming listening to the client sendin in the test page

---------------------

D  [Job 11] 0 %%EOF

D  [Job 11] Saw EOF!

D  UpdateJob: job 11, file 0 is complete.

D  CancelJob: id = 11

D  StopJob: id = 11, force = 0

D  StopJob: printer state is 3

D  AcceptClient() 7 from localhost:631.

```

What i dont understand is why is it trying to use foomatic (PID 24131). I haven't got it emerged on my system. 

Samba should be fine (PID 24132) Yet this PID never terminates.

Any ideas on how to prevent foomatic from trying to run? 

It seems to be stuffing things up is this true?

I'll try installing foomatic and configuring that but it really shouldn't be necessary according to the linux.org howtopage.

Is there something i am missing in the configuration process to prevent the launch of foomatic?

Is foomatic even the issue here?

I am very new to these kinds of forums and I'm unsure of etiquette etc. 

Please let me know.

Benji-Boy

----------

## matbouch

 *yokem55 wrote:*   

> Okay, I finally got this working.  Our winxp (the fiance is loathe to give up windows, sigh) laptop now can print to the printer hooked up to the desktop using the autodownloaded cups drivers.  However, whenever I try to go to the printer properties page under windows, I get an ugly error box instead. 
> 
> ```
> Function address 0xa90450e caused a protection fault.  (exception code 0xc0000005) Some or all property page(s) may not be displayed.
> ```
> ...

 

I don't know if somebody has found a better solution for this problem, but here is what I did to solve it :

I found the following informations here : http://www.linuxprinting.org/kpfeifle/SambaPrintHOWTO/Samba-HOWTO-Collection-3.0-PrintingChapter-11th-draft.html

 *Quote:*   

> 6.8.2. IMPORTANT! Setting Device Modes on new Printers
> 
> In order for a printer to be truly usable by a Windows NT/2K/XP client, it must possess:
> 
>     * a valid Device Mode generated by the driver for the printer (defining things like paper size, orientation and duplex settings), and
> ...

 

The error comes from the bad settings in samba with some printer models.   What I did to solve this problem : 

1 - Added one of my windows users as printer admin and in the write list of print$ share

2 - Commented the print$ share in smb.conf

3 - Connected to the printer and installing the clients drivers (not the ones from the samba server)

4 - Uncommented the print$ share and restarted samba

5 - Opened the default settings, changed the paper to landscape and saved

6 - uninstalled the printer on the windows client and reconnected with the samba drivers

I can now open the printer properties with any windows clients.

----------

## goulash

huge thanks for this, even thought i havent read it yet  :Wink: 

im planning to move my high schools(im the it tech) print server over to gentoo, the win2k3 server needs to be reset every 3days and its annoying  :Sad: 

----------

## newbie_gentoo

[EDITED - SOLVED MOST OF THE ISSUES]

Hello. I edited this because I solved some of the isues. Right now I am stuck at the 'cupsaddsmb' command.

when I type:

```

cupsaddsmb -H [color=red]my_print_server[/color] -U [color=red]my_print_server[/color] -h keg -v -a

```

i get this error:

```

Password for root required to access keg via SAMBA:

Running command: smbclient //keg/print\$ -N -U'root%PASSWD' -c 'mkdir W32X86;put /var/spool/cups/tmp/41144f605c74a W32X86/HP840C.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=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.5]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

```

my smb.conf is this:

```
[global]

# Replace MYWORKGROUPNAME with your workgroup/domain

workgroup = WORKGROUP

# Of course this has no REAL purpose other than letting

# everyone know its not Windows!

# %v prints the version of Samba we are using.

server string = Samba Server %v

# We are going to use cups, so we are going to put it in here ;-)

printcap name = cups

printing = cups

load printers = yes

# We want a log file and we do not want it to get bigger than 50kb.

log file = /var/log/samba/log.%m

max log size = 50

# We are going to set some options for our interfaces...

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo eth0

bind interfaces only = yes

# Now we are going to specify who we allow, we are afterall

# very security conscience, since this configuration does

# not use passwords!

hosts allow = 127.0.0.1 10.10.10.

hosts deny = 0.0.0.0/0

# Other options for this are USER, DOMAIN, ADS, and SERVER

# The default is user

security = share

# No passwords, so we're going to use a guest account!

guest account = samba

guest ok = yes

# We now will implement the on access virus scanner.

# NOTE: By putting this in our [Global] section, we enable

# scanning of ALL shares, you could optionally move

# these to a specific share and only scan it.

# For Samba 3.x

;fs object = vscan-clamav

;scan-clamav: config-file = /etc/samba/vscan-clamav.conf

# For Samba 2.2.x

;fs object = /usr/lib/samba/vfs/vscan-clamav.so

;fs options = config-file = /etc/samba/vscan-clamav.conf

# Now we setup our print drivers information!

[print$]

comment = Printer Drivers

path = /etc/samba/printer # this path holds the driver structure

guest ok = no

browseable = yes

read only = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

write list = root

# Now we'll setup a printer to share, while the name is arbitrary

# it should be consistent throughout Samba and CUPS!

[HP840C]

comment = HP DeskJet 840C Network Printer

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

# Now we setup our printers share.  This should be

# browseable, printable, public.

[printers]   

comment = All Printers

browseable = yes   

printable = yes   

public = yes   

guest ok = yes

path = /var/spool/samba

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

# We create a new share that we can read/write to from anywhere

# This is kind of like a public temp share, anyone can do what

# they want here.

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/dcorujo/share

[Musica]

comment = Music Files

browseable = yes

public = yes

writable = no

printable = no

path = /mnt/fat32/Musica/

[MCP2K4]

comment = Minho Campus Party 2k4

browseable = yes

public = yes

writable = no

printable = no

path = /mnt/windows/Documents\ and\ Settings/Daniel/Desktop/mcp2k4/

```

Anyone can help? 

P.S. - I also noticed that on most of the people posting here, they would get on their cupsaddsmb output something about

```
added interface ip=192.168.0.133 bcast=192.168.0.255 nmask=255.255.255.0 
```

I'm not getting it... am I doing something wrong?

Thanks for reading and... please help!!!

----------

## goulash

for our windows print server we use a program called papercut which gives the students printing accounts with a certain ammount of money they get to print with. they can top it up and things like that. i was wondering if anyone would know of a similar program for linux?

----------

## daff

 *newbie_gentoo wrote:*   

> 
> 
> Right now I am stuck at the 'cupsaddsmb' command.
> 
> when I type:
> ...

 

This doesn't look right. The syntax is

```

# cupsaddsmb -H printerserver -h sambaserver -U root -v [-a]

```

printerserver == sambaserver almost always, so the command line should read

```

# cupsaddsmb -H keg -h keg -U root -v -a

```

in your case.

Instead of root you can also use a valid user that has the permissions to admin the printer. You probably don't have one and should use root for that task anyway.

HTH

----------

## daff

Benji-Boy: I am not really familiar with printing from CUPS/Samba to Windows servers, can't really help you on that (the other way round works much smoother IMHO  :Smile: )

 *Benji-Boy wrote:*   

> Ok fixed the first problem.
> 
> I added the local hosts and the printserver host to /etc/hosts
> 
> The following is Debug level errorlog with some irrelevant bits snipped.
> ...

 

Maybe you should emerge it, see what happens? 

CUPS likes Foomatic, it is a very universal filter script. It should be present I think, especially if you use a PPD from linuxprinting.org or anything other than gimp-print or the example drivers from CUPS. Plus it doesn't hurt, it helps!

----------

## newbie_gentoo

well, i tried:

```
 cupsaddsmb -H keg -h keg -U root -v -a 
```

and the result is the same...

```
 root@keg /home/dcorujo # cupsaddsmb -H keg -h keg -U root -v -a Password for root required to access keg via SAMBA:

Running command: smbclient //keg/print\$ -N -U'root%#####' -c 'mkdir W32X86;put /var/spool/cups/tmp/4118ff8acce2d W32X86/HP840C.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=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.5]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Password for root required to access keg via SAMBA:

Running command: smbclient //keg/print\$ -N -U'root%' -c 'mkdir W32X86;put /var/spool/cups/tmp/4118ff8acce2d W32X86/HP840C.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=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.5]

tree connect failed: NT_STATUS_WRONG_PASSWORD

ERROR: Unable to copy Windows printer driver files (256)!

 
```

The first time it complains about NT_STATUS_BAD_NETWORK_NAME, and if I press ENTER when he requests a pass a second time I get NT_STATUS_WRONG_PASSWORD and Unable to copy Windows printer files.

Any ideas?

----------

## daff

Did you follow the Howto to the letter (or implemented it at least somehow accuratly?)

Seems to me that there's something wrong with either your Samba setup or some mismatches on the system itself. Do you have DNS set up correctly or do yor have sane entries in /etc/hosts? Hostname correct? Does Samba acutally work? Can you browse shares and copy files around from the Windows client? Can you do a smbclient -U% -L keg? If so, can you do a smbclient -U ANY_SAMBA_USER \\\\keg\\ANY_SHARE_NAME? Does CUPS work? 

Please post the output of testparm as well as hostname, your /etc/hosts and have a look at the troubleshooting tips by Kurt Pfeifle.

That's all I can think of for now, you did not provide much information to work with  :Wink: 

----------

## newbie_gentoo

Hello. Sorry about the lack of info. Any more kind of info you need just tell me (and the way to obtain it would be welcome too, hehe).

I followed your How to almost religiously, hehe.

Well, 

```
mbclient -U% -L keg
```

 and 

```
smbclient -U ANY_SAMBA_USER \\\\keg\\ANY_SHARE_NAME
```

 where both succefull, whereas I could look at what were my share names, and I could navigate through them. Cups is working fine at every program I tried... mozilla-thuderbird, openoffice, acroread, etc.

Samba also works, disk-sharing wise.

Here are the outputs you requested:

TESTPARM

```
root@keg /home/dcorujo # testparm

Load smb config files from /etc/samba/smb.conf

Processing section "[print$]"

Processing section "[HP840C]"

Processing section "[printers]"

Processing section "[public]"

Processing section "[Musica]"

Processing section "[MCP2K4]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters

[global]

        server string = Samba Server %v

        interfaces = lo, eth0

        bind interfaces only = Yes

        security = SHARE

        log file = /var/log/samba/log.%m

        max log size = 50

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        guest ok = Yes

        hosts allow = 127.0.0.1, 10.10.10.

        hosts deny = 0.0.0.0/0

[print$]

        comment = Printer Drivers

        path = /etc/samba/printer # this path holds the driver structure

        write list = root

        guest ok = No

[HP840C]

        comment = HP DeskJet 840C Network Printer

        path = /var/spool/samba

        printer admin = root

        printable = Yes

[printers]

        comment = All Printers

        path = /var/spool/samba

        printer admin = root

        printable = Yes

        browseable = No

[public]

        comment = Public Files

        path = /home/dcorujo/share

        read only = No

        create mask = 0766

[Musica]

        comment = Music Files

        path = /mnt/fat32/Musica/

[MCP2K4]

        comment = Minho Campus Party 2k4

        path = /mnt/windows/Documents and Settings/Daniel/Desktop/mcp2k4/

```

HOSTNAME

```
root@keg /home/dcorujo # hostname

keg
```

/ETC/HOSTS

```

127.0.0.1 localhost

10.10.10.146 keg.brewery keg

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

I took a look around Kurt Pfeifle's troubleshooting guide... and I got scared 

 :Embarassed: 

Hope this new info helps![/b]

----------

## mold

Hi

This really sucks...I have definately spent too much time already on this damn stuff :(

The problem:

I want to enable several W2K and XP clients to print on the network, using a Gentoo Server (Samba and CUPS). 

I want to make use of the download drivers functionality so that I don't have to manually install the printers everytime another clueless laptop owner needs to use one of the network printers.

What I have done so far:

Read this HOWTO and several others.

Installed Samba, Foomatic, CUPS and the CUPS drivers for Windows (cups-samba).

Set up my printers in CUPS and configured Samba to print via CUPS and to offer the printer download share (created print$ and ran cupsaddsmb).

What works:

I can print locally from the server and I can also print from the Windows clients using IPP. 

Also, the clients can print via Samba if I do *not* use the driver download functionality, but instead install the usual Windows drivers locally.

The printers are listed correctly in network neighbourhood. When I try to use the driver download funcionality, Windows seems to download the drivers correctly - it does not complain about missing drivers, installs the printer, and the driver files do appear in the appropriate directories on the Windows machine.

The problem occurs as soon as I try to print from an application:

As soon as I try to print from W2K with the drivers downloaded from Samba, I get a bunch of typically unhelpful Micro$oft error messages (something like 'function address 0x-this-or-that caused a protection error, property pages may not be displayed...'). There is no sign of any connection in any of the server's logfiles, so the print process seems to crash before even any connection to Samba is made.

Interesting: When I print via right-click on printer, properties, print test page, anything works just fine! But I cannot print from e.g. Notepad. The problem seems to occur when Windows tries to display certain printer properties. 

I have not yet tried wether the same problem occurs on XP clients, maybe it is limited to W2K.

For me, this seems to bet not a Samba/CUPS configuration problem, but a problem with the CUPS drivers from the cups-samba package.

2 questions:

Is anyone else experiencing this trouble?

Can someone give me detailed instructions on how to use the Adobe drivers? I downloaded them, but after installing them on a Windows machine, I cannot find the files that I am supposed to copy over to the server according to the cupsaddsmb manpage :(

----------

## daff

newbie_gentoo: Please set your security parameter to user in your smb.conf global section e.g. 

```

[global]

  ...

  security = user

  ...

```

Then try cupsaddsmb again, it should give different output now, or there might be some deeper, more serious flaws  :Smile: 

mold: The problem you are experiencing indeed seems to be a known bug in the cups-samba drivers. If you read through this thread you'll notice some people reporting the same unhelpful error message only they DO seem to be able to print via Notepad, Acrobat, etc. See here for some details.

Note so self: I need to add a remark about that property box to the guide. I also need a 48-hour-day.

Please see the workaround by matbouch (thanks!), a few post above. I haven't tested it myself though.

And just a blind shot by me: maybe your problem is because several different printer drivers are installed and they conflict somehow with each other? Try deleting all the installed printer drivers (and printers) and connect again (this is always a good idea in Windows). 

I think this is done by opening Start -> Settings -> Printers and right-clicking anywhere on the white background, chosing "Server properties". I am not sure, it's now been a while since I've used Windows to print. Theoretically you should be able to print although you wouldn't be able to select any extra options and properties.

HTH...

----------

## mold

Thx daff, I will try some of the things that were mentioned. 

And sorry for not reading the thread well enough. I have put far too many hours into trying to get this thing to work... I am somewhat exhausted by the samba/cups/windows combination at the moment ;)

----------

## newbie_gentoo

O darn... i changed security to user, and i still get the same error!  :Sad: 

EDIT: i also noticed that when cupsaddsmb asks for the password, I get that same mistake EVEN if I put a wrong password! any ideas?

----------

## daff

mold: Very understandable  :Smile:  Windows networking is a nightmare...let's hope for the CUPS guys to resolve the problem.

newbie_gentoo: I am running out of ideas...have you added root to the Samba passwort database by issuing smbpasswd -a root? Don't forget it's the passwort you gave there cupsaddsmb is expecting.

Try also setting netbios name = keg in smb.conf. Leave security = user though. You should also set your workgroup = to something other than just WORKGROUP (no real reason, but it's better  :Smile: ).

That's all I can think of at the moment, sorry.

----------

## mold

This is almost getting funny. I just found out that I in fact *can* print from Firefox, OOo, etc - but not from Notepad. It seems that for some reason Notepad tries to open the printer configuration before printing and that is why it crashes, while other applications do not. I think I should just get the Adobe drivers. Can someone who uses them give me a hint on where to find the correct files?

----------

## daff

 *mold wrote:*   

> This is almost getting funny. I just found out that I in fact *can* print from Firefox, OOo, etc - but not from Notepad. It seems that for some reason Notepad tries to open the printer configuration before printing and that is why it crashes, while other applications do not. I think I should just get the Adobe drivers. Can someone who uses them give me a hint on where to find the correct files?

 

Really interesting  :Very Happy: 

Well the Adobe drivers are infact intended for local installation on each client, but I managed to find the correct files after extraction of the archive (seems like years ago).

I have no Windows machine at hand now but you should try downloading and extracting the archive from Adobe (found here) and then use the search function on Windows to locate the files. According to the cupsaddsmb man page they are called ADOBEPS5.DLL, ADOBEPSU.DLL and ADOBEPSU.HLP. See the man page for details on installation/copying (the files need to be all uppercase).

HTH

----------

## newbie_gentoo

oh boy... same thing... I'm giving up. I'm planning on building a gentoo gateway, and it looks like it is rapidly candidating itself to be a printer server. I hope I can get it working there, hehe. Thanks for all the help, you've been great!  :Very Happy: 

----------

## daff

Just wanted to say I installed Gentoo on my main desktop machine at home (which ran FreeBSD for years) two days ago and just now I used my guide to set up Samba and CUPS. I did not ran into a single problem whatsoever!

So the guide should be still accurate and working! Just follow every step carefully and it should work!

I have working DNS setup at home, two entries in /etc/hosts, one for localhost, one for my machine (although the second entry isn't really necessary since a DNS is running). security = user in smb.conf's [global] section, workgroup = ARDA, passdb backend = tdbsam, added users using pdbedit (am going to update the guide for that) and that was it.

----------

## olli.bo

Hi, great Howto thank you for this daff...

I got the printer working with cups (locally) and tried now to connect the printer with Windows NT4. I'm getting the error, that the driver (on the Samba Server) could not be installed.

I'm using the cups driver. All commands in your Howto worked. 

Here are my config files:

smb.conf:

```
[...]

[print$]

comment = Printer Drivers

path = /var/lib/samba/drivers

browseable = yes

guest ok = no

read only = yes

write list = printadm,root

[printers]

comment = All printers

path = /var/spool/samba

browseable = no

public = yes

guest ok = yes

writable = no

printable = yes

printer admin = printadm,root
```

/etc/cups/printers.conf:

```
<DefaultPrinter toshtest>

Info toshtest

DeviceURI socket://184.1.52.26:9100

State Idle

Accepting Yes

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

</Printer>
```

The files in print$ are:

```
# find /var/lib/samba/drivers

/var/lib/samba/drivers

/var/lib/samba/drivers/W32X86

/var/lib/samba/drivers/W32X86/2

/var/lib/samba/drivers/W32X86/2/cupsdrvr.dll

/var/lib/samba/drivers/W32X86/2/toshtest.ppd

/var/lib/samba/drivers/W32X86/2/cupsui.dll

/var/lib/samba/drivers/W32X86/2/cups.hlp
```

Any ideas?

----------

## daff

Hm. You have a section for your printer in your smb.conf? A [toshtest] if I am not mistaken?

What I find interesting is that your CUPS driver files lack the "suffix" `5', i.e. they are named cups.dll, cupsdrvr.dll, ... and not cups5.dll, cupsdrvr5.dll, etc. Did you use the correct CUPS drivers from the CUPS web site (to be downloaded here)?

If not then get them, delete the contents of /var/lib/samba/printers, install them via the cups-install.sh script, make sure the directory /var/lib/samba/printers you specified is readable by all and writeable by root and any printer admin user and run cupsaddsmb again. I updated the guide so it shows a correct sample-output of the command.

What kind of printer to you have? Is it not locally connected (I am referring to the entry DeviceURI socket://184.1.52.26:9100 in printers.conf)?

That's the ideas I have for now, hope it helps!

----------

## olli.bo

 *daff wrote:*   

> Hm. You have a section for your printer in your smb.conf? A [toshtest] if I am not mistaken?

 

I tried with [toshtest] and without... same result...

 *Quote:*   

> What I find interesting is that your CUPS driver files lack the "suffix" `5', i.e. they are named cups.dll, cupsdrvr.dll, ... and not cups5.dll, cupsdrvr5.dll, etc. Did you use the correct CUPS drivers from the CUPS web site (to be downloaded here)?

 

I'm using the old cups-drivers because we ware using cups 1.1.19

 *Quote:*   

> If not then get them, delete the contents of /var/lib/samba/printers, install them via the cups-install.sh script, make sure the directory /var/lib/samba/printers you specified is readable by all and writeable by root and any printer admin user and run cupsaddsmb again. I updated the guide so it shows a correct sample-output of the command.

 

```
# find /var/lib/samba/printers/ 

/var/lib/samba/printers/

/var/lib/samba/printers/W32X86

/var/lib/samba/printers/WIN40

# rm -rf /var/lib/samba/printers/*

# cupsaddsmb -H localhost -U printadm -h localhost -v -a

Password for printadm required to access localhost via SAMBA: 

Running command: smbclient //localhost/print\$ -N -U'printadm%XXXXXXXX' -c 'mkdir W32X86;put /var/spool/cups/tmp/411b7ab875f1c W32X86/toshtest.ppd;put /usr/share/cups/drivers/cupsdrvr.dll W32X86/cupsdrvr.dll;put /usr/share/cups/drivers/cupsui.dll W32X86/cupsui.dll;put /usr/share/cups/drivers/cups.hlp W32X86/cups.hlp'

Domain=[OLB] OS=[Unix] Server=[Samba 3.0.4]

NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86

putting file /var/spool/cups/tmp/411b7ab875f1c as \W32X86/toshtest.ppd (9916.5 kb/s) (average 9916.6 kb/s)

putting file /usr/share/cups/drivers/cupsdrvr.dll as \W32X86/cupsdrvr.dll (19418.1 kb/s) (average 15963.1 kb/s)

putting file /usr/share/cups/drivers/cupsui.dll as \W32X86/cupsui.dll (17565.6 kb/s) (average 16528.8 kb/s)

putting file /usr/share/cups/drivers/cups.hlp as \W32X86/cups.hlp (1069.3 kb/s) (average 12252.7 kb/s)

Running command: rpcclient localhost -N -U'printadm%XXXXXXXX' -c 'adddriver "Windows NT x86" "toshtest:cupsdrvr.dll:toshtest.ppd:cupsui.dll:cups.hlp:NULL:RAW:NULL"'

Printer Driver toshtest successfully installed.

Running command: rpcclient localhost -N -U'printadm%XXXXXXXX' -c 'setdriver toshtest toshtest'

Succesfully set toshtest to driver toshtest.

#
```

Same result with two different Windows NT 4 Workstations: "The driver could not be installed".

 *Quote:*   

> What kind of printer to you have? Is it not locally connected (I am referring to the entry DeviceURI socket://184.1.52.26:9100 in printers.conf)?

 

It is a big Toshiba e-Studio3511 network printer

 *Quote:*   

> That's the ideas I have for now, hope it helps!

 

Thank you.  :D

----------

## daff

Ok, haven't thought that you could be using the older CUPS version, my bad  :Smile: 

I am not sure, but what's the point to use a CUPS printserver if you have a network printer? I guess the idea is automagic download of the printer drivers, but I somehow doubt that this would work. A printer server to provide drivers to clients for another printer server (a network printer is its own printer server if I am not mistaken, not sure about your model)? Sounds a bit weird and a bit too complex for Windows networking, but I've never tried anything like that, so I could be talkin trash here  :Smile: 

That's maybe why it makes no difference to have or not have a [toshtest] section as described. 

Using CUPS on the client to print to the network printer works of course, that's one of the ideas behind CUPS (we have an Okipage network printer here which works just fine when I use the correct ppd on my Gentoo laptop).

Does the network printer work when you install the correct Windows drivers locally on the clients? What if you connected your printer locally to the CUPS server, add the [toshtest] section and then try connecting to it from the clients?

----------

## olli.bo

 *daff wrote:*   

> 
> 
> I am not sure, but what's the point to use a CUPS printserver if you have a network printer? I guess the idea is automagic download of the printer drivers, but I somehow doubt that this would work. A printer server to provide drivers to clients for another printer server (a network printer is its own printer server if I am not mistaken, not sure about your model)? Sounds a bit weird and a bit too complex for Windows networking, but I've never tried anything like that, so I could be talkin trash here :)
> 
> 

 

As I understood cups has its own drivers for the Toshiba network printer. So it is the same like a usb or parallel connection only over a network...

We need this easy connection with automatic driver installations, because this here is a very big network with hundrets of users without idea about anythink with computers. 

 *Quote:*   

> Does the network printer work when you install the correct Windows drivers locally on the clients?

 

I tried to install the Adobe drivers locally on the NT Workstations. This works...

 *Quote:*   

> 
> 
> What if you connected your printer locally to the CUPS server, add the [toshtest] section and then try connecting to it from the clients?

 

I can't connect the printer direct with the CUPS server... The printer only has network interfaces

Tanks for your help

olli

----------

## daff

Hm, that's a situation I've never come across so I can only guess  :Smile: 

You mean CUPS sees the printer just like it was a local printer? Then of course it should be theoretically possible to serve it just like a local printer. Which driver did you use for that Toshiba printer to make it look like a local one?

----------

## olli.bo

 *daff wrote:*   

> You mean CUPS sees the printer just like it was a local printer? Then of course it should be theoretically possible to serve it just like a local printer. Which driver did you use for that Toshiba printer to make it look like a local one?

 

I installed the printer how it is described in your howto:

lpadmin -p toshtest -E -v socket://184.1.52.26:9100 -m toshibas_ppd_file-ppd

I don't think that this is a problem with the printer itself.

----------

## mold

I finally got it  to work, thanks Daff. 

I had to run the Adobe installer and copy the files over from a Windows temporary directory *before finishing the installer.* 

As far as I can tell, if you let the installer run through completely, you will not find the files on a W2k machine. That is because the files the installer program actually installs are not the ones mentioned in the cupsaddsmb manpage. It only extracts them temporaily, but then it installs something like 'PSblahblah.DLL' in stead. Doh! 

I pray to God that my setup will work work stable now -  I am so fed up with those damn Windows clients...

About olli.bo's problem: It definately works with network printers. I have such a setup running now, where CUPS connects to a small printserver box via LPD.

olli, I think it might be a problem with your permissions. Maybe try to change this line in your smb.conf:

```

[print$] 

guest ok = yes

```

Here is my smb.conf that now works for me with W2K and WinXP clients:

```

[global]

   workgroup = MYLAN

   server string = %h server (Samba %v)

   security = SHARE #must temporarily set this to user to run cupsaddsmb

   obey pam restrictions = Yes

   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

   wins proxy = Yes

   ldap ssl = no

   panic action = /usr/share/samba/panic-action %d

   csc policy = disable

[printers]

   comment = All Printers

   path = /var/spool/samba

   printer admin = root

   create mask = 0700

   guest ok = Yes

   printable = Yes

   browseable = No

[print$]

   comment = Printer Drivers

   path = /etc/samba/drivers

   write list = root

   guest ok = Yes

#file shares follow

```

----------

## daff

mold: Great to hear you got it working! I think I'll put a section about the Adobe drivers in the guide if you don't mind! Sorry I couldn't help that much though.

About the other problem: as I said I have no real experience with such a setup but it sounds very promising that you got it working! 

I've tried and tried with one of those LinkSys EPSX3 print servers with an attached Kyocera Mita FS1010 but it just would not interpret any postscript input. Meaning it prints out the postscript source in plain text, i.e. the CUPS test page is several pages long, filled with postscript commands in plain text. Same thing with every other file I try to print, even real plain text.

I tried with the original .ppd from Kyocera, as well as several from linuxprinting.org but always with the same result. 

What printer do you use? Do you remember how you installed the printer so it would work with CUPS? Maybe you could PM me the instructions when you have the time or even put a little mini-howto together  :Wink: 

Such a setup would be very nice here too, I am sick of manually installing printer drivers on 40 machines every few months.

olli.bo: mold could be right with the guest ok = yes setting although I am not sure that this is necessary. You could examine the Samba log files and see what happens at the moment you try to connect to a printer. 

Granted, the Samba logs are really full of stuff but if you take a thorough look you might find a permission problem or any other error message that could indicate the problem.

Theoretically it should work...

----------

## mold

In my case, a HP LaserJet 6MP is connected to a pretty old printserver box. This printserver understands Appletalk and LPD, but neither IPP nor SMB (which is part of the reason why I use a Gentoo server between the printserver and the Windows clients - as far as I can tell, current versions of Win do not support LPD).

Basically, I installed the LaserJet 6MP with Foomatic exactly like I would install a locally connected printer (followed the Gentoo printing HOWTO), the only difference was that as device, I did not use something like 'file:/dev/lp0', but:

```

lpd://192.168.0.3/printer

```

Where 192.168.0.3 is my printserver's IP and 'printer' is the name of the print queue on the printserver (configured that by telnetting the printserver). From there on, I just used cupsaddsmb the usual way.

The exact same approach works for me with an Apple network printer, which basically is a printer with an integrated LPD printserver.

I only have experience with 2 network printers/print servers, so I cannot say if the same will work for anyone else.

----------

## sepulchron

do you remember the "NT_STATUS_BAD_NETWORK_NAME - problem"?

some posts before a few people had this but as far as i could see, the prob wasn't solved... 

if it is solved please tell me how  :Smile: 

because i am facing this problem now...

at least i found out some additional information which could help to solve the problem. First i'd like to repeat the problem:

alright, it is about the "cupsaddsmb"

i always get this:

```

Yggdrasil root # cupsaddsmb -H Yggdrasil -h Yggdrasil -U root -v -a                 Password for root required to access Yggdrasil via SAMBA:

Running command: smbclient //Yggdrasil/print\$ -N -U'root%********' -c 'mkdir W32X86;put /var/spool/cups/tmp/411d1e700b92e W32X86/Epson.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=[YGGDRASIL] OS=[Unix] Server=[Samba 3.0.5]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

```

smbclient is working fine on all shared stuff.

EXCEPT on this [print$] share in which the drivers shall be copied.

watch this:

```

Yggdrasil root # smbclient //Yggdrasil/print\$ -U root

Password:

Domain=[YGGDRASIL] OS=[Unix] Server=[Samba 3.0.5]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

```

testparm says that everything is fine...here its output:

```

[global]

workgroup = Niflheimr

server string = Yggdrasil

netbios name = Yggdrasil

encrypt passwords = True

security = user

smb passwd file = /etc/samba/private/smbpasswd

log file = /var/log/samba/log.%m

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

bind interfaces only = True

interfaces = lo eth0

hosts deny = 0.0.0.0/0

hosts allow = 192.168.8.20 192.168.8.18 192.168.8.17 127.0.0.1

printcap name = cups

load printers = yes

printing = yes

[print$]

comment = Printer Drivers

path = /etc/samba/printer       # path to the driver structure

guest ok = no

browsable = yes

read only = yes

write list = root,flo

[printers]

comment = All Printers

path = /var/spool/samba

browseable = no

public = yes

guest ok = yes

writeable = no

printable = yes

printer admin = root

[public]

comment = Public Files

browsable = yes

public = yes

writeable = yes

create mode = 0766

guest ok = no

path = /home/samba/public

```

hope we can solve this problem, since many seem to face it...

----------

## olli.bo

I solved my WinNT-connect problem. The reason was that my printer-admin-user had not enough rights to serve the printer or what ever... 

My new problem is that the adobe-driver or the cups-server seems not to serve the special features like sorting paper and so on. 

Is it possible to use the original printer drivers instead of the cups or adobe drivers?

----------

## daff

 *Quote:*   

> 
> 
> Is it possible to use the original printer drivers instead of the cups or adobe drivers?
> 
> 

 

No it is not (at least not on the server side). And it would not make much sense to use a CUPS server.

AFAIK The CUPS and Adobe drivers are nothing but quite generic PostScript drivers that make every printer attached to the printserver look like a nice PostScript printer. 

The CUPS server and the ppd control the features of the printer and which of them can be used. So it all depends on the ppd, when a particular feature of the printer is not supported in it then that feature cannot be used via CUPS. Where did you get the PPD for that Toshiba printer of yours? Was it supplied on the driver CD by Toshiba? If so then it should support all printer features. I am asking because there seems to be no entry for Toshiba at all on LinuxPrinting.org.

This has nothing to do with the CUPS Windows drivers or the Adobe ones (if I am not mistaken). 

Maybe you should consider using a Windows 2000 machine as the printserver for you particular printer, then you could be at least assured that every feature is supported.

----------

## Naughtyus

I'm really having problems with Samba printing.

I have a Linux server, running cups and samba with an HP 932C DeskJet printer attached and working fine locally.

On Windows clients, they are able to see and install the printer without problem (I have them use their own drivers), however they are never actually able to send any print jobs to the printer.  WinXP clients end with an error:

"User Intervention required: unable to connect to printer"

and Win98 clients have a similar error...

Please help!

My smb.conf is as follows:

```
[global]

   workgroup = RKO

   server string = Samba Server %v

   printcap name = cups

   load printers = yes

   printing = cups

   browseable = yes

   log file = /var/log/samba/log.%m

   max log size = 50

   hosts allow = 192.168.0. 127.

   security = share

   encrypt passwords = yes

   smb passwd file = /etc/samba/private/smbpasswd

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   dns proxy = no

   log level = 4

[print$]

   comment = Printer Drivers

   path = /var/lib/samba/printers

   browseable = yes

   guest ok = no

   read only = yes

   write list = @adm root

[HPDeskjet]

   comment = HP DeskJet 932C

   printable = yes

   path = /var/spool/samba

   guest ok = yes

   public = yes

   printable = yes

   printer admin = @adm root

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

   guest ok = yes

   public = yes

   writable = no

   printable = yes

   printer admin = @adm root 

```

----------

## OhSh33t

Thanks for the howto. I've gotten file sharing working very nicely. Was using WinSCP all the time to move files from Windows to Linux and vicea-versa. Now, we have one central server that everyone can connect to. SWeetness.. 

Print Sharing is fugly though.

# cupsaddsmb   (has proven to drive me absolutely bonkers)

Ok.. I've been at this for almost a day now. I'm starting to go batty. I must be missing something really small. I've started from scratch 3 times now. I've googled my brains out as well as looked at all the official samba 3 printing docs.. 

No matter what I do I keep getting:

```

root@toejam samba # cupsaddsmb -H localhost -U root -h localhost -v HP

Password for root required to access localhost via SAMBA: 

Running command: smbclient //localhost/print\$ -N -U'root%**********' -c 'mkdir W32X86;put /var/spool/cups/tmp/41309be5dcc4f W32X86/HP.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=[MSHOME] OS=[Unix] Server=[Samba 3.0.5]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

```

[EDIT/UPDATE]

After going completely crazy I looked at the info contained here.

Only after switching "security = user" in smb.conf as well as using

```
root# cupsaddsmb -U root -v HP
```

.... then the command completed successfully..

I'm running my own DNS internally and all hosts resolve just fine by name. I can print locally from the Samba server.  All windows clients can browse the shares created on the Samba/Gentoo server.... but trying to print a file on a windows machine is a crap shoot at best. 

First off it seems that I have to place the file I want to print inside one of my samba shares first and then I can print.  I thought I could just open a file in WinXP and ... example.. "Test.txt" and choose "file>print and choose my network printer".. I see it get spooled up and nothing happens.. If I place that same file on one of the samba shares and then print the file from within the samba share it works..  PDF's will not print what so ever..... So now its onto cups trouble shooting.. WooHoo.. allmost there..

[UPDATE/EDIT] My Windows client printing problems were all due to WinXP service pak2 auto installing MS's firewall.. as soon as I turned that off.. all is well..  To funny.. Microsoft is now finally getting their firewalling down. "A day late and a dollar short" if you ask me..

Even after I added udp port 631 to the WinXP Pro firewall rules it was still denying print requests with some kind of communication happening on source port tcp 139... funny thing is.. that this port is already allowed..  MS firewall bug.. Heh...

----------

## pharaoh

This was a solid HOWTO.  I never would have got this setup in this amount of time otherwise!!

One problem I ran into was in the cupsd.conf...I had to change the print server name to "localhost" instead of the hostname that the clients were used to.

I'm serving an HP3650 to two other Gentoo boxes, and once I had everything setup correctly I didn't even have to add the printers to the clients    :Very Happy: 

IT'S GENTOO MAGIC!!!!

----------

## Chewieip

First at all, what a great How-To!!!! It has been too usefull to me, but when I'm installing my windows drivers I've a little problem. 

When the cupsaddsmb -H PrinterServer -U root -h PrinterServer -a asks me about the root password I write it but doesn't works. 

I thought I forgot my root samba password so I run another time 

```
 smbpasswd -a root 
```

 , and when I Type a new password and it wants to update it, returns an error like this: 

```
 Failed to open account policy database 
```

Anyone knows why it happens?

----------

## pharaoh

I was getting the same thing.  I'm using v3, which samba version are you using?

I ended up reinstalling samba and adding users with pdbedit...when I tried using pdbedit or smbpasswd I kept getting the same error you are.

----------

## Chewieip

I've also the latest version 3.0.5. And if you say, reinstalling samba doesn't solve the problem, it has to be something more. 

I'm confused.

----------

## daff

First of all I am sorry, but I just don't had/have the time to look after this thread lately. Hopefully I'll have more time in a week or two.

OhSh33t: I believe you overread it but I've mentioned it more than once: anything else than security = user seems to only cause lots of fricken trouble  :Smile: 

 *me wrote:*   

> 
> 
> 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. 
> 
> 

 

Chewieip: Have you a directive like passdb backend = ... in your smb.conf? When you reinstall Samba backup your smb.conf and delete or move /etc/samba. Then put smb.conf back in, edit it and set passdb backend = tdbsam (the global section). Only after that do a pdbedit -a -u root and pdbedit -a -u any_other_users.

pharaoh: CUPS rules, don't you think?  :Very Happy: 

One CUPS server is enough and every other CUPS-installed client gets the available printers broadcasted to, ready to use. Simple as that once everyhting is up and running. That's CUPS's purpose  :Smile: 

Regarding cupsd.conf: if you don't have a DNS running or a well configured /etc/hosts on every client then I believe the server (as well as the clients) wouldn't be able to resolve any other name than "localhost" correctly. I probably should update the guide to clarify that.

----------

## xlulux

hey guys i get to the point where you install it and then run cupsd and it gives me this error

* Starting cupsd...

cupsd: Child exited on signal 15!                                         [ !! ]

then i check error_log file and i get this line

X [05/Sep/2004:16:51:47 -0700] No valid Listen or Port lines were found in the configuration file!

i dont know what could be wrong, here is my smb.conf and my cupsd.conf

```

ServerName linux          # your printserver name

ServerAdmin vicente_louvet@yahoo.com    # 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(eth0) ## 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>
```

and smb.conf as promised

```

[global] 

      # Required to support Windows 98 or above

   encrypt passwords = yes

   # Files that have UNIX permissions that prohibit access are hidden from users

   hide unreadable = no

   # We don't have any OS/2 clients        

   lm announce = no

   # We log all activity to a single file for regular review

   log file = /var/log/samba.log 

   # We want a minimum level of logging

   log level = 2 

   # All our computers are Windows XP

   lanman auth = no   

   # What NetBIOS name does our server call itself?

   netbios name = linux

   # We rely on username/password access methods

   security = share 

        

   #dont allow root to logon 

   invalid users = root @wheel 

   # What description should be shown in the share list?

   server string = "Samba Server"

   # These options are appropriate for most LAN's

   socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192 

   # We never want Samba to decide for us where to put the password file

   smb passwd file = /etc/samba/private/smbpasswd

   # We support the NET TIME syntax from workstations

   time server = yes

   # We will provide NetBIOS name resolution (WINS) support for clients

   wins support = yes 

   # This is our domain/workgroup name

   workgroup = PNM

   # Uncomment this if you want a guest account, you must add this to /etc/passwd

   # otherwise the user "nobody" is used

   guest account = vicente

   #load printers

   load printers = yes

   #what type of printing

   printing = cups

   printcap name = cups

[homes]

 path = /home/vicente   

       delete readonly = yes

       create mask = 0600

       writeable = yes

       browsable = yes

         mangle case = yes

    case sensitive = no

    guest only = yes    

[media]

 path = /home/vicente/music

         delete readonly = yes

         create mask = 0600

         writeable = yes

         browsable = yes

         mangle case = yes

         case sensitive = no

         guest only = yes

[print$]

  comment = Printer Drivers

  path = /etc/samba/printer # this path holds the driver structure

  guest ok = yes

  browseable = yes

  read only = yes

  write list = username,root      # add a username to the write list if you

                                  # don't only want root to be the only

                                  # printer admin (see next section) 

[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 

```

i hope you guys can help, talk to me if you need any other information this is really bugging me cause i need a printerserver set up yesterday

thanks in advance

[/quote]

----------

## daff

xlulux: Does your cupsd.conf contain only the lines you just posted? If so then you were mistaken. Your cupsd.conf should contain a lot more; in the file you should have edited the lines I explained in the guide, not generate a new file with just those few lines.

If you did not backup it before overwriting it (assuming you really overwrote it) then delete /etc/cups, reinstall it and then edit the standard /etc/cups/cupsd.conf file appropriately.

----------

## xlulux

hey guys 

having some trouble printing the test page, this is the error i get

E [06/Sep/2004:04:24:05 -0700] get_printer_attrs: resource name '/printers/*.' no good!

D [06/Sep/2004:04:24:05 -0700] Sending error: client-error-not-found

along side with this error 

E [06/Sep/2004:04:44:05 -0700] restart_job: job #7 cannot be restarted - no files!

D [06/Sep/2004:04:44:05 -0700] Sending error: client-error-not-possible

D [06/Sep/2004:04:44:05 -0700] ProcessIPPRequest: 7 status_code=404

im kind of stumped on what to do. i set up the ppd for it and everything it just wont print, any help would be very valuable

----------

## daff

This is for everybody who encounters the NT_STATUS_BAD_NETWORK_NAME error when using cupsaddsmb! Dan Herrington mailed me a solution which should/could work for most of you (I already updated the guide). If not then your problems (obviously) lie elsewhere  :Smile: 

In the [print$] section of your smb.conf file you specify the path which holds the printer driver structure. That line in the config file includes a comment which says "this path holds the driver structure". That comment is the problem, since it is on the same line. Put if BEFORE or AFTER! Otherwise Samba looks for a share with the path literally named "/etc/samba/printer # this path holds ..." which of course does not exist.

So change this:

```

[print$]

  ...

  path = /etc/samba/printer # this path holds the printer structure

  ...

```

to this:

```

[print$]

  ...

  # this path holds the printer structure

  path = /etc/samba/printer

  ...

```

And at least another source of problems should be gone for good. 

It also seems to be a good idea to this for every comment in your smb.conf file. Put it on one or more lines for itself. Just to be sure.

Thanks a lot to Dan Herrington!  :Very Happy: 

----------

## splaTTer

Hi,

i get a new error i think. found nowhere (google, usenet, forum here, mailinglists) else the same problem. i love that  :Sad: 

thsts what i get:

```

gentux root # cupsaddsmb -a -v

Password for root required to access localhost via SAMBA:

Running command: smbclient //localhost/print\$ -N -U'root%xxxxxx' -c 'mkdir W32X86;put /var/spool/cups/tmp/414098a2ed6d5 W32X86/HPP1000.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=[GENTUX] OS=[Unix] Server=[Samba 3.0.5]

putting file /var/spool/cups/tmp/414098a2ed6d5 as \W32X86/HPP1000.ppd (2721.4 kb/s) (average 2721.4 kb/s)

putting file /usr/share/cups/drivers/cupsdrv5.dll as \W32X86/cupsdrv5.dll (528.4 kb/s) (average 557.6 kb/s)

putting file /usr/share/cups/drivers/cupsui5.dll as \W32X86/cupsui5.dll (498.6 kb/s) (average 531.0 kb/s)

putting file /usr/share/cups/drivers/cups5.hlp as \W32X86/cups5.hlp (3475.0 kb/s) (average 543.3 kb/s)

Running command: rpcclient localhost -N -U'root%xxxxxx' -c 'adddriver "Windows NT x86" "HPP1000:cupsdrv5.dll:HPP1000.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'

result was WERR_ACCESS_DENIED

Password for root required to access localhost via SAMBA:

```

and here is my smb.conf:

```

[global]

# Replace MYWORKGROUPNAME with your workgroup/domain

workgroup = DGC

# Of course this has no REAL purpose other than letting

# everyone know its not Windows!

# %v prints the version of Samba we are using.

server string = Samba Server %v

# We are going to use cups, so we are going to put it in here ;-)

printcap name = cups

printing = cups

load printers = yes

use client driver = no

# We want a log file and we do not want it to get bigger than 50kb.

log file = /var/log/samba/log.%m

max log size = 50

# We are going to set some options for our interfaces...

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo eth0

bind interfaces only = yes

# Now we are going to specify who we allow, we are afterall

# very security conscience, since this configuration does

# not use passwords!

hosts allow = 127.0.0.1 192.168.0.0/24

hosts deny = 0.0.0.0/0

# Other options for this are USER, DOMAIN, ADS, and SERVER

# The default is user

security = user

# No passwords, so we're going to use a guest account!

guest account = gast

guest ok = yes

# We now will implement the on access virus scanner.

# NOTE: By putting this in our [Global] section, we enable

# scanning of ALL shares, you could optionally move

# these to a specific share and only scan it.

# For Samba 3.x

vfs object = vscan-clamav

vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

# Now we setup our print drivers information!

[print$]

comment = Printer Drivers

path = /etc/samba/printer

guest ok = yes

browseable = yes

read only = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

write list = admin,root

# Now we'll setup a printer to share, while the name is arbitrary

# it should be consistent throughout Samba and CUPS!

[HPP1000]

comment = HP Photosmart P1000

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = admin,root

# Now we setup our printers share.  This should be

# browseable, printable, public.

[printers]

comment = All Printers

browseable = no

printable = yes

writable = no

public = yes

guest ok = yes

path = /var/spool/samba

printer admin = admin,root

# We create a new share that we can read/write to from anywhere

# This is kind of like a public temp share, anyone can do what

# they want here.

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/samba/public

```

i also did

```

smbpasswd -a root

smbpasswd -a gast  (with empty password)

smbpasswd -a admin

```

"admin" and "gast" are known to my /etc/passwd:

```

samba:x:300:300:SambaUser:/home/samba:/bin/false

admin:x:301:300:SambaUser:/home/samba:/bin/false

gast:x:302:300:SambaUser:/home/samba:/bin/false

```

and i got a smbuser group in /etc/group:

```

smbuser:x:300:

```

permissions are:

```

/etc/samba/printers is 777

/var/spool/samba is 777  (found in some howto)

```

did i miss anything?

What can i do?!

----------

## blibbleage

Yet another problem sharing a printer with windows computers.  I followed through the HOWTO and it all went fine.  Here's the relevant part of /etc/samba/smb.conf

```

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

# to allow user 'guest account' to print.

   public = yes

   guest ok = yes

   writable = no

   printable = yes

   create mode = 0700

   printer admin = @adm root

# =====================================

# print command: see above for details.

# =====================================

   print command = lpr-cups -P %p -o raw %s -r   # using client side printer dri

vers.

;   print command = lpr-cups -P %p %s # using cups own drivers (use generic Post

Script on clients).

# The following two commands are the samba defaults for printing=cups

# change them only if you need different options:

;   lpq command = lpq -P %p

;   lprm command = cancel %p-%j

[print$]

   comment = Printer Drivers

   path = /var/lib/samba/printers

   browseable = yes

   read only = yes

   write list = @adm root

   guest ok = yes

[ML1510]

   comment = Samsung ML1510 Laser Printer

   printable = yes

   path = /var/spool/samba

   public = yes

   guest ok = yes

   printer admin = @adm root

```

This was mostly taken from /etc/samba/smb.conf.example, but changed according to the HOWTO.  I left /var/lib/samba/printers as the directory for the printer drivers because the subdirectories (W32X86 etc.) were already present at that location.

I've set it all up fine, and cupsaddsmb worked (once I set the guest account to one which actually existed in /etc/passwd: ftp).  It gave the following output:

```

Password for root required to access localhost via SAMBA: 

Running command: rpcclient localhost -N -U'root%########' -c 'setdriver ML1510 ML1510'

Succesfully set ML1510 to driver ML1510.

```

This command didn't install any files in /var/lib/samba/printers/W32X86/ though, so I installed them myself: I copied ML1510.ppd, cups5.hlp, cupsdrv5.dll and cupsui5.dll to that directory, then created two subdirectories called "2" and "3" and copied them there as well.  If that's unclear, here's a directory listing:

```

# pwd

/var/lib/samba/printers/W32X86

# ls -R

.:

2  3  ML1510.ppd  cups5.hlp  cupsdrv5.dll  cupsui5.dll

./2:

ML1510.ppd  cups5.hlp  cupsdrv5.dll  cupsui5.dll

./3:

ML1510.ppd  cups5.hlp  cupsdrv5.dll  cupsui5.dll

```

I can see the printer from a windows (XP) machine, but when I try to connect to it, it says  "The server for the 'ML1510' printer does not have the correct driver installed".

Any ideas why it can't find the driver? What else can I try?

Thanks!

----------

## revresxunil

I have the same problem... cupsaddsmb doesnt do anything... Have you figured out what is causing that?

----------

## theklone

```
Password for root required to access localhost via SAMBA: 

Running command: rpcclient localhost -N -U'root%########' -c 'setdriver ML1510 ML1510'

Succesfully set ML1510 to driver ML1510.
```

I've got the same problem, what cups version are you using?

Using cups-1.1.20-r2 here on ~x86 system.

----------

## blibbleage

 *theklone wrote:*   

> 
> 
> ```
> Password for root required to access localhost via SAMBA: 
> 
> ...

 

I'm using cups-1.1.21, also on ~x86.  Does anyone out there know why this isn't working?

Thanks!

----------

## Manouweb

Hello,

I wanted to thank your for your great work about this tutorial. i followed it line per line, i managed to install my hp 970C printer on my linux server/gateway/router, i can print the test page.

However after downloading the cups drivers for windows and launching the cupsaddsmb, it tells me to enter a password, i try to enter it many times it just keep asking for the password. I can't install the printer for windows clients so.

here is my config file :

```
[global]

workgroup = ESI

server string = Manoups Samba Server %v

printcap name = cups

printing = cups

load printers = yes

browseable = yes

#lock directory = /usr/local/samba/var/lock

log file = /var/log/samba/log.%m

max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

interfaces = lo eth0

bind interfaces only = yes

hosts allow = 127.0.0.1 192.168.0.0/24

hosts deny = 0.0.0.0/0

security = share

guest account = samba

guest ok = yes

vfs object = vscan-clamav

vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

[print$]

comment = Printer Drivers

path = /etc/samba/printer

guest ok = yes

browseable = yes

[HPDeskJet970C]

comment = HP DeskJet 970C Network Printer

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

printer admin = manou,root

[printers]   

comment = All Printers

browseable = no 

printable = yes   

writable = no

public = yes   

guest ok = yes

path = /var/spool/samba

printer admin = manou,root

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/samba/public

```

Please help me  :Smile: 

----------

## tophfisher

I know this is an old thread... But I hope some one out there can help!

I am far into my SMB setup, but when I use cupsaddsmb command to set a printer driver, I get this error:

```
result was WERR_ACCESS_DENIED
```

From what I can tell from the verbose output, I can copy the drivers to the print$ share just fine, the part that fails is the setdriver command...

Now I have set all the correct settings so that the user account I am using can set drivers... But no luck.. I will attach my smb.conf settings maybe someone can see something that I missed?

```

[printers]

        comment = All Printers

        path = /var/tmp

        printer admin = FRONTIER\chris.admin

        read only = no

        create mask = 0600

        printable = Yes

        browseable = No

[print$]

        comment = Printer Drivers

        path = /var/lib/samba/printers

        admin users = FRONITER\chris.admin

        read only = No

        create mask = 0764

        directory mask = 0775

        nt acl support = No

        hide dot files = No

        hide unreadable = No

```

----------

## tophfisher

This is the same problem I just posted about... Could it be our version of samba? I am running: Version 3.0.7

(If you find a fix, please post it!)

-Chris

 *Manouweb wrote:*   

> Hello,
> 
> I wanted to thank your for your great work about this tutorial. i followed it line per line, i managed to install my hp 970C printer on my linux server/gateway/router, i can print the test page.
> 
> However after downloading the cups drivers for windows and launching the cupsaddsmb, it tells me to enter a password, i try to enter it many times it just keep asking for the password. I can't install the printer for windows clients so.
> ...

 

----------

## tophfisher

OK! I have an update to this, and possilby the other post' issue, it appears this is a bug in Samba that affect you if you run in ADS mode.. Here is what I found on the Samba website:

                 =================================

                 Release Notes for Samba 3.0.8pre1

                           Sept 24, 2004

                 =================================

This is a preview release of the Samba 3.0.8 code base.

It is *not* intended for production use but rather is 

provided to allow people to test the bug fixes and new 

features in the upcoming 3.0.8 release.  Use at your own 

risk.

Common bugs fixed in 3.0.8pre1 include:

  o Compile fixes for HP-UX

  o Fixes for the printer publishing code used when 

    joined to an AD domain.

  o Incompatibilities with file system quotas.

New features included in the 3.0.8pre1 release are:

  o New migration functionality added the the net tool

    for files/directories, printers, and shares.

 *tophfisher wrote:*   

> This is the same problem I just posted about... Could it be our version of samba? I am running: Version 3.0.7
> 
> (If you find a fix, please post it!)
> 
> -Chris
> ...

 

----------

## neurosis

 *blibbleage wrote:*   

>  *theklone wrote:*   
> 
> ```
> Password for root required to access localhost via SAMBA: 
> 
> ...

 

Same problem here. I got it working by looking through the thread at some people who actually had this command work, and by manually executing the commands that cupsaddsmb executes.

ie: 

```

mkdir /etc/samba/printer/W32X86

(move the .dlls, .hlp, and .ppd to this directory)

Then..

rpcclient hektor -N -U'root%XXXXXX' -c 'adddriver "Windows NT x86" \ "lp:cupsdrv5.dll:lp.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'

```

Careful, the 'lp' corresponds to my printer name - yours will be different. Printer is a Samsung ML-1740 and now seems to be working well. At least the Windows clients can auto-install drivers and whatnot  :Smile: 

----------

## blibbleage

 *neurosis wrote:*   

> Same problem here. I got it working by looking through the thread at some people who actually had this command work, and by manually executing the commands that cupsaddsmb executes.
> 
> ie: 
> 
> ```
> ...

 

Thanks for that, but no luck here.  My smb.conf specifies /var/lib/samba/printers as the [print$] share, so I used that directory instead.  I executed the above commands and got:

```
result was DOS code 0x00000003
```

I then created the directory /var/lib/samba/printers/W32X86/2 and executed the rpcclient command again.  This time, the result was:

```
result was DOS code 0x00000013
```

Neither command copied the drivers to the 2/ subdirectory, and  the printer still doesn't work from winXP.  Any ideas what the DOS codes mean? or why it's not working, come to that?

Thanks!

----------

## neurosis

I didn't create the 2 directory. Just the W32X86 one.. just a subtle difference.

----------

## blibbleage

 *neurosis wrote:*   

> I didn't create the 2 directory. Just the W32X86 one.. just a subtle difference.

 

I tried that first, but it didn't work.  Do you know what results you got from rpcclient? (which DOS code and/or other message?)

Thanks!

----------

## neurosis

I don't recall offhand, but it was the same result/output as if the command were run with cupsaddsmb.

----------

## theklone

 *blibbleage wrote:*   

>  *theklone wrote:*   
> 
> ```
> Password for root required to access localhost via SAMBA: 
> 
> ...

 

For some reason I said I was using cups-1.1.20-r2 in the above post which I was not, I was using cups-1.1.21, I must of got it confused somewhere.

Anyway it appears cupsaddsmb in cups-1.1.21 requires CUPS v6 PostScript printer driver for Windows which doesn't appear to be available yet.

You could either downgrade to cups-1.1.20 which I did, or use the Adobe PostScript drivers with cups-1.1.21.

----------

## blibbleage

 *theklone wrote:*   

> For some reason I said I was using cups-1.1.20-r2 in the above post which I was not, I was using cups-1.1.21, I must of got it confused somewhere.
> 
> Anyway it appears cupsaddsmb in cups-1.1.21 requires CUPS v6 PostScript printer driver for Windows which doesn't appear to be available yet.
> 
> You could either downgrade to cups-1.1.20 which I did, or use the Adobe PostScript drivers with cups-1.1.21.

 

Thanks for the tip.  I've downgraded to cups-1.1.20-r2, restarted cups then installed the drivers again and copied them to /var/lib/samba/printers/W32X86/.  I then ran the two rpcclient commands (adddriver and setdriver) but it still couldn't install them from a windows xp client.  Thanks for your help, everyone, but I think I'll give up and maybe try again when version 6 of the cups drivers for windows come out.

----------

## hpxchan

First of all (this is only sort of on-topic), when I tell the printer to print a test page, it goes here. ???

Other than that, though, the printer works pretty well. It prints, that is.

I get "Warning: No PPD file for printer "hpxPrinter" - skipping! when I enter:

cupsaddsmb -H PrintServer -U root -h PrintServer -v hpxPrinter

and the same thing happens when I enter:

cupsaddsmb -H localhost -U root -h localhost -v hpxPrinter

I started off with the gentoo samba-cups guide, and changed some stuff around once I got to the cupsaddsmb part.

here is my smb.conf:

```
[global]

# Replace MYWORKGROUPNAME with your workgroup/domain

workgroup = HOME

# Of course this has no REAL purpose other than letting

# everyone know its not Windows!

# %v prints the version of Samba we are using.

server string = Samba Server %v

# We are going to use cups, so we are going to put it in here ;-)

printcap name = cups

printing = cups

load printers = yes

browseable = yes

printing = cups

encrypt passwords = yes

lock directory = /usr/local/samba/var/lock

# We want a log file and we do not want it to get bigger than 50kb.

log file = /var/log/samba/log.%m

max log size = 100

# We are going to set some options for our interfaces...

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo eth0

bind interfaces only = yes

# Now we are going to specify who we allow, we are afterall

# very security conscience, since this configuration does

# not use passwords!

hosts allow = 127.0.0.1 192.168.1.103 192.168.1.101 192.168.1.105 192.168.1.104 192.168.1.0/24

hosts deny = 0.0.0.0/0

# Other options for this are USER, DOMAIN, ADS, and SERVER

# The default is user

security = user

# No passwords, so we're going to use a guest account!

guest account = samba

guest ok = yes

# We now will implement the on access virus scanner.

# NOTE: By putting this in our [Global] section, we enable

# scanning of ALL shares, you could optionally move

# these to a specific share and only scan it.

passdb backend = tdbsam

# For Samba 3.x

vfs object = vscan-clamav

vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

# For Samba 2.2.x

#vfs object = /usr/lib/samba/vfs/vscan-clamav.so

#vfs options = config-file = /etc/samba/vscan-clamav.conf

# Now we setup our print drivers information!

[print$]

comment = Printer Drivers

path = /etc/samba/printer # this path holds the driver structure

guest ok = no

browseable = yes

read only = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

write list = root

# Now we'll setup a printer to share, while the name is arbitrary

# it should be consistent throughout Samba and CUPS!

[hpxPrinter]

comment = hpxunil default printer

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

# Now we setup our printers share.  This should be

# browseable, printable, public.

[printers]   

comment = All Printers

browseable = no

printable = yes   

writable = no

public = yes   

guest ok = yes

path = /var/spool/samba

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

# We create a new share that we can read/write to from anywhere

# This is kind of like a public temp share, anyone can do what

# they want here.

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/samba/public
```

help, please?   :Sad: 

hpxchan

----------

## Parasietje

Hi.

Maybe it's a good idea to use the user 'lp'. That way, you don't have to create an extra user for /etc/passwd.

Also, maybe it's good to add "RunAsUser" in cupsd.conf.

But now:

I added the drivers for CUPS by using cupsaddsmb. All worked, but when I try to connect to the printer in windows, it states "An incorrect driver has been installed on the server where this printer is served. Do you want to attempt to install the drivers locally?"

Installing locally lasts forever...

----------

## cato`

 *Quote:*   

> result was WERR_ACCESS_DENIED

 

I solved this problem by:

1)

mkdir /etc/samba/printer/W32X86 and move the .dlls, .hlp, and .ppd to this directory

2)

comment the "use client driver = yes" line in smb.conf

3)

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

4)

uncomment "use client driver = yes" line in smb.conf

and it works!   :Very Happy: 

----------

## tophfisher

THANKS!! I will give this a try, if it works, you just saved my butt at work!

Thanks for posting the fix,

-Chris

 *cato` wrote:*   

>  *Quote:*   result was WERR_ACCESS_DENIED 
> 
> I solved this problem by:
> 
> 1)
> ...

 

----------

## theklone

 *cato` wrote:*   

>  *Quote:*   result was WERR_ACCESS_DENIED 
> 
> I solved this problem by:
> 
> 1)
> ...

 

Problem:

```
result was WERR_ACCESS_DENIED
```

Solution: *Quote:*   

> In your smb.conf, you have the option "use client driver" set to "yes".
> 
> When it is "yes", it will not allow you to set the driver.  You need to
> 
> delete the "use client driver" line, reload samba and it should work.

  http://lists.samba.org/archive/samba/2004-January/078630.html

All you needed to do was 2) and it should of worked.

----------

## fourhead

I hope somebody can help me, I'm really stuck. CUPS is working fine on my system with an Kyocera Mita FS-1010. Samba is also working fine as a PDC for my Winxp VMware guest with bridged networking. I've read several times it's possible to add drivers to Winxp this way:

As Admin, go to "network neighborhood", browse to the Sama server, browse to the printer, open propieties. Then, choose to install a driver, select driver, proceed. This should install the printer driver ON THE SERVER. When I do this, I always get a "permission denied", although I'm Admin, I have root in smbpasswd, I have a usermap that maps Admin to root and so on. As I said, the "rest" of Samba works perfectly under all circumstances. Here's my smb.conf:

```

[global]

        netbios name = scratchy

        server string = Samba %v

        workgroup = GEEKSPOT

        hosts allow = 192.168.1.

        encrypt passwords = yes

        security = user

        logon script = %u.bat

        logon path = \\%N\profiles\%U

        logon drive = l:

        logon home = \\%N\%U

#       admin user = root

        domain logons = yes

        domain master = yes

        preferred master = yes

        wins support = yes

        os level = 65

        create mask = 640

        directory mask = 750

        dos charset = 850

        unix charset = ISO8859-15

        load printers = yes

        printing = cups

        printcap name = cups

        printer admin = root, elektro

        username map = /etc/samba/username.map

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

[home]

        path = /home

        writeable = yes

[profiles]

        path = /var/lib/samba/profiles

        writeable = yes

        create mask = 600

        directory mask = 700

[netlogon]

        path = /var/lib/samba/netlogon

        writeable = no

        create mask = 740

        directory mask = 750

[printers]

        path = /var/spool/samba

        browseable = no

        writeable = no

        printable = yes

        printer admin = root,elektro

[print$]

   # this path holds the driver structure

        path = /var/lib/samba/printers

        writeable = yes

        browsable = yes

```

Permissions on /var/spool/samba and on /var/lib/samba/printers are 777. Any help would be appreciated, since I'm really, really stuck.

Tom

----------

## Stormmind

Any help with my post here would be greatly appreciated:

https://forums.gentoo.org/viewtopic.php?t=253985

----------

## localghost

You should mention somewhere that a user "samba" has to be added using

```
useradd samba
```

This one gave me 3 hours of total frustration...  :Crying or Very sad: 

----------

## theonlymcc

Instead of using SAMBA to print, why not just use the socket? Thats what I do at work and it works without a problem.

----------

## fourhead

Me again. I've given up trying to install the driver from within Windows. Instead, I want to use the Windows driver that CUPS offers. I downloaded it, untared it, ran the install script and it copied two DLL files to /usr/share/cups/drivers. There was no .hlp file in the tar archive. When I run cupsaddsmb -a or cupsaddsmb -H hostname -U root -H hostname -a nothing happens. No output, no error, the /etc/samba/printer dir for the print$ share is still empty. What's going wrong here?

Tom

Edit: Didn' know I could run cupsaddsmb in verbose mode. I get this with the -v option:

scratchy : cupsaddsmb -H scratchy -U GEEKSPOT\\root -h scratchy -a -v

Password for GEEKSPOT\root required to access scratchy via SAMBA:

Running command: rpcclient scratchy -N -U'GEEKSPOT\root%XXXXXX' -c 'setdriver KyoceraMitaFS-1010 KyoceraMitaFS-1010'

Succesfully set KyoceraMitaFS-1010 to driver KyoceraMitaFS-1010.

With XXXX being my root passwd. But still, no files in /etc/samba/printer  :Sad: 

----------

## fourhead

FINALLY! Finally, it works. I missed one single step: When you create the directory for the print$ share (/etc/amba/printer), you also have to create the appropiate subdirectory (i.e. W32X86 or whatever you need. What the hell, this took me weeks to find out! It then was easy to use the APW to install the driver on the Samba server.

Tom

----------

## shagrat

 *sepulchron wrote:*   

> do you remember the "NT_STATUS_BAD_NETWORK_NAME - problem"?
> 
> some posts before a few people had this but as far as i could see, the prob wasn't solved... 
> 
> if it is solved please tell me how 
> ...

 

After doing a reinstall of gentoo from the bottom on my server today, I faced this problem. All I had to do to resolv it was to:

```
mkdir /etc/samba/drivers
```

----------

## Parasietje

I've tried this tutorial before and it worked like a charm. But now, I wanted to test this by using the MySQL passdb backend. Adding a user is a bit of a pain, because there needs to be a password entry for the user (can't this be avoided?). Also, when updating the drivers, I got busted out. I had to set security = user, to use cupsaddsmb. Does anyone have experience with the MySQL backend for samba?

----------

## Nuuul

Thanks for this tutorial, really helped me out  :Smile: 

I did skip/modify a few steps, because I've got a Canon IP 4000 connected via LPT on an Asus WL-500G.

This AP is then in WDS mode with an Asus WL-300G, and that AP is connected to the local switch   :Rolling Eyes: 

Maybe a bit of nut-topology, but the 500G has a printserver, while the 300G doesn't, ánd the 500G is cheaper in comparision with a seperate printserver   :Confused: 

I used this command for lpadmin to notify CUPS about it:

lpadmin -p CanonIP4000 -v socket://(ip):1901 -E -m raw

The thing is, you have to upload a custom firmware to the 500G which runs p910nd daemon.

You can download that from  http://wl500g.dyndns.org/.

The only thing that doesn't work (as far as I've tried  :Wink:  ) is printing from the CUPS server itself.

----------

## gemini91

Hello, I've followed this tutorial and some others, but I'm still having problems. The printserver has cups-1.1.22 and samba-3.0.9, it is configured to use a Canon S520 attached by a usb port. It uses the gimp-print driver for the Canon S800 and works fine locally. I can't get to the printer from either Windows or Linux. We will forget windows and just look at linux here.

"smbclient -L shuttle" on the linux client produces :

	Sharename       Type      Comment

	---------       ----      -------

	print$          Disk      Printer Drivers

	Canon520        Printer   Canon S520 Network Printer

	public          Disk      Public Files

	IPC$            IPC       IPC Service (Samba Server 3.0.9)

	ADMIN$          IPC       IPC Service (Samba Server 3.0.9)

	Server               Comment

	---------            -------

	DON                  Samba 3.0.9

	SHUTTLE              Samba Server 3.0.9

	Workgroup            Masterlpstat

	---------            -------

	WORKGROUP            SHUTTLE

 but lpstat -a gives me

lpstat: Unable to connect to server : Success

I am also able to mount the public share  and browser it.

Everything says that all you need for a linux client is Servername XXXYY in client.conf and it should work. I don't see the printer anywhere on the client. Any ideas what I am missing?

----------

## Parasietje

When printing from linux, please remember that you are bypassing the samba server and printing directly to the CUPS server.

So please check /etc/cups/cupsd.conf on the server to see if you are allowed (standard is: very restricted)

Please make sure this works first.

----------

## gemini91

Parasietje, thanks very much for the reply. I thought of that after I made the post. The problem was being caused by something stupid I had done. I was changing a file called cups.conf instead of cupsd.conf. Once I got the correct file everything worked. I got the windows machines working by using cups - ipp. Again thanks for the reply.  Don

----------

## drphibes

 *daff wrote:*   

> 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.
> 
> 

 

Nice HOWTO up until this section.   The instructions should indicate that you can, depending on your set-up, choose to use the client-side Windows ("raw" printing) and completely avoid installing any Windows drivers on the Gentoo box.

I need Cups to print local jobs on the Gentoo box and Samba to serve my HP printer up to a W2K box in the same workgroup.  In this case, there is absolutely no need to install Windows drivers on the Gentoo box.   You simply serve up the printer with Samba and use the client-side drivers ("raw" printing) from Windows and be done with it.   I've done this very successfully with lprng on Slackware and am now migrating to Gentoo and Cups.    

doc

----------

## monkey89

*Sigh...*

Well, after hours of tinkering, I've gotten this to work pretty well.  However, I had to deviate from the howto in certain areas.  My cups config remained unchanged from the defaults, and I just got ppd files from http://www.linuxprinting.org and used them to install my printer access from the cups frontend (http://localhost:631), which was painless.  Just follow the Printing Howto for details on that.  However, it was sharing the printer that proved to be problemsome.  Here's my final smb.conf:

```
[global]

   workgroup = DNET

   server string = Samba Server %v

   load printers = yes

   printcap name = cups

   printing = cups

   printer admin = root

   log file = /var/log/samba3/log.%m

   max log size = 50

   hosts allow = 127.0.0.1 192.168.1.0/24

   security = share

   guest account = printuser

   guest ok = yes

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = no

   public = yes

   guest ok = yes

   writable = no

   printable = yes

   printer admin = root

[print$]

   comment = Printer Drivers

   path = /etc/samba/drivers

   browseable = yes

   guest ok = no

   read only = yes

   write list = root
```

For this to work, create the user printuser with the "useradd printuser" command.  I did this since I heard that using samba as the guest account broke things... I haven't tested it with that account, but I see no point.   You'll need to make the /etc/samba/drivers directory.  Also, be sure to edit the hosts allow line for your network.  Mine allows localhost and IPs from my block ( 192.168.1.*).  

Now the real tricky issue came up with cupsaddsmb, but it wasn't obvious from an error message.  The problem lies in the cups windows drivers.  If you haven't noticed, they can't be downloaded from the site, but a quick google can turn up results for the archive.  However - upon looking at the source, these drivers don't even work, and the comments in the code refer to a version 6 of the drivers (the latest is 5).  Even then, from my limited experience, I don't think the code will even use these drivers.  Therefore, while this may change in later versions w/ the release of the version 6 drivers, you'll have to use the Adobe Postscript drivers.

Once again, it took some searching to find what I needed, but eventually I found it in an .EXE archive.  Here's the link:

http://www.activepdf.com/altdownloads/updates/aps5eng.exe

You don't need windows to unpack it; just emerge unzip if you don't already have it and run "unzip aps5eng.exe".  This will create some junk along with two folders, win95 and nt40x86.  The 95/98/ME drivers are in the Win95 folder.  You'll need the following files renamed as said copied to the /usr/share/cups/drivers folder:

adfonts.mfm -> ADFONTS.MFM

ADOBEPS4.DRV

ADOBEPS4.HLP

defprtr2.ppd -> DEFPRTR2.PPD

ICONLIB.DLL

PSMON.DLL

To print with a WinNT/2K/XP client, go to the nt40x86 directory.  You'll need (in /usr/share/cup/drivers)

AdobePSu.dll -> ps5ui.dll

ADOBEPSU.HLP -> pscript.hlp

AdobePS5.nft -> pscript.ntf

AdobePS5.dll -> pscript5.dll

Once these files are copied over, you're almost ready to do cupsaddsmb.  Verify that /etc/samba/drivers exists and the correlating entries are in /etc/samba/smf.conf.  Then, temporarily change security from share to user for the time being.  Make sure root is in the smb password database with:

```
smbpasswd -a root
```

Then do the cupsaddsmb command mentioned in the manual with localhost instead of PrintServer, and it should work.  Be sure to change security back to share when finished.   Let me know if I forgot something, since it took a lot of work to get this far and I'm sure I left something important out.

-Monkey

----------

## iverasp

When trying to print a test page through the cups web interface, it says:

```
Description: Samsung-ML-1750

Location: 

Printer State: idle, accepting jobs. 

"Media tray empty!"

Device URI: usb:/dev/usb/lp0
```

I've filled it up with paper, and everything seems okey (all the lights are green). Anyone?

thanks

----------

## drphibes

 *monkey89 wrote:*   

> The problem lies in the cups windows drivers.  

 

Why are you using the Windows drivers at all?   If your Windows machine has drivers for your Samsung printer, you can simplify dramatically.  Pretend for a second the printer was plugged directly into your Windows machine.  Would you be able to install it with the ususal Add Printer, Select driver procedure? If yes, there's no need to install any Windows/Adobe drivers on the Linux box.  The only reason you might need those drivers would be to drive a printer that is spooled and served from Windows itself. 

Here's what I did: Forget Samba completely for a second. Emerge cups and set up the printer for local linux-based printing with cups.  To do this for my HP DeskJet, I used the linuxprinting.org database.  It recommened the pcl3 and foomatic-rip combo.  Fine.  I downloaded and installed the .ppd file into the cups ../model directory.  Emerge foomatic.  You don't need to emerge hpijs unless you have specific reason to do so.  I didn't need it.Now lpadmin to create the printer.  Done.Now concentrate on the cupsd.conf file.   I disagree with the HOWTO on the matter of broadcasting.  Turn broadcasting/browsing off unless your cups installation is to operate as a peer in a cups network.  If you're installing cups on one machine only, there no need for it to emit any broadcast noise at all.I had no browser yet installed on the linux machine, so my focus at this point was to enable remote administration in cupsd.conf, so that I could point the browser of another machine in my network to the cups port on the print server and set up any remaining printer config details, i.e. easily with the cups web interface for the HP printer.

```
<Location /admin>

#

# You definitely will want to limit access to the administration functions.

# The default configuration requires a local connection from a user who

# is a member of the system group to do any admin tasks.  You can change

# the group name using the SystemGroup directive.

#

AuthType Basic

AuthClass System

## Restrict access to local domain

Order Deny,Allow

Deny From All

Allow From 127.0.0.1

Allow From 192.168.0.*

#Encryption Required

</Location>
```

Configure printer settings look good.  Print a test page.  Looks good.Now samba.  Keep it simple.  Like anyone else, I use samba to serve up hard drive and printer shares from my linux machine to my Windows machines.  I also use it in conjunction with autofs, so I can on-the-fly mount drive shares served by Windows (i.e. bi-directional sharing, but that is a digression).   Now, all I need to do with samba is create a section for my specific printer and tell samba it's a RAW queue whose jobs require NO DRIVER HANDLING.   I also want to incorporate all the Windows-specific print queue functionality for submitting a print job, canceling it, getting printer status (ready, paused, etc,), pause/resume job, pause/resume queue, etc.    The HOWTO mentions the two mime files in /etc/cups and editing the octet-stream lines.  Leave them alone.  You don't need to edit them.  Instead, merely tell samba directly to raw print as follows (my /etc/samba/smb.conf).

```
 [global]

   netbios name = PORTHOS

   workgroup = WORKGROUP

   server string = Samba Server %v

   hosts allow = 192.168.0.0/255.255.255.0 127.0.0.1 EXCEPT 192.168.0.1

   hosts deny = ALL

   log level = 0

   log file = /var/log/samba/log.%m

   max log size = 50

   security = user

   socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192

   dns proxy = no

   wins support = no

   local master = no

   smb passwd file = /etc/samba/smbpasswd

   username map = /etc/samba/smbusers

   encrypt passwords = yes

   ; printing

   printing  = cups

   load printers = no

   show add printer wizard = no

   

   ; default perms are strict

   read only = yes

   browseable = no

   writeable = no

   printable  = no

[share1]

   comment = "porthos:/share1"

   path = /share1

   read only = no

   browseable = yes

   writable = yes

   user = /etc/samba/smbusers

   write list = /etc/samba/smbusers

#[share2] 

#   ... etc.

#[share3}

#   ....etc.

[HPDeskJet520]

   comment = HP DeskJet 520

   path = /var/spool/samba

   create mask = 0644

   browseable = yes

   writable = no

   printable = yes

   print command = /usr/bin/lpr -r -P %p -l %s

   lpq command = /usr/bin/lpq -P %p

   lprm command = /usr/bin/lprm -P %p %j

   lppause command = /usr/bin/lp -i %p-%j -H hold

   lpresume command = /usr/bin/lp -i %p-%j -H resume

   queuepause command = /usr/bin/disable %p

   queueresume command = /usr/bin/enable %p

   use client driver = Yes 
```

 You can use lpr or lp for your print command, it doesn't matter.  I chose lpr because of the "remove" after printing flag (-r), but that too doesn't matter because that behavior is determined by the cupsd.conf file.  What does matter is the lpr -l flag, which is equivalent to -o raw.  That tells cups that the data stream is raw and ready for printing with no local driver handling at all.   Just queue it up and print it.   The "use client driver = yes" is the samba directive for W2K/WinNT clients to use their own driver.    Notice too the other specific print commands that enable you to manipulate the printer queue using the Windows printer tools. Setup samba authentication.  I use the smbusers file and smbpasswd to encrypt and store each remote users passwd.  I suppose there may be other authentication techniques.  This one works for me. Restart samba.   You should see the printer share in your Windows Net Neighborhood now, but it's not ready for use yet.  Use the Add Printer wizard to add a network printer, browsing over to that printer share.   Select the driver with the customary Windows manufacturer/model dialog. You're ready to print.

doc

----------

## steve_d555

Hi,

I just tried to do this and have had some success but I still cannot print from my WinXp box. Whenever I try to connect it says there is no drivers.

There are one thing that might be the cause.

Whenever I run my cupsaddsmb command this is all of my output:

 *Quote:*   

> 
> 
> # cupsaddsmb -H gentoobox -U root -h gentoobox -v HPDeskJet5650
> 
>  Password for root required to access gentoobox via SAMBA:
> ...

 

I dont know, I dont seem to get the full output. Where did you guys install the dlls? I installed them in /usr/share/cups/drivers and /usr/local/share/cups/drivers/ ?? 

Thank you

--SteveLast edited by steve_d555 on Sun Jun 19, 2005 5:54 am; edited 1 time in total

----------

## steve_d555

Nevermind,

I just installed the HP windows drivers and it worked, and I can now print from windows. Thank you for this excellent guide.

--Steve

----------

## b0fh

I'm using cups here to print on my home network. In fact, there is one machine running Windows. Wasn't there some way to print on a cups-printer (local connected to a linux-machine) without having samba installed? I remember that I once did that, I printed somehow to http://foobar:631/printers/myprinter, but can't remember the exact settings and drivers I had to use on that machine  :Sad:  Anybody knows a howto for that? All you can find is using samba, but I don't want to install that just for printing.

----------

## krader

I have samba and cups configured to allow a Windows XP machine to connect to my linux one, and I can add the printer from Windows directly from the local network (via Samba), or using http://X.X.X.X:631/printers/HPDESKJET720C (now, you know my printer). I can access everything, but, when I print anything from windows, it sends the data to the linux machine, but the printer doesn't do anything. I've used tcpdump to capture the network traffic to see if there is traffic exange, and it exists, whith all the data and ACKs. So here is my question:

¿Why cannot I print from windows via or not via Samba?

When I were a Mandrake user, I configure cups to allow to print directly to the address before, and it worked, so I think it should be something mandrake did but gentoo doesn't.

I need an answer, my brother need to print some documents

----------

## lodder_

I have used this tutorial to install samba, but when i want to use the printer in windows i get the error:

```
there are incorrect drivers installed on the server
```

this is the error i get when i want to do the cupsaddsmb

```
cupsaddsmb -H cerberus -U root -h pandora -v Epson

Password for root required to access cerberus via SAMBA: 

Running command: rpcclient cerberus -N -U'root%fl3085' -c 'setdriver Epson Epson'

cli_nt_session_open: cli_nt_create failed on pipe \spoolss to machine cerberus.  Error was NT_STATUS_OBJECT_NAME_NOT_FOUND

Could not initialise \PIPE\spoolss

Password for root required to access cerberus via SAMBA: 

```

plz help me solve this problem

ps my print server is not my samba server but in linux i can print with the samba server.

----------

## joris-fr

 *///lodder\\\ wrote:*   

> I have used this tutorial to install samba, but when i want to use the printer in windows i get the error:
> 
> ```
> there are incorrect drivers installed on the server
> ```
> ...

 

Spoolss or Spools ??

I have too a problem : I can print directly from Linux, but I can't print via Samba.

I followed the tutorial, beside I have a Dell 1700n and I have no clue where I can get the PPD file  :Question:   :Question: 

----------

## soroh6

The only real problems that I think I was having was that Client for Microsoft Networks wasn't clicked on my Windows device.

Other than that.. I'm re-configuring cups at the moment.

HTH.

----------

## sobers_2002

could some1 lemme know how to make user specific print logs???

as in i want that at the end of month i should have a nice

printable file showing which user printer how many docs.....also

what is needed is that all docs that could not be printed should

not be added to the user .....like he pressed print but due to some

error it didn;t get printed so it should no be added.

----------

## blubbi

Okay, I got every thin up and running, the only problem are the drivers for windows....

Everytime I try to add the drivers I get the following output:

 *Quote:*   

> 
> 
> root@ws1-iut $  cupsaddsmb -H ws1-iut -U root -h ws1-iut.medizin.uni-halle.de -v -a
> 
> Password for root required to access ws1-iut via SAMBA:
> ...

 

but al ls -lah /etc/samba/printer/

 *Quote:*   

> 
> 
> root@ws1-iut $ ls -lah /etc/samba/printer/
> 
> total 8.0K
> ...

 

Does anyone have a clou where I mad a mistake?

ls -la /usr/local/share/cups/drivers/

 *Quote:*   

> 
> 
> root@ws1-iut $ ls -lah /usr/local/share/cups/drivers/
> 
> total 524
> ...

 

ls -la /usr/share/cups/drivers/

 *Quote:*   

> 
> 
> root@ws1-iut $ ls -la /usr/share/cups/drivers/
> 
> total 524
> ...

 

here's my smp.conf file:

 *Quote:*   

> 
> 
> [global]
> 
>         dos charset = 850
> ...

 

So any ideas?

----------

## maiku

Sorry to butt in real quick, but when I print from a windows machine using openoffice and the document contains pictures (as well as words) only one picture will print out. *Quote:*   

> application/octet-stream

 is uncommented in mime.types and  *Quote:*   

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

 uncommented in mime.convs 'cause I thought that might be the problem.  The drivers installed on the windows computers were taken from the printer website and are the most up to date windows drivers.  All other printing seems to have worked perfectly until this incident.  Although openoffice has never had to print a document with both pictures and text until now.

----------

## jerrybme

Hi all:

I've been trying for several days to get this to work. Searched my little fingers to the bone, but no luck so far. I've got CUPS working fine from my linux box, but am trying to share the printer attached to it to the winblows machines on my wireless network (all XP). I've followed the How-to at the begining of this thread. When I try to add a user I get an error

```
Failed to open account policy database
```

This happens when I try with smbpasswd or pdbedit commands.

Here's my smb.config file

```
[global]

  netbios name = tuxbox

  workgroup = WORKGROUP    # set your windows network

  #workgroup workgroup

  server string = Samba Server %v

  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

  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo eth0

bind interfaces only = yes

 # interfaces = eth0             # the interface to the local network

  security = user

   passdb backend = tdbsam

   hosts allow = 127.0.0.1 192.168.1.0/24

hosts deny = 0.0.0.0/0

  

  [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 

  

  [Epson-C80] # the name is arbitrary, but should be consistent throughout

                # Samba and CUPS!

  comment = Epson C80 Printer

  #printable = yes

  #path = /var/spool/samba

  public = yes

  guest ok = yes

  print command= /usr/bin/lpr -r -P %p -l %s

   path = /var/spool/samba

   create mask = 0644

   browseable = yes

   writable = no

   printable = yes

   print command = /usr/bin/lpr -r -P %p -l %s

   lpq command = /usr/bin/lpq -P %p

   lprm command = /usr/bin/lprm -P %p %j

   lppause command = /usr/bin/lp -i %p-%j -H hold

   lpresume command = /usr/bin/lp -i %p-%j -H resume

   queuepause command = /usr/bin/disable %p

   queueresume command = /usr/bin/enable %p

   use client driver = 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 
```

----------

## jerrybme

 *jerrybme wrote:*   

> Hi all:
> 
> I've been trying for several days to get this to work. Searched my little fingers to the bone, but no luck so far. I've got CUPS working fine from my linux box, but am trying to share the printer attached to it to the winblows machines on my wireless network (all XP). I've followed the How-to at the begining of this thread. When I try to add a user I get an error
> 
> ```
> ...

 

Well, I finally muddled through this one, although still not sure what was wrong with the smb.conf above. I solved this by ditching my current smb.conf and started over with the smb.cong.example and edited to fit my situation. When I restarted Samba it worked fine. And I was able to add user.

----------

## spaceturtle

I have followed the guide, and I think everything works until I get to the windows driver section.  I issue the command: 

```
cupsaddsmb -H Gentoo-print -U root -h Gentoo-print -v -a
```

This gives me no output, just puts me at another prompt.

If I try 

```
 cupsaddsmb -H Gentoo-print -U root -h Gentoo-print -v DeskJet895Cxi
```

I get the output: 

```
cupsaddsmb: Unable to connect to server "Gentoo-print" for DeskJet895Cxi - Success

```

On the windows machine, they cannot connect to //PrintServer like the guide says, and when they add a network printer, they see a computer called GENTOO (obviously me) but no printer attached to it.

What do I do?

----------

## gatiba

 *krader wrote:*   

> I have samba and cups configured to allow a Windows XP machine to connect to my linux one, and I can add the printer from Windows directly from the local network (via Samba), or using http://X.X.X.X:631/printers/HPDESKJET720C (now, you know my printer). I can access everything, but, when I print anything from windows, it sends the data to the linux machine, but the printer doesn't do anything. I've used tcpdump to capture the network traffic to see if there is traffic exange, and it exists, whith all the data and ACKs. So here is my question:
> 
> ¿Why cannot I print from windows via or not via Samba?
> 
> When I were a Mandrake user, I configure cups to allow to print directly to the address before, and it worked, so I think it should be something mandrake did but gentoo doesn't.
> ...

 

I have the same exact problem!

Anyone helps?

My smb.conf:

```

[global]

   log file = /var/log/samba3/log.%m

   load printers = yes

   smb passwd file = /etc/samba/private/smbpasswd

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   map to guest = bad user

   encrypt passwords = yes

   printer admin = @adm

   dns proxy = no 

   netbios name = ZEUS

   printing = cups

   server string = Samba Server %v

   workgroup = UFFICIO

   os level = 20

   printcap name = cups

   security = user

   max log size = 50

[homes]

   comment = Home Directories

   browseable = no

   writable = yes

[printers]

   lpq command = /usr/bin/lpq -P %p

   public = yes

   lprm command = /usr/bin/lprm -P %p %j

   allow hosts = 127.0.0.1 192.168.2.*

   use client driver = yes

   browseable = no

   printable = yes

   print command = /usr/bin/lpr -r -P %p -l %s

   lpresume command = /usr/bin/lp -i %p-%j -H resume

   path = /var/spool/samba

   queuepause command = /usr/bin/disable %p

   comment = All Printers

   lppause command = /usr/bin/lp -i %p-%j -H hold

   queueresume command = /usr/bin/enable %p 

   create mode = 0700

[print$]

   path = /var/lib/samba/printers

   browseable = yes

   read only = yes

   write list = @adm root

   guest ok = yes

```

----------

## j79zlr

For the cupsaddsmb problem, run the rpcclient command manually, I have an example here:

https://forums.gentoo.org/viewtopic-t-277315-highlight-cupsaddsmb.html

This really should get filed as a bug.

----------

## spaceturtle

I tried to manually add the driver.  I got this error:

```
gentoo turtle # rpcclient localhost -N -U'root%thisistheend' -c 'adddriver "Windows NT x86" "DeskJet895Cxi:cupsdrv5.dll:hp845c.ppd:cupsui5.dll:cups5.hlp:NULL:RAW:NULL"'

WARNING: The "write cache size" option is deprecated

Error connecting to 127.0.0.1 (Connection refused)

cli_full_connection: failed to connect to LOCALHOST<20> (127.0.0.1)

Cannot connect to server.  Error was NT_STATUS_UNSUCCESSFUL

```

I dont know what server it expects to connect to (if it isnt 127.0.0.1).  Any ideas?

Thanks.

----------

## j79zlr

You need samba running with a print$ share.

----------

## fnjordy

After working with this a bit and with some help from the Cups guys I have found the following:

First get your PPD file via linuxprinting.org, or copy the one generated by Gimp-Print.  Configure CUPS via the web interface.

Example samba configuration, here I set the Samba server as the domain master and a WINS server.  You have to setup one section per printer, the Samba documentation implies you do not, and generally you do not, but for driver Point and click install you do.

```

[global]

  workgroup = WORKGROUP

  netbios name = HOSTNAME

  encrypt passwords = yes

# for installing drivers we need user, for runtime we need share

#  security = user

#  guest ok = no

#  use client driver = no

  security = share

  guest ok = yes

  use client driver = yes

# domain master browser

  domain master = yes

  local master = yes

  preferred master = yes

  os level = 65

# wins server

  wins support = yes

# printing stuff

  load printers = yes

  browseable = yes

  printing = cups

  printcap name = cups

[HPLaserJet1160]

  comment = HP LaserJet 1160 Network Printer

  printable = yes

  path = /var/spool/samba

  public = yes

  guest ok = yes

  printer admin = root

[EpsonStylusColour600]

  comment = Epson Stylus Colour 600 Network Printer

  printable = yes

  path = /var/spool/samba

  public = yes

  guest ok = yes

  printer admin = root

[printers]

  comment = All Printers

  path = /var/spool/samba

  browseable = no

  public = yes

# setting depends on your requirements

  guest ok = yes

  writable = no

  printable = yes

  printer admin = root

[print$]

  comment = Printer Drivers

  path = /etc/samba/drivers

  browseable = yes

  guest ok = yes

  read only = yes

  write list = root

```

Befor you continue make sure you have a Samba password for root:

```

smbpasswd -a root

```

Do not use the CUPS 1.x or CUPS 5.x Windows Postscript drivers, they are obsolete.  One example defect is that printing large images with Microsofts "Windows Fax and Picture Viewer" will output blank pages.  Use the Adobe / Microsoft Poscript driver 1.0.6 (here).  You will have to install the drivers manually on one machine and copy the files to your Samba server, you are after PSCRIPT5.DLL, PS5UI.DLL, PSCRIPT.HLP, and PSCRIPT.NTF.  Copy these files into /usr/share/cups/drivers or /usr/local/share/cups/drivers depending on your configuration, along with the PPD file for your printer.  Then setup Samba to install these files.

```

[global]

  security = user

  guest ok = no

  use client driver = no

#  security = share

#  guest ok = yes

#  use client driver = yes

```

Restart Samba with /etc/init.d/samba restart.

Tell Samba to copy the driver files to its root (/etc/samba/drivers), the example here I am using a Epson Style Colour 600 and its PPD file called "EpsonStylusColour600.ppd".  Replace hostname and password as appropriate.

```

smbclient //hostname/print\$ -U 'root%password' -c 'cd W32X86; put /etc/cups/ppd/EpsonStylusColour600.ppd  EpsonStylusColour600.ppd; put /usr/share/cups/drivers/PSCRIPT5.DLL pscript5.dll; put /usr/share/cups/drivers/PS5UI.DLL ps5ui.dll; put /usr/share/cups/drivers/PSCRIPT.NTF pscript.ntf; put /usr/share/cups/drivers/PSCRIPT.HLP pscript.hlp'

Domain=[HOSTNAME] OS=[Unix] Server=[Samba 3.0.13]

putting file /etc/cups/ppd/EpsonStylusColour600.ppd as \W32X86\EpsonStylusColour600.ppd (5752.0 kb/s) (average 5752.0 kb/s)

putting file /usr/share/cups/drivers/PSCRIPT5.DLL as \W32X86\pscript5.dll (7408.3 kb/s) (average 7132.3 kb/s)

putting file /usr/share/cups/drivers/PS5UI.DLL as \W32X86\ps5ui.dll (6631.5 kb/s) (average 7027.7 kb/s)

putting file /usr/share/cups/drivers/PSCRIPT.NTF as \W32X86\pscript.ntf (7442.9 kb/s) (average 7249.2 kb/s)

putting file /usr/share/cups/drivers/PSCRIPT.HLP as \W32X86\pscript.hlp (5085.4 kb/s) (average 7195.1 kb/s)

```

Confirm the files are uploaded by looking at the drivers directory:

```

find /etc/samba/drivers/

/etc/samba/drivers/

/etc/samba/drivers/W32X86

/etc/samba/drivers/W32X86/PSCRIPT5.DLL

/etc/samba/drivers/W32X86/EpsonStylusColour600.ppd

/etc/samba/drivers/W32X86/PS5UI.DLL

/etc/samba/drivers/W32X86/PSCRIPT.HLP

/etc/samba/drivers/W32X86/PSCRIPT.NTF

```

Next we need Samba to add the details of this driver to its internal database.

```

rpcclient localhost -Uroot%password -c 'adddriver "Windows NT x86" "EpsonStylusColour600:pscript5.dll:EpsonStylusColour600.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf"'

Printer Driver EpsonStylusColour600 successfully installed.

```

Check the driver directory contents and Samba should have moved the files.

```

find /etc/samba/drivers/

/etc/samba/drivers/

/etc/samba/drivers/W32X86

/etc/samba/drivers/W32X86/3

/etc/samba/drivers/W32X86/3/pscript5.dll

/etc/samba/drivers/W32X86/3/EpsonStylusColour600.ppd

/etc/samba/drivers/W32X86/3/ps5ui.dll

/etc/samba/drivers/W32X86/3/pscript.hlp

/etc/samba/drivers/W32X86/3/pscript.ntf

```

Then we tell Samba to use this driver for the printer.

```

rpcclient -Uroot%password -c 'setdriver EpsonStylusColour600 EpsonStylusColour600' localhost

Succesfully set EpsonStylusColour600 to driver EpsonStylusColour600.

```

Confirm the installed printers:

```

rpcclient -Uroot%password -c 'enumprinters' localhost

        flags:[0x800000]

        name:[\\hostname\HPLaserJet1160]

        description:[\\hostname\HPLaserJet1160,HPLaserJet1160,HP LaserJet 1160 Network Printer]

        comment:[HP LaserJet 1160 Network Printer]

        flags:[0x800000]

        name:[\\hostname\EpsonStylusColour600]

        description:[\\hostname\EpsonStylusColour600,EpsonStylusColour600,Epson Stylus Colour 600 Network Printer]

        comment:[Epson Stylus Colour 600 Network Printer]

```

Confirm details of printer:

```

rpcclient -Uroot%password -c 'getprinter EpsonStylusColour600 2' localhost

        servername:[\\LOCALHOST]

        printername:[\\LOCALHOST\EpsonStylusColour600]

        sharename:[EpsonStylusColour600]

        portname:[Samba Printer Port]

        drivername:[EpsonStylusColour600]

        comment:[Epson Stylus Colour 600 Network Printer]

        location:[]

        sepfile:[]

        printprocessor:[winprint]

        datatype:[RAW]

        parameters:[]

        attributes:[0x1048]

        priority:[0x1]

        defaultpriority:[0x1]

        starttime:[0x0]

        untiltime:[0x0]

        status:[0x0]

        cjobs:[0x2]

        averageppm:[0x0]

```

Confirm that the Windows driver is configured:

```

rpcclient -Uroot%password -c 'getdriver EpsonStylusColour600' localhost

[Windows NT x86]

Printer Driver Info 3:

        Version: [3]

        Driver Name: [EpsonStylusColour600]

        Architecture: [Windows NT x86]

        Driver Path: [\\LOCALHOST\print$\W32X86\3\pscript5.dll]

        Datafile: [\\LOCALHOST\print$\W32X86\3\EpsonStylusColour600.ppd]

        Configfile: [\\LOCALHOST\print$\W32X86\3\ps5ui.dll]

        Helpfile: [\\LOCALHOST\print$\W32X86\3\pscript.hlp]

        Dependentfiles: [\\LOCALHOST\print$\W32X86\3\pscript.ntf]

        Monitorname: []

        Defaultdatatype: [RAW]

```

If more than one driver is listed you can only delete the entire set by using the following, then start again with smbclient to upload the files.

```

rpcclient -Uroot%password -c 'deldriver EpsonStylusColour600' localhost

```

Update the configuration to allow clients to access:

```

[global]

#  security = user

#  guest ok = no

#  use client driver = no

  security = share

  guest ok = yes

  use client driver = yes

```

Restart Samba with /etc/init.d/samba restart.

Then goto a new PC and browse to you Samba server,e.g. Run -> "\\HOSTNAME"  and double click on the Printer name - do not use the icon in the Printers directory, use the one on the base of the server share.  Windows will download and install the driver and popup a status Window with the current print jobs.Last edited by fnjordy on Thu May 05, 2005 4:31 am; edited 1 time in total

----------

## frozenJim

man... that just frosts my NUGGETS!!  How can I have wasted so much time on a boneheaded mistake like that!

This was the fix for me as well.  I didn't comment the line out, I changed "use client driver" to "no" in /etc/samba/smb.conf and now cupsaddsmb works just fine... no WERR_ACCESS_DENIED error.

```
[officejet]

comment = HP OfficeJet 5510

printable = yes

path = /var/spool/officejet

public = no

guest ok = no

printer admin = root

use client driver = no
```

sigh....   

 *Quote:*   

> 
> 
> Problem:
> 
> ```
> ...

 

----------

## Sangre

How I can share linux printer to windows workstation without samba?

----------

## klatk

For the longest time I had a problem with all of my windows printjobs just being gibberish and I thought I'd set everything up correctly to accept RAW input. CUPS and Samba were working. My windows boxes had the correct drivers, and the two mime.types and mime.convs lines were uncommented. It turns out that I needed to set up the shared printer without a PPD! I had to use lpadmin and not the CUPS web interface.

lpadmin -p PrinterName -E -v usb:/dev/lp0

And then had to choose the shared printer without the PPD, and I was set.

Sangre,  you can share via CUPS without Samba, only the printer won't show up under the network browsing. If you've got CUPS working, then any windows box can access the printer thru port 631.

http://192.168.0.xxx:631/printers/Printername

----------

## mikejr

Ok this thing is kicking my ....

When I enter:

```

cupsaddsmb -H localhost -U root -h localhost -v OkiC9500-E

```

I get:

```

# cupsaddsmb -H localhost -U root -h localhost -v OkiC9500-E

Password for root required to access localhost via SAMBA:

Running command: rpcclient localhost -N -U'root%#######' -c 'setdriver OkiC9500-E OkiC9500-E'

Succesfully set OkiC9500-E to driver OkiC9500-E.

```

I have gone through everything for hours and still get the problem....   Any suggestions?

----------

## fnjordy

 *Sangre wrote:*   

> How I can share linux printer to windows workstation without samba?

 

There's a new cups driver for Windows you can try.

http://cups.org/links.php?V135

 *mikejr wrote:*   

> Ok this thing is kicking my ....
> 
> When I enter:
> 
> ```
> ...

 

Read my post above, cupsaddsmb is broken.

----------

## chovy

this was all great. Once I figured out your example uses /etc/samba/drivers, and the Gentoo Guide uses /etc/samba/printer

Good job though!

----------

## xonner

Well i followed everything, i also tried many how-tos but i still get the same error. I have an Epson Stylus Color CX3200, it's working with cups locally, it works with samba when i install the windows drivers, but when i add it to a windows machine via samba without the drivers already installed, Windows ask me to search for the recommended driver elsewhere cos the server doesn't have the driver. I guess it sould be getting the driver from the server but there's a problem, when i run cupsaddsmb i always get this:

```

morpheus samba # cupsaddsmb -H localhost -U root -h localhost -a

cupsaddsmb: No PPD file for printer "CX3200" - skipping!

morpheus samba # cupsaddsmb -H localhost -U root -h localhost -v CX3200

cupsaddsmb: No PPD file for printer "CX3200" - skipping!

morpheus samba # ls /etc/cups/ppd/

cx3200.ppd

```

```

morpheus samba # ls /usr/share/cups/drivers/

cups-samba.ss  cups5.hlp  cupsdrv5.dll  cupsui5.dll  cx3200.ppd

morpheus samba # ls /usr/local/share/cups/drivers/

cups-samba.ss  cups5.hlp  cupsdrv5.dll  cupsui5.dll

```

Well i think everything is in place!!

My smb.conf file:

```

morpheus samba # cat /etc/samba/smb.conf

[global]

workgroup = VIPERS

netbios name = MORPHEUS

server string = Morpheus Samba Server %v

printcap name = cups

printing = cups

load printers = yes

log file = /var/log/samba/log.%m

max log size = 50

socket options = TCP_NODELAY

interfaces = lo eth0

bind interfaces only = yes

hosts allow = 127.0.0.1 192.168.0.0/24

hosts deny = 0.0.0.0/0

security = user

guest account = samba

guest ok = no

use client driver = no

;vfs object = vscan-clamav

;vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

[homes]

comment = Home Directories

browseable = no

writable = yes

[print$]

comment = Printer Drivers

path = /etc/samba/drivers # this path holds the driver structure

guest ok = yes

browseable = yes

read only = yes

write list = root

[Epson_CX3200]

comment = Epson Stylus Color CX3200

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

printer admin = root

[printers]

comment = All Printers

browseable = no

printable = yes

writable = no

public = yes

guest ok = no

path = /var/spool/samba

printer admin = root

printer name = cx3200

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/samba/public

```

I would really like to know what the problem is, hope someone can help me cos i think i'm about to give up!!  :Shocked:  LOL

Thanks

----------

## basicx

Hi all,

I've just spent two evenings on getting this to work with my Samsung ML-1610 and finally succeeded! In retrospect, things went relatively smooth, but there's one thing I want to share with you. Hope it helps!

If cupsaddsmb gives you a hard time (in my case the adddriver command of rpcclient returned the rather obscure WERR_ACCESS_DENIED), try commenting out the lines in your smb.conf that enable on-access virus scanning. In my case (with ClamAV) these are:

```

vfs object = vscan-clamav

vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

```

Restart samba, empty your print$ directory and try again. If all goes well and the rpcclient commands (adddriver and setdriver) terminate successfully, you can uncomment the lines above again, to re-enable on-access scanning.

This worked for me; probably because clamav was bugging, but I didn't bother to figure out precisely what went wrong.

Good luck!

----------

## fbcyborg

Hi!

I tryed to do 

```

cupsaddsmb -H PrintServer -U root -h PrintServer -v HP

```

but I get a strange message...

```
cupsaddsmb: Unable to connect to server "PrintServer" for HP - Success
```

what can I do? Success   :Shocked:  or Error????

if I write the command line:

```
cupsaddsmb -H PrintServer -U root -h PrintServer -a
```

I get no error message... 

I think it's ok..   Isn't so?

----------

## darkphader

 *Sangre wrote:*   

> How I can share linux printer to windows workstation without samba?

 

Windows 2k/XP/2k3 can all print via IPP which is what CUPS uses. You don't need Samba, just set up the Windows boxen to print via IPP. CUPS can also expose LPD if neccessary.

Chris

----------

## darkphader

 *fnjordy wrote:*   

> Read my post above, cupsaddsmb is broken.

 

To use the new CUPS version 6 drivers via cupsaddsmb you need to compile the updated cupsaddsmb.c and replace your current cupsaddsmb the the resulting one. I use a modified cups ebuild to handle this.

The current shipping cupsaddsmb is fine for the older CUPS driver, as well as the Adobe and the MS PS drivers.

EDIT: I filed the patches I use to update cupsaddsmb.c and the ebuild at bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=111272

Chris

----------

## jmaltais

I had a problem adding users with pdbedit until I removed the "locking directory" option.  The directory didn't exist in the first place so "smbstatus" would give errors.  So I deleted it and things seem to work fine!

----------

## jni_

Hello

I have a strange problem. I have followed this howto as good as possible. The only thing which is not working is the cupsaddsmb part. Look here:

```

G-PDC ~ # ls -la /usr/share/cups/drivers/

total 524

drwxr-xr-x   2 root root   4096 Dec 12 13:37 .

drwxr-xr-x  10 root root   4096 Dec  9 14:47 ..

-rwxr-xr-x   1 root root  14234 Sep 24  2002 cups5.hlp

-rwxr-xr-x   1 root root 280268 Jan  3  2004 cupsdrv5.dll

-rwxr-xr-x   1 root root 219540 Jan  3  2004 cupsui5.dll

G-PDC ~ #

```

The driver is present on the system.

```

G-PDC ~ # lpstat -a

test-hell116 accepting requests since Jan 01 00:00

G-PDC ~ #

```

Cups sees the printer, and I have verified that I can actually print to the printer without problems.

Now I do the cupaddsmb part:

```

G-PDC ~ # cupsaddsmb -H localhost -U root -h localhost -v test-hell116

Password for root required to access localhost via SAMBA:

Running command: rpcclient localhost -N -U'root%<xxxx>' -c 'setdriver test-hell116 test-hell116'

Connecting to host=localhost

Connecting to 127.0.0.1 at port 445

Doing spnego session setup (blob length=58)

got OID=1 3 6 1 4 1 311 2 2 10

got principal=NONE

Got challenge flags:

Got NTLMSSP neg_flags=0x60890215

NTLMSSP: Set final flags:

Got NTLMSSP neg_flags=0x60080215

NTLMSSP Sign/Seal - Initialising with flags:

Got NTLMSSP neg_flags=0x60080215

lsa_io_sec_qos: length c does not match size 8

Succesfully set test-hell116 to driver test-hell116.

G-PDC ~ #

```

Here is the printer from the printers.conf

```

# Printer configuration file for CUPS v1.1.23

# Written by cupsd on Mon Dec 12 13:33:04 2005

<DefaultPrinter test-hell116>

Info HP LaserJet 4250

Location Hellerup, IT

DeviceURI lpd://10.17.21.216

State Idle

Accepting Yes

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

</Printer>

```

Here is the print* from my smb.conf

```

[printers]

        comment = All Printers

        path = /var/spool/samba

        printer admin = root

        guest ok = Yes

        printable = Yes

        browseable = No

[print$]

        comment = Printer Drivers

        path = /etc/samba/drivers

        write list = root

```

I have tried with and without a share with the printers name. It gives me the same result(s).

So, can any1 explain to me what I'm doing wrong? Is it because I'm using lpd instead of a real attached device that the cupsaddsmb is not running the smbclient part?

----------

## mephist0

Did on my server exactly as described in the first post....

Works PERFECT !!!

THANKS !!!

used Canon IP4200

----------

## alexlm78

I like it, well done.

----------

## opopanax

I have been trying to get cups working with samba to install printers on windows clients for approximately 18 months.  no matter what i do, which howto I follow, which windows client i'm using, or whatever, windows will not recognize that there is a set of drivers for CUPS in $print.  is cupsaddsmb not actually working?  Windows always always always says that "the server does not have the drivers installed" and wants me to locate a *.inf file for it.

This is the only thing that I have failed to get working in gentoo, ever, and it is frustrating beyond words.  I'd love if someone could walk me through it, because SOMETHING has to be missing.

----------

## opopanax

I don't know why I've wasted my time with this for so long...  I guess I just wanted more-than-basic functionality with cups and samba.  I just broke down and did it the easy way:  I downloaded the *free* (not open source) printpro client for windows at http://www.easysw.com/printpro/software.php, and had the printer installed within moments.

If you have a cups server, you want to print with windows, get this client software installed, and save yourself potential headaches.

----------

## Po0ky

To use the new cups (testing) windows drivers:

(Wiki) Talk: HOWTO Native Windows...

If it isn't here anymore, I hope somebody moved it to the main article

----------

## crys0000

I have installed the Adobe PostScript drivers, but they don't support color printing (at least with my Epson Stylus CX6600). Do Printpro and CUPS drivers support colors?

Thanks

----------

## darkphader

 *crys0000 wrote:*   

> I have installed the Adobe PostScript drivers, but they don't support color printing (at least with my Epson Stylus CX6600). Do Printpro and CUPS drivers support colors?

 

Use postscript drivers (along with the proper PPD) when you have a real postscript device, one with a postscript print engine. I don't know if that Epson is such a device.

One way to test is to setup the printer with a raw queue and print a test page directly from CUPS. CUPS will send its testpage as postscript and the output will answer this question.

The Windows CUPS drivers (if that's what you're referring to) work hand in hand with the Adobe or Microsoft postscript drivers. To support Windows printing to a non-PS printer managed by CUPS, I usually find it best to use a raw queue and install the proper Windows drivers on the client. Most PS printers (but not all) will work fine with CUPS+Adobe(or MS) PS drivers; those that don't can be setup like non-PS devices.

Chris

----------

## pgjensen

SAMBA + PRINTING = SUCK

i used ESP printpro and worked like a charm on windows client to access my linux cups server to print.

----------

## erik258

 *Quote:*   

> 
> 
> it is frustrating beyond words
> 
> 

 

Yeah, I'll say.  

I've been working on this two short days and already I'm wishing banging my head against the wall didn't hurt so much... 

here's where I have problems...

```

matty cups # rpcclient -Uroot%* -c 'getdriver Printy_McPrinter' localhost

result was WERR_UNKNOWN_PRINTER_DRIVER

```

I followed the directions but I was a little confused and didn't update my smb.conf file to not load print drivers the first time.  So I got those results.  Then I went through again, with smb.conf set up properly 

```

use client driver = no

```

The changing of the 'use client driver' field to 'no' seems to be the problem but changing my smb.conf didn't help....

yes, i am sooooo frustrated... somehow samba printing is soo much more frustrating than cups.  

Tryin'  this website now... http://prdownloads.sourceforge.net/cupsclient/CupsClient.zip?download

----------

## erik258

see my other post.

use that cups client instead.  

it works great.  download from that link from my other post.

then read the readme & follow instructions.

the program's in german, i suggest babelfish to see whether that goofie word means 'successful' or 'failed'.  sorry, i wanted to include that info here but i'm getting pretty inept in windoze and accidentally closed the window from babelfish before I could copy that german word.  ; )

so yeah , don't even bother with this samba printer crap.  

ps i got the adobe postscript drivers to work fine, but windoze thinks they're the wrong ones. you have to install manually on the windoze box.  it says color isn't supported, but the adobe icon looks like color... my cartridges are running out of ink.  

thanks everyone for all the help.

----------

## chovy

I get the cupsaddsmb error when trying to get my driver able to download to windows XP:

 *Quote:*   

> spring drivers # cupsaddsmb -H localhost -U root -a -v
> 
> Password for root required to access localhost via SAMBA:
> 
> Running command: rpcclient localhost -N -U'root%pont00ns' -c 'setdriver HPDeskJet6122 HPDeskJet6122'
> ...

 

My printer works fine locally (linux print with printer on usb device), but I can't get my XP box to install the driver over samba. It sees the printer, but says "network printer does not have drivers installed"

----------

## erik258

check out the german utility to install native XP cups printing drivers.

granted it'd be nice if it worked invisibly, but it doesn't.  Whatcha gonna do.

BTW if you figure this out I would love to hear how you did it.  I think maybe things have changed since this howto began

ps looks like a malformed line in smb.conf

----------

## chovy

 *neurosis wrote:*   

>  *blibbleage wrote:*    *theklone wrote:*   
> 
> ```
> Password for root required to access localhost via SAMBA: 
> 
> ...

 

I tried installing  a new printer (old one worked fine using this method). So I have the old ps* files in /etc/samba/printer/W32X86/3 (you have cups* files though (i choose ps earlier vs. cups method)...anyway, I don't know which ps* file corresponds with the cups* files you used:

the command I ran is:

```
rpcclient spring -N -U'root%xxxxxx' -c 'adddriver "Windows NT x86" "HPDeskJet6122:pscript5.dll:HPDeskJet6122.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:NULL"'

which returns:

WARNING: The "printer admin" option is deprecated

result was WERR_BADFILE

```

I'm about ready to give up, this is killing me and my head hurts  :Sad: 

The files I have are:

 *Quote:*   

> spring 3 # pwd
> 
> /etc/samba/printer/W32X86/3
> 
> spring 3 # ls -l
> ...

 

trying to run this *rpcclient* command.

----------

## atdsm

Excellent HOWTO! It doesn't work with the brand new CUPS 6.0 windows drivers, though, because some things have changed. I wrote up a bit of an explanation of how to use the CUPS 6.0 windows drivers with Samba, referencing this howto heavily while working.

If you would like to integrate the information into your HOWTO, please do. Or, just direct people to mine...

HOWTO - Samba & CUPS 6.0 Windows Postscript Drivers

----------

## erik258

dear atdsm

props.  your howto looks extremely useful.

my fix was to use some german native-windows native-cups drivers, not in my native language but thanks to babelfish clear enough.

but it would be so cool if i didn't have to install on windows boxes.  

I look forward to getting this working.  Thanks a ton.

----------

## geskorup

Damn.. well here's the story.

I'm running FreeBSD and recently I pulled in a new ports tree and updated all of my installed ports, SAMBA, CUPS and everything. That must have toasted some database. So there I was, no settings preserved trying to remember how I got Windows past the.. the server doesn't have the correct drivers installed... blah blah..

cupsaddsmb just wasn't doing it for some reason. So here's what I did..

Pulled all of the printer drivers from my Windows machine installed in c:\windows\system32\spool\drivers\w32x86\3

to my FreeBSD machine's configured drivers path (/usr/local/share/cups/drivers/W32X86/3).

Then finally, skipped cupsaddsmb and modified the command it runs to look like the following..

rpcclient localhost -N -U'root%password' -c 'setdriver laserjet "HP LaserJet 4L"'

Cupsaddsmb would run: rpcclient localhost -N -U'root%password' -c 'setdriver laserjet laserjet'

My printer is a HP LaserJet 4L connected to the parallel port and is called laserjet in /etc/printcap. Windows obviously found the correct driver by the printer model, not the name.

Sometimes you just gotta get things done manually. I hope this will work for others.

----------

## Shade_MDK

But...I have a question..

A couple of days ago.. i've installed 2 printers on a gentoo machine..designated to be used by networked windows machines..

Fortunatelly only windows xp, UNfortunatelly 2 versions of ms win, with and without Service pack 2, and 

it seems that those machines who have updated windows xp to service pack 2 usually print slower..than those who have only service pack 1 (but i've experienced even sistem jam on winxp sp2!!)

The printers are on a clasic share ..and the story is more complicated..

because one of the 2 printers does not have it's own drivers cause i could't find it anywhere.. (kyocera FS-720) it uses another driver

from another model..

But the problem is with both printers..not only with this one ..

(I should mention that the other one it's an HP 2100 that has drivers..)

I was thinking about IPP but since the local printer driver is not exactly for the installed printer.. it might not work/..

anyone ..?

anything?

----------

## atdsm

I really have no idea there... I'm not a sysadmin by a long shot.

----------

## nordi80

I'm using samba to share a local installed printer for Windows-XP users. I have done the manual above, but if I want to connect to the printer with an Windows-XP client I need to select driver because it can't find them. What could be the reason?

----------

## Shade_MDK

Install you printer driver on the PC running Windows XP just like you would install the printer locally (actually you will just copy the printer driver in windows )

When you'll browse the network go to the server double click on the shared printer.. and it will say that there are no printer drivers on the remote server you are trying to install, 

tell windows that you shall install drivers maually.. (don't install drivers ..I will select them from a list -..i think that's the option) then either browse the printer windows that will appear...and find the previously installed drivers...or browse for the drivers in the place where you have them.

If the printer is installed ok on the linux machine (actually you can make a print test) and the correct drivers are installed on  it, it should work fine from windows. at least on windows XP with SP1 installed..I don't know about SP2..i'm having some trouble with it.

There's also IPP printing with cups ..and it might work better..but I haven't tried that yed..as I undestand windows ..is having some problems with ipp ip-s instead of names acces.

----------

## KaiNeR

i'm trying to get my HPDeskjet 5650c printer working on the network, i've been following the gentoo-cups-samba howto and i've got to the point to install the windows drivers

when i enter

cupsaddsmb -H gentoo -U root -h gentoo -v -a

I then enter the password but recieve the following error

Error was NT_STATUS_UNSUCCESSFUL

I'm using the same password as i created for 

smbpasswd -a root

can anyone help

----------

## oxymoron

 *geskorup wrote:*   

> Damn.. well here's the story.
> 
> I'm running FreeBSD and recently I pulled in a new ports tree and updated all of my installed ports, SAMBA, CUPS and everything. That must have toasted some database. So there I was, no settings preserved trying to remember how I got Windows past the.. the server doesn't have the correct drivers installed... blah blah..
> 
> cupsaddsmb just wasn't doing it for some reason. So here's what I did..
> ...

 

You are right!!!

I had a same problem but with the name like hp_laserjet_1010_USB_1 and when

i changed it with 

```
rpcclient localhost -N -U'root%password' -c 'setdriver hp_laserjet_1010_USB_1 "HP LaserJet 1010"'
```

and did /etc/init.d/samba restart (i don't know if it is necessary ) then there was no more error with not right driver for Win XP client. It just done successful instalation  

of the printer.......

----------

## Mr.QNo

Dear daff,

great guide  :Smile:  I succeeded in most things (clamav works fine, printers are recognized), but there still is one problem.

```
multi /etc/samba/printer # cupsaddsmb -v -a

Password for root required to access localhost via SAMBA:

Running command: rpcclient localhost -N -U'root%XXXXXXXX' -c 'setdriver HP4000 HP4000'

Succesfully set HP4000 to driver HP4000.

Running command: rpcclient localhost -N -U'root%XXXXXXXX' -c 'setdriver HPDJ840C HPDJ840C'

Succesfully set HPDJ840C to driver HPDJ840C.

```

No error message, but also no copy of files to /etc/samba/printer.

What might be wrong here? What additional information is necessary to debug?

TIA

Chris

----------

## bdm

I tried adding my user, but I get this:

```

bdm mike # smbpasswd -a mike

New SMB password:

Retype new SMB password:

startsmbfilepwent_internal: file /var/lib/samba/private/smbpasswd did not exist. File successfully created.

Failed to open group mapping database

failed to initialize group mapping

Failed to open account policy database

Failed to open account policy database

Failed to open account policy database

Added user mike.

```

Any ideas?

----------

## AddictDesigns

Ok, I'm getting the famous WERR_ACCESS_DENIED error. So any help would be great! 

Here is my smb.conf

```

[Global]

        unix charset = iso8859-15

        workgroup = realm

        realm = domain

        server string = hostname

        security = ADS

        client schannel = No

        server schannel = No

        password server = password server

        username map = /etc/samba/smbusers

        log level = 3

        log file = /var/log/samba/%m.log

        max log size = 50

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        preferred master = No

        local master = No

        domain master = No

        wins proxy = Yes

        wins server = wins server

        ldap ssl = no

        idmap uid = 10000-40000

        idmap gid = 10000-40000

        template primary group =

template shell = /bin/bash

        winbind separator = +

        winbind enum users = No

        winbind enum groups = No

        winbind use default domain = Yes

        winbind nested groups = Yes

        printer admin = Printer Admins

        hosts allow = IP addresses that are allowed

        cups options = raw

        load printers = yes

        printing = cups

        printcap name = cups

[printers]

        comment = All Printers

        path = /var/spool/samba

        guest ok = Yes

        printable = Yes

        browseable = No

        write list = Admins

        printer admin = Admins

        use client driver = no

[print$]

        comment = Printer Driver Download Area

        path = /usr/windows_drivers/

        write list = Admins

        create mask = 0755

        browseable = No

        printer admin = Admins

```

My configuration looks fine from looking through this topic but I'm missing something!

I'm using the rpcclient command and it's setup right. I also got all the driver files in the folder W32X86.

Ok so any help would be great guys, if you need anything else just tell me.

----------

## Gruelius

Ive got a small problem, when printing from windows computers using the Konica Minolta Driver, when i select the printer at the print page of a program (e.g. word or adobe pdf reader) the computer will sieze up and then when i press print it will do it again. I remembered reading that there were some things i should change or else windows and samba + cups will argue and slow things down alot.

Any ideas on what i should look at? printing from my ubuntu system via the IPP address works great.

----------

## Skukfas

Hi all,

(First post..   :Laughing:  )

Specially for those, like me, that follow the Gentoo Samba3/CUPS/ClamAV HOWTO, and are having troubles with the WERR_ACCESS_DENIED, try comment the lines:

 *Quote:*   

> vfs object = vscan-clamav
> 
> vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

 

Worked for me.... after 3 days stuck with this >.<

Also had WERR_INVALID_PRINTER_NAME, but it was pretty easy to fix, just added a path to my [HPDeskjet920C], and restarted samba.

Win.

edit: btw, these posts helped me alot:

https://forums.gentoo.org/viewtopic-p-2364445.html#2364445

https://forums.gentoo.org/viewtopic-p-3276874.html#3276874

----------

## MorphiusFaydal

Whenever I do "cupsaddsmb -H localhost -U root -h localhost -v HL-2040" it asks me for my password, which I dutifully enter, then it starts scrolling "No Windows printer drivers are installed!"

I've got foomatic-{db,db-engine,filters} and the cups-windows drivers installed.

----------

## Skukfas

i also had that problem

did you try reading this post https://forums.gentoo.org/viewtopic-p-3276874.html#3276874 , "Step 1: Obtain the Microsoft Postscript drivers that CUPS needs "

and Step 3 too... in the end you should have about 7 files:

 *Quote:*   

> 
> 
> The required Microsoft drivers/files:
> 
>     * ps5ui.dll
> ...

 

in  *Quote:*   

> /usr/share/cups/drivers/

 

----------

## weni

Hello.

I'm trying to migrate old lpd server, to brand new Gentoo server with cups.

On lpd server I have virtual printers configured this way: (/etc/printcap)

```
prnt1

    :lp=/dev/null

    :mx=0

    :sd=/path/to/prnt1

prnt2

    :lp=/dev/null

    :mx=0

    :sd=/path/to/prnt2

```

It works this way: user prints a document to the virtual printer. Lpd server produces 2 txt files and puts them into /path/to/prntx dir. This files can be parsed by some script and some info can by inserted into database.

How should I configure cups, to have the same effect?

----------

## stephelton

Just thought I'd post the problem I ran in to and my solution.

I had set up the printers, got it shared with a windows machine, and had tried printing many jobs. All would fail and I would find this in my cups log:

```
PID 16862 (/usr/libexec/cups/filter/pstoraster) crashed on signal 11!
```

A long story short, I finally tried messing with the printer options under the windows machine I was trying to print from. It was trying to print at 5760x1440 dpi! Now I knew that this crappy printer wouldn't handle that, so I changed it to something more reasonable -- 720 dpi. Worked like a charm.

To access the printer options, browse to the printer, view its properties, select the General tab, click "Printing Preferences...", Select the "Paper/Quality" tab, click "Advanced..." and you'll find what appear to be the same options found under the cups web interface.

Hope that helps some people!

----------

## DaggyStyle

is this howto relevant nowadays?

----------

## slycordinator

 *DaggyStyle wrote:*   

> is this howto relevant nowadays?

 Not really, since the official gentoo docs cover pretty much the same stuff. And the official doc was updated with the fact that the windows drivers mentioned in this guide are now in portage itself, though I'm unsure if the drivers work with win7.

http://www.gentoo.org/doc/en/quick-samba-howto.xml

----------

## DaggyStyle

thanks. will try

----------

## slycordinator

I was able to make it work, though you'll need some files for generic postscript printer driver from a windows install in addition to the ones mentioned in the above link. And for some reason I couldn't get the cupsaddsmb command to work with the smb.conf supplied in the guide. I used a generic one I found elsewhere and started adding in a couple tweaks to be more like what's in the guide. YMMV.

----------

## DaggyStyle

 *slycordinator wrote:*   

> I was able to make it work, though you'll need some files for generic postscript printer driver from a windows install in addition to the ones mentioned in the above link. And for some reason I couldn't get the cupsaddsmb command to work with the smb.conf supplied in the guide. I used a generic one I found elsewhere and started adding in a couple tweaks to be more like what's in the guide. YMMV.

 

that's my problem too, when calling cupsaddsmb, it gets caught up in an endless loop

----------

## slycordinator

 *DaggyStyle wrote:*   

>  *slycordinator wrote:*   I was able to make it work, though you'll need some files for generic postscript printer driver from a windows install in addition to the ones mentioned in the above link. And for some reason I couldn't get the cupsaddsmb command to work with the smb.conf supplied in the guide. I used a generic one I found elsewhere and started adding in a couple tweaks to be more like what's in the guide. YMMV. 
> 
> that's my problem too, when calling cupsaddsmb, it gets caught up in an endless loop

 I think you have to have cups running (/etc/init.d/cupsd start) for it to work. And if you do have it running, I'm thinking you need to start samba via the same route. I had the same thing happen.

But getting rid of the loop didn't fix things for me, since that only let me hit a bunch of other errors.  :Sad: 

----------

## Ahnilated

Is this thread still active?  I have some questions/issues I would like some assistance with if it is.

TIA

----------

## zoula

First, thanks a lot for your howto !

Here are my experiences:

Samba:

- installing and configuring samba without any error messages  :Smile: 

Cups:

- cups mentioned that there is a "listen" or "Port" declaration necessary to start the daemon:

I did it the following way:

```
Listen localhost:631

Listen 192.168.178.66:631

Listen /var/run/cups/cups.sock
```

the line with the ip-adress of the server is only necessary, if you want to configure cups with the webinterface from another machine in your LAN.

- very important to say for me here is that you have to use the samba-root-password when you use the cupsaddsmb script !!!

----------

## zelycorn

Hello,

I am looking for a solution to automatically provide the printer driver for windows clients. It doesn't work actually, im in work for this since 3 days.

I have a red hat server (I know this forum is for gentoo, but the how to here concerns my issue) 5 64bits which is a domain member server. samba and domain junction is OK.

Now i have to share printers.

An USB HP P3005 is plugged. The hplip driver is ok.

I have a HP3005 printer declared on cups web interface.

I can print from the server shell. I can print from windows clients by adding a new printer directly from the samba share and select the correct driver or via a new network printer with a http://ip:631/printers/hp3005

My goal is to automate the driver step. Unfortunately for me, no one how to help me for the moment.

I had follow some tutos like the one in the first post : i copied the ps files form a windows client in a /usr/share/cups/drivers/W32X86 path. I also copied the ps files from cups.

The cupsaddsmb command never work en there was a infinite loops. It's rely on the server NT domain member role. As an ADS security is in place, a user security statement doesn't work at all.

Is someone have a tips to help me ?

[printers]

        printable = yes

        writable = no

        path = /var/spool/samba

        guest ok = yes

        public = yes

        browseable = no

[HP3005]

        printable= yes

        printer name = HP3005

        public = yes

        writable = yes

        path = /var/spool/samba

        print command = lpr -r -h -P %p %s

[HPRAW]

        printable= yes

        printer name = HPRAW

        public = yes

        writable = yes

        path = /var/spool/samba

        print command = lpr -r -h -P %p %s

[print$]

        browseable = yes

        path = /usr/share/cups/drivers

        create mask = 700

        directory mask = 700

        valid users = @"domain+Domain Users"

----------

## jozefk

Hello :)

I setup samba and I am able to connect to windows machine. I setup the CUPS as well. Still can't print.

The printer which is shared from Windows machine is connected to that PC by USB cable. It is not a network printer.

I don't know if problem is the driver I am trying to use or something else. But it seems I am very close to the solution :D

If anybody else is using a shared printer from USB on Windows machine, it would be nice to hear some idea or suggestion.

Thanks.

Best,

Jozsef

----------

