# Starting over with Samba

## brkdnr

I can't get it working, so I've emerge unmerged samba.  I'm emerging it again right now, along with cups, foomatic, gimp-print, and qtcups.

My plan is to get samba working, of course, then make my gentoo box be able to print through my windows XP box.

I'm going to try to use this thread as a log of what I'm doing, and any problems I encounter.  Feel free to add any suggestions.

On a side note, I've realized why Linux isn't very popular.  Too many programs that don't seem to have a common way of doing things.  I will still try to trudge through it though.

Is there any good threads that I missed while searching that discuss how to go about getting the most recent version of Samba working with Gentoo?

----------

## PT_LAmb

What's not working?

----------

## brkdnr

now that I've started over, the first problem I'm running into is setting a user/password with smbpasswd.  It says command not found.  Now what?

I realize that the first step was making a smb.conf file in my /etc directory, and the 2nd step is setting up this account access.  Am I correct?

----------

## Spacemage

```

emerge -s net-fs/samba

```

to see if samba is properly installed

as root start samba:

```

/etc/init.d/samba start

```

to see if things are working properly on your end:

```

smbclient -L localhostname -N

```

to see if you can access your XP machine:

```

smbclient -L winXPhostname -U username

password

```

if you did not set a password for the user(on the XP machine) add -N for convenience

the username has to exist on your XP machine

----------

## BlackBart

 *brkdnr wrote:*   

> now that I've started over, the first problem I'm running into is setting a user/password with smbpasswd.  It says command not found.  Now what?
> 
> I realize that the first step was making a smb.conf file in my /etc directory, and the 2nd step is setting up this account access.  Am I correct?

 

If you want to add a password to the samba password file (so you can accesss the share from the xp machine) run

```

smbpasswd USERNAME -a

```

----------

## brkdnr

oddly, I did an

```
emerge net-fs/samba
```

and then followed the commands listed above, and I have full SMB access to and from my windows XP machine.  I am able to locate my printer on my windows machine, and configuration through the KDE Control Center seems to be fine, until I need to acually print something.

When printing anything, either the test page or from OpenOffice, the job goes to the spooler on my Gentoo box, but never get's to the printer on the XP machine.

What now?

----------

## Spacemage

you may want to have a look at these threads:

https://forums.gentoo.org/viewtopic.php?t=1790

https://forums.gentoo.org/viewtopic.php?t=29972

https://forums.gentoo.org/viewtopic.php?t=14714

and of course the forum search

Your problem is most likely not related to samba it seems to work just fine.

also check http://www.linuxprinting.org to see if your printer is supported by linux

BTW wich printer do you have?

----------

## PT_LAmb

 *brkdnr wrote:*   

> I realize that the first step was making a smb.conf file in my /etc directory, and the 2nd step is setting up this account access.  Am I correct?

 

And one last thing, it's not /etc/smb.conf, but /etc/samba/smb.conf

Good luck,

Ricardo Cordeiro  :Smile: 

----------

## brkdnr

First, my printer is an Epson Stylus C80.  I've printed with it from linux previously, but on a direct USB cable.  I have the printer drivers installed, and am able to set options on the driver, but not get any output.

this link:

http://mumford1.dyndns.org/~bs7452/linuxhelp/cups.html

seems to show me that I need to set up my system to send printer stuff to the smb print spooler.

The notes from that link don't work for me, here they are:

```
as root from an xterm, type the following: 

ln -s `which smbspool` /usr/lib/cups/backend/smb

this will link the program "smbspool" to the cups directory for the samba backend 

restart cups with "/etc/init.d/cupsys restart"
```

the ln -s command gives me an error message of:

```
 ln:'/usr/lib/cups/backend/smb': File Exists
```

then after the restart command, i get:

```
No such file or directory
```

----------

## Spacemage

Fist things first I have trouble myself setting things up right but in my case I guess it has to do with the fact that my printer is rather badly supported.Yours should work.

OK first the stuff you tried:

```
ls -l /usr/lib/cups/backend/smb
```

should show you:

```

 /usr/lib/cups/backend/smb -> /usr/bin/smbspool

```

So it is already set.

/etc/init.d/cupsys does not exist

but if you look into /etc/init.d/ you will see that

/etc/init.d/cupd does exist.

The doc is for debian so be a little more flexible...

OK lets start over with the printing stuff, I presume you read:

http://www.gentoo.org/doc/en/printing-howto.xml

Iguess you have cups,gimp-print and the foomatic stuff installed then, if not do so now.

before we start make shure cupsd and samba are running.

cd into /etc/init.d and try to start the things by doing: 

```

./cupsd start

./samba start

```

if it tells you that the services are already running you can start if not they should be started now and you can start anyway.  :Wink: 

You do not realy need the foomatic thing it just adds a printer to cups you could set it in the cups webinterface yourself but lets use it anyway.

foomatic needs the cupsd running to work properly.

```

foomatic-configure -s cups -p Epson-Stylus_C80 -c smb://user:password@server/share -n queue_name -d gimp-print

```

que_name is just the name you want to give it, it can be anything.

check http://localhost:631/printers

if you see it.

If you do you should be set.

Just to be on the save side check your /etc/samba/smb.conf for:

```
printing = cups
```

Follow the printing guide for the rest.

http://www.gentoo.org/doc/en/printing-howto.xml

Please tell me if it works.

----------

## brkdnr

I followed your tips, and then tried printing.  No luck.  I tried restarting samba and cupsd, which they did fine.  test page still does not print, either does printing a page from Open office.

/etc/samba/smb.conf does have printing=cups.

