# samba newbie installation guide need one!!!

## DntKnwHw

i have

2 computer XP and Gentoo 1.4 ---> kde

crossover cable, got both drivers working, e100(linux compiled it inside the kernel) and cnetpro200 xp

samba installed (but not yet configure)

problem,

i can't network them, i just want them to be connected, a typical connection, just for sharing files and printers, and of course network gaming (ex. quake 3)

i don't know what files to configure, what settings for, linux and windows

so anyone can give me a "samba for dummies" step by step process. pls. really need help,

----------

## GeneralKane

http://www.gentoo.org/doc/en/desktop.xml#doc_chap7

----------

## MOS-FET

ok, first check if you can ping both computers. on the linux machine, you can assign a static ip in /etc/conf.d/net. on the winxp machine, it's somewhere in network settings. when you can ping both comps, you're half way trough. next you need to emerge samba, if not done already. all samba related stuff is done in /etc/samba/smb.conf. mine looks like this:

```

[global]

   log file = /var/log/samba.log

   netbios name = GENTOO

   guest account = elektrohirn

   writeable = yes

   server string = Gentoo Linux 1.4

   socket options = TCP_NODELAY

   path = /home/Multimedia

   client code page = 850

   character set = ISO8859-15

   write list = elektrohirn,@elektrohirn

   workgroup = NETZ

   os level = 20

   valid users = elektrohirn,@elektrohirn

   encrypt passwords = yes

   guest only = yes

   public = yes

   security = share

   wins support = true

[Multimedia]

```

after saving this file, start samba with /etc/init.d/samba start. on the winxp machine, you should now see a computer named "GENTOO" in your network neigborhood with a share called "multimedia" pointing to /home/Multimedia. just replace all dir's for your needs. the winxp machine has now read/write access to the shared directory. instead of "elektrohirn", put your username. client code page/character set may not be needed by you, it's for me so that samba correctly displays german characters.

i guess you know how to share a directory on winxp. if you've done that, you should be able to access this shared dir in konqueror by entering "smb://yourwindowsIP/yourwindowsshare". you may be asked for username+password and you can browse the windows shared dir. in order to mount a shared dir like a CD etc. you need smbfs filesystem support compiled into the kernel.

hope this helps. if you've got questions ... ask me

tom

----------

## vbenares

I can do half of this - I can see my linux box from my windows box.  I cannot see my windows box from the linux one.  This seems like the key:

 *Quote:*   

> "smb://yourwindowsIP/yourwindowsshare"

 

BUT, both machines get an IP from DHCP, so their IPs change.  The windows machine is skeeter and the "folder" on the windows machine that I want to share belongs to user varanasi and is called My Documents.  

I would be grateful for any help.

----------

## MOS-FET

ok, since you've wins support enabled in samba, you should be able to use the winxp computer's name to connect. go to your win machine and look for the name of the SHARE, not the name of the directory you're sharing. for example, you could share "My Documents" and simply call the share "mydocs". then this should work:

```
smb://skeeter/mydocs
```

