# Samba: Share linux printer with WIN (too many hours lost..)

## feld

Ok first of all.. 

SAMBA DOCUMENTATION SUCKS

it is totally UNCLEAR and every single guide i have ever come across does things 100% differently and they ALL DONT WORK.

someone PLEASE give me clear and precise instructions and / or provide a working smb.conf for my setup.

HERE'S THE DEAL

my linux box is connected via USB to an hp deskjet 3620. It prints fine under cups but requires the 3650 driver to work (same printer, smaller version)

my girlfriend's laptop is on the LAN @ 192.168.1.101. Her comp name is Shell. Username is ShellBell. Running XP with file and printer sharing ON.

Now at this point I dont really care. It can be user or share permissions. I'm not worried about security cuz the only way anyone would have access to my lan is if they jacked in directly to my router or if they stole my gf's laptop because her lappy is setup to only connect under a WEP connection with a nice secure password for the key to be based on, AND my router is only allowing her MAC address to connect.

All I want is for her to be able to print thru my comp. Whatever it takes. Someone just please explain. I've done everything, and spent well over 10 hours with no solution. A few times I have been able to SEE the printer and install it on her comp, but I never can get permission to print.

NOTE: I have NO guest account on my Gentoo. I read somewhere a few weeks ago about how it could be a potential security problem and that it should be removed, so I did. I imagine I need it now. I would put it back on IF i knew how! Any details there?

YES i've created accounts before, and YES i've created corresponding accounts with the smbpassword. It has never worked yet. I'm obviously doing something wrong. I've also worked with it through SWAT and had it not work. THIS JUST SUCKS.

can someone PLEASE explain how to make this work?

-Feld

----------

## cybertron

I just wanted to say that I want the same thing!!

I've finally gotten filesharing to work..and I can see the printer, although in windows it says "access is denied to the printer" (or similar)

I am guessing that my problem lies within the guest thing...

please..is there anyone experienced samba user who would help us both?

----------

## Tahoe_Strider

I just finished setting up a Gentoo Printserver for all the Linux and WindowsXP machines on my network. In order to get it up and operational, I had to tweak 4 different files. These files were /etc/samba/smb.conf, /etc/cups/cuspd.conf, /etc/cups/mime.convs, and /etc/cups/mime.types. I'm at work right now, but I have an older, working copy of each file that should offer you insight if you'd like me to post them. I have since "tightened" up the sharing and such, but these files "should" work for you in order to at least get your printserver working.

----------

## emes

Or you could have windows just print to cups  :Smile: 

Windows can use ipp.

----------

## Tahoe_Strider

Here's what I added to my cupsd.conf file. Make changes to suit your printer(s):

```
<Location /printers/EpsonPhotoR300>

AuthType None

Order Deny,Allow

Deny from None

Allow from All

</Location>

<Location /printers/EpsonC66>

AuthType None

Order Deny,Allow

Deny from None

Allow from All

</Location>

```

Here's what I did with my smb.conf file. Make IP addressing changes to suit your subnet:

```
[global]

null passwords = yesprivate

workgroup = HOME

server string = Gentoo Linux Server

encrypt passwords = True

security = share

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

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

socket options = IPTOS_LOWDELAY TCP_NODELAY

domain master = Yes

local master = Yes

preferred master = Yes

os level = 65

dns proxy = No

name resolve order = lmhosts host bcast

bind interfaces only = True

interfaces = eth0

hosts deny = ALL

hosts allow = 10.0.0.0/24 127.0.0.1 (list of allow hosts here)

debug level = 1

create mask = 0644

directory mask = 0755

level2 oplocks = True

read raw = no

write cache size = 262144

remote announce = 10.0.0.255

load printers = yes

printing = cups

printcap = cups

use client driver = yes

[printers]

comment = All Printer

path = /var/spool/samba

browseable = yes

public = yes

guest ok = yes

writeable = no

printable = yes

```

In my mime.convs file I uncommented the following line:

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

And in my mime.types file I uncommented the following line as well:

```
application/octet-stream
```

After that, I simply restarted samba and bot Linux and Windows hosts were able to see and print to my printers. HTH

----------

## cybertron

Now I have gotten it to work partly, I can print from my other linux station...and everything looks perfect...

but I can still not print from windows (it appears, and everything seems fine...file sharing is working flawlessly)   and it looks (in windows) that windows is sending the information...but what happens to it is a mystery...

is there any log files or similar that one may see if the information got to the cups server?

EDIT: found some log files, and they show that I am acutally sending something to the cupsserver, "POST / HTTP/1.1" 200 156

but the linux computer sends: "POST /printers/deskjet-series HTTP/1.1" 200 1198504   which is quite different

in the page.log I found no trace of my windows but I did found my linux and server computer

----------

## feld

same problem here. I get errors when printing from windows, but yet I am farther than before!!

```
E [05/Mar/2005:16:23:45 -0600] print_job: Unsupported format 'application/octet-stream'!

I [05/Mar/2005:16:23:45 -0600] Hint: Do you have the raw file printing rules enabled?

```