I'm able to see a printer and it's jobs when connecting to port 631, but the jobs never get processed.

Thanks for your help so far!

----------

## Spacemage

OK found some interresting stuff here:

https://forums.gentoo.org/viewtopic.php?t=29972

https://forums.gentoo.org/viewtopic.php?t=30024

Read both threads.

Check if something is queued if it is delete it.

try printing again.

if that does not help try:

```
emerge rsync && emerge -C cups && emerge qt cups
```

to reemerge cups

I am running out of ideas here...  :Sad: 

----------

## Spacemage

You know something very strage just happend.

I wanted to try stuff with my printer setup again and now it just works I am pretty shure I did the same as before when I could not get it to work...

Very strange indeed.

I just deleted all the printers that where in cups and tryed to readd my printer and now it works, before the printer did something too but it would not print just make a lot of noise forever and only power off would reset it...

I did not reemerge anything.

My printer is a Canon S520 and I used this line to add it:

```
foomatic-configure -s cups -p Canon-S500 -c smb://HEIKO/CANONS520 -n CANONS520 -d gimp-print
```

HEIKO is my fathers computer hostname CANONS520 is the printer share...

Ok I remember now that I changed the paper size from "Letter" to "A4" (this is the only difference to before)but that was all.

And your printer does not do anything?

----------

## green sun

O'Reilly has their "Using Samba" book online as part of their OpenBooks project.

http://www.oreilly.com/catalog/samba/chapter/book/index.html

I found this extremely useful in setting up Samba (as domain controller & file server), esp. the conf file reference at the end. Great stuff on security & performance as well. You may want to look at the chapter on printing.

Openbooks page found here:

http://www.oreilly.com/openbook/

----------

## Spacemage

That may be but I do not think that samba is the problem in this case...

And you have to subscribe to view the relevant parts of the book.

Samba seems to work just fine for file services and there is no reason why it should not work for printing if the other stuff works...

You would have to configure samba if it was the printserver but in this case it is the client, as far as I am aware it does not require special configuration for that.

brkdnr are you shure your windows machine is set up properly?all the proper right and stuff? Is the printer turned on and connected to the computer?

ok lets see I have another idea:

delete all printers in cups

restart cups:

```
/etc/init.d/cupsd restart
```

delete all files in 

```
rm /var/log/cups/*
```

readd printer with foomatic you know how

try to print

look in the logfiles for usefull info

```

cd /var/log/cups/

cat error_log

```

you could also look into the cups config files in /etc/cups if you fin any errors especialy in printers.conf

do you have QT installed?

I read that cups needs it without realy needing it...

Anyway I think it would not hurt to install it.

reemerge cups if you do...

----------

## brkdnr

a copy of my /var/cups/error_log is:

E [20/Jan/2003:23:39:31 -0600] [Job 11] SMB tree connect failed: NT_STATUS_ACCESS_DENIED

E [20/Jan/2003:23:39:31 -0600] [Job 11] Unable to connect to SAMBA host, will retry in 60 seconds...: Success

In fact, there are a TON of these.  I checked my XP machine, I unshared and reshared the printer.  I made sure my firewall (kerio) was disabled.

I just did an emerge of qt then cups. prior to that error log.  I am still able to browse via samba my XP box from my linux box.

This is seriously annoying!

----------

## green sun

1. You don't need to subscribe to Safari to view the Samba book

http://www.oreilly.com/catalog/samba/chapter/book/index.html

Not that I think it will be a ton of help on this tho...

2. Sounds like samba is passing the wrong username/password to the print share. Is the printer set up on XP with "Anybody" "Full Access"? You may want to bump up the debug level in samba & see if anything useful shows up in the logs... In smb.conf add:

```

[global]

debug level = number

```

(Umm.. add it in the [global] section). Increase it one number at a time.. 3 and above will slow your system, so just do it for debugging...

Also, are you using smbspool to do this? I was a little confused on the command you were issuing... if so, you can pass a username/password in the URI to smbspool...just do 

```

smbspool --help

```

----------

## brkdnr

i read smbspool --help, and well...it didn't help.  What command would I use is my printer is Epson, my xp server is Server, and my user is User, and my password is Password and my workgroup is Workgroup?  I typed in

```
User:Password@Workgroups/Server/Epson
```

but it just tells me what the usage is, not what I didn't type in right or if it even worked.

----------

## sburnett

I believe you need // in front of the username/password/etc.

----------

## brkdnr

This is getting rediculous.  Can someone tell me if I'm doing something wrong, if it's shoddy documentation on samba, or shoddy documentation on cups?

So far, I have emerged samba, qt, cups, cups-gimp-print, foomatic.

I'm not getting any real error messages.  All I'm seeing is that for some reason I can start a print job and cups seems to be set up correctly, but the print job won't make it to the windows XP box.  I have followed every direction, and found a lot of help when I did a quick seach for smbspool, but nothing I try seems to work.

I'm going to go kill some aliens with some online games for a bit, maybe I will check back in a few hours to see if anyone else has an idea of what might be wrong.

----------

## nouse66

i had that same access error trying to print to a windows 2000 machine.  turned out that i didnt need the password in the printer path.  cups works for me using this:

smb://myusername@windowsmachinename/printername

in otherwords:

smb://aaron@nash/epson

hope that helps...

----------

## Spacemage

I just read this one:

https://forums.gentoo.org/viewtopic.php?t=32816

 *Quote:*   

> Made my entry in my /etc/hosts match the win98 machines name. 

 

Might be a solution to your problem...

----------