when you know how to compile the kernel (it's not too hard) you could add smbfs support and you'd be able to mount this share. for example, you could mount the share //skeeter/mydocs into the directory "/home/varanasi/My Windows Documents" like this:

```
mount -t smbfs //skeeter/mydocs "/home/varanasi/My Windows Documents" -o username=varanasi,password=<yourpwd>
```

if it doesn't work with "skeeter" try switching to static IPs. for small networks with 2-5 PCs i personally think it's easier without DHCP.

if you need further help, don't mind asking :-)

tom[/code]

----------

## vbenares

tom:

Thanks for the response.  Unfortunately it didn't work.  It seems that linux box just cannot see skeeter.  I created c;\sambatest to eliminate problems with spaces etc.  and shared it to Everyone.  Still no luck.

 *elektrohirn wrote:*   

> ok, since you've wins support enabled in samba, 

 

Could you elaborate a bit on this.  I know that I have 

```
    wins support = yes
```

in /etc/samba/smb.conf.  Is there anything else I should check?

 *elektrohirn wrote:*   

> when you know how to compile the kernel (it's not too hard) you could add smbfs support and you'd be able to mount this share. for example, you could mount the share //skeeter/mydocs into the directory "/home/varanasi/My Windows Documents".

 

I am an ace kernel recompiler!  I recompiled the kernel at least three and maybe four times in two days!  It's about the only thing about linux that I am sure I can do!  Not that I have any real concept of what exactly I am doing.  Think trained monkey, and you'll get the idea.

This would be great - really great in fact - but I assume I need to get linux box to recognize skeeter first.

 *elektrohirn wrote:*   

> if it doesn't work with "skeeter" try switching to static IPs. for small networks with 2-5 PCs i personally think it's easier without DHCP.

 

Unfortunately, it's not an option.

----------

## DntKnwHw

hey thanks, i'll try, i hope it will work,   :Very Happy: 

----------

## MOS-FET

hmmm, do you have the correct workgroup name for both computers. in /etc/samba/smb.conf there's a line "workgroup =". put your workgroup name here, e.g. "network". on the win machine, set up the same workgroup name in network preferences. you said it worked the other way right, accessing the linux share from your win machine? so your networks config (IP, netmask ...) seems to be OK.

if you have wins enabled, you should be able to use a computer's name instead of it's IP address. try the following: get your win machine's IP and then try to access the share by entering "smb://IPaddress/share" in the konqueror address bar.

give me some more info. what exactly happens if you enter the "smb://..." in konqueror? did you really use the name of the SHARE, not the name of the directory?

quick kernel guide: the kernel basically consists of many "modules", each module has a certain functionality. for example, there's a module than can make a specific network card work, there's a module that can acces FAT partitions, or there's a module that can give you firewire capabilities. with "make menuconfig" you can choose which modules to compile and which not. you should always compile only the modules you really need. you can compile a module as - well - as a module [M] or directly into the kernel [*]. the first is good if you don't need a module very often. you can then load it only when you need it and unload it when it's not needed anymore. if you compile it into the kernel, this module will always be loaded at boot time, it's "inside" or - better - it's a part of the kernel.

----------

## vbenares

tom:

Thanks for your help.

 *elektrohirn wrote:*   

> hmmm, do you have the correct workgroup name for both computers. in /etc/samba/smb.conf there's a line "workgroup =". put your workgroup name here, e.g. "network". on the win machine, set up the same workgroup name in network preferences. you said it worked the other way right, accessing the linux share from your win machine? so your networks config (IP, netmask ...) seems to be OK.

 

Yes.  This seems okay, and linux and windows boxes both appear in the same workgroup from the windows computer.

 *elektrohirn wrote:*   

> f you have wins enabled, you should be able to use a computer's name instead of it's IP address. try the following: get your win machine's IP and then try to access the share by entering "smb://IPaddress/share" in the konqueror address bar.

 

give me some more info. what exactly happens if you enter the "smb://..." in konqueror? did you really use the name of the SHARE, not the name of the directory?[/quote]

I am using Nautilus in the gnome desktop.  Perhaps, Nautilus doesn't do what Konqueror does.  I assumed they were analogous.

I used the sharename not the directory name.

I tried putting both skeeter and the current IP, 192.168.120.21, into Nautilus and got this in a dialog box:

 *Quote:*   

> "gdm://192.168.120.21/sambatest" is not a valid location. Please check the spelling and try again.

 

I tried putting both skeeter and the current windows box IP, 192.168.120.21, into gFTP and got this rather interesting response:

 *Quote:*   

> Looking up skeeter
> 
> Cannot look up hostname skeeter: Name or service not known
> 
> [snip]
> ...

 

It seems to be able to resolve the IP address to the name but not the reverse.[/quote]

----------

## MOS-FET

it looks like the network itself is working, but nautilus can't browse smb shares. well, you'll want to mount them anyway, so you'll have to add smbfs support to the kernel. do this:

```

cd /usr/src/linux

make menuconfig

```

then, go downwards to "file systems" then "network filesystems" and then select "samba/smb/smbfs support" or something like this to be compiled into the kernel (not as module). save the kernel config, and then:

```

make dep && make clean bzImage modules modules_install

cp /boot/bzImage /boot/bzImage.old

cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage

```

then, reboot with the new kernel. you now should be able to mount the smb share like this:

```

mount -t smbfs //compname/share /home/directory -o username=<yourusername>,password=<yourpassword>

```

i hope this works for you!

----------

## vbenares

tom:

Thanks for your patience.  I will give this a try this afternoon.

----------

## vbenares

Okay.  Maybe I cannot compile a kernel.  

I can now get the linux box to figure out what IP address DHCP has given to the windows box and find the box by name.  I THINK the change that made the difference was changing /etc/nsswitch.conf

from 

```
hosts:       files dns
```

to

```
hosts:       files wins dns
```

And I can get linux box to tell me what shares are on the windows box (skeeter):

 *Quote:*   

> root@mantis mark # smbclient -L //skeeter
> 
> added interface ip=192.168.120.23 bcast=192.168.120.127 nmask=255.255.255.128
> 
> Got a positive name query response from 192.168.120.21 ( 192.168.120.21 )
> ...

 

Which is great!  But I cannot mount the frigging share!

 *Quote:*   

> root@mantis mark # smbmount //skeeter/sambatest /home/mark
> 
> Password:
> 
> ERROR: smbfs filesystem not supported by the kernel
> ...

 

I have recompiled the kernel - twice - after setting the SMB File System option using menuconfig.  I looked in /usr/src/linux/.config to make sure the option was set.  It says, in relevant part:

```
CONFIG_SUNRPC=m

CONFIG_LOCKD=m

CONFIG_LOCKD_V4=y

CONFIG_SMB_FS=y

# CONFIG_SMB_NLS_DEFAULT is not set

```

So, I am back to being stuck.  (I wish I hadn't said anything about being able to compile a kernel!  I think I jinxed myself.)

----------

## vbenares

Aieee!  I forgot to mount /boot before copying the new kernel to boot.  Boy, I feel even dumber than usual.

Everything works fine now.  Thanks.

----------