----------

## Tahoe_Strider

Hmm....

Would you mind posting your mime.convs and mime.types files?

----------

## cybertron

well...I have gotten it to work now!!

I screw samba and used cups only!!...it appears that windows can use samba!!

I followed this guide: http://www.owlfish.com/thoughts/winipp-cups-2003-07-20.html

hopefully this will help  :Very Happy: 

----------

## feld

omg dude i love you THATS PERFECT

100% flawless!

CUPS alone > SAMBA!!!

-Feld

----------

## Logician

This was an awesome post.  After a little bit of fiddling, I now have a printer that works on linux systems and windows systems, including 64 bit systems.  Compared to this, samba is rocket science.  Thanks again.

----------

## fourhead

I need help too!

For several reason it's not a solution for me to use CUPS only for printing, so I need to go trough Samba. My Samba setup (well, the filesharing part) works perfectly. But I just can't get this damn printer to work. On the Linux box (Ubuntu, actually), I have the printer (HP DesignJet) installed via CUPS, and it works perfectly. I've added it to Samba, and I can see the printer from all the Win2k machines. When I click on "Connect" I'm told the server has no driver, and I need to install one locally. I choose the driver downloaded from hp.com, select the printer model, click OK, and then Win2k tells me there's no connection to the printer because I gave the "wrong printer name" or the "printer is not attached to the server anymore". I'm spending TWO days with this problem now, and I've tried nearly everything, read thousands of how-tos and posts, but to no avail. Here's my smb.conf, and I really can't see whats wrong with it:

```

[global]

   workgroup = ibrnetz

   server string = Ubuntu Linux Server

   wins support = yes

   security = user

   encrypt passwords = true

   unix password sync = yes

   passdb backend = tdbsam guest

   passwd program = /usr/bin/passwd %u

   passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spasswor$

   admin users = administrator

   load printers = yes

   printing = cups

   printcap name = cups

   printer admin = administrator

   preserve case = yes

   short preserve case = yes

   inherit permissions = yes

   map archive = no

   map hidden = no

   map system = no

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

[Daten]

   path = /srv/daten

   browseable = yes

   writeable = yes

   create mask = 0660

   directory mask = 0770

   vfs object = recycle

   recycle:repository = Papierkorb

   recycle:keeptree = yes

   recycle:exclude = *.tmp *.bak

[Backup]

   path = /srv/backup-daten

   browseable = yes

   writeable = no

[HP-DesignJet-650C]

   path = /tmp

   browsable = yes

   printable = yes

   writeable = no

   create mode = 0700

[printers]

   path = /tmp

   browsable = yes

   printable = yes

   writeable = no

   create mode = 0700

#[print$]

#   path = /etc/samba/printers

#   browseable = yes

#   writeable = no

#   write list = administrator

```

Can please, please, please ANYBODY tell me what is wrong with this? File sharing works PERFECTLY, so I don't see why there should be a permission problem with the user accounts or so, but this is just really ridiculuous and driving me crazy right now. Any Samba experts out there? May it be something Ubuntu-specific (no real root account etc.)???

Tom

----------

## klatk

I can't exactly remember, because I gave up and went to CUPS only, but I seem to recall that you need to put the client driver on the server. I don't remember which directory it goes in, but I'm pretty sure it was in the CUPS/SAMBA howto.

Ahhh... just checked my smb.conf and in the comments there it says you have to enable the print$ share. So try that and put the print driver in the /etc/samba/printers directory.

----------

## fourhead

Well as far as I know this is only an optional feature. Either, each client installs it's own driver localy, or you store the driver on the server, and the client auto-pulls it from there. The Samba docs say it's not mandatory. I tried this first, but I gave up with it because it just never worked. All I want is to just print and I'm pulling my hairs out. I found an error in the samba lohs saying something about a share name being too long (>12 chars), and I corrected that (renaming HP-DesignJet-650C to just DesignJet), but it still won't work. Can anybody tell me whats wrong here? It would be good if the printer worked if all the people come to work on monday again ....  :Wink: 

Tom

----------

## TealVeal

 *Tahoe_Strider wrote:*   

> I just finished setting up a Gentoo Printserver for all the Linux and WindowsXP machines on my network. In order to get it up and operational, I had to tweak 4 different files. These files were /etc/samba/smb.conf, /etc/cups/cuspd.conf, /etc/cups/mime.convs, and /etc/cups/mime.types. I'm at work right now, but I have an older, working copy of each file that should offer you insight if you'd like me to post them. I have since "tightened" up the sharing and such, but these files "should" work for you in order to at least get your printserver working.

 

Were you able to use the Windows Print Drivers for Windows clients?  I'm looking into setting up a backup gentoo linux print server at work since our main one keeps dropping printers, losing drivers, etc.  I looked in the samba documentation and it appears that you can but I didn't see any statement which came right out and said so.

Thanks

----------

