# cifs mount OK, dolphin network subsection / smbnetfs not

## optiluca

Hi all.  I have salvaged an old laptop running Gentoo and am planning on reconfiguring it as a NAS for my home network.  I have successfully configured SAMBA so as to expose two folders to each user on the network, one private, one public.  While the server side is working just fine, I would also like to have the NAS mount the User folders from all machines connected on the network, most of which are running Windows 7.  For example, for a machine at IP 192.168.0.2 running user "user" and password "pwd" I run the following on the NAS:

```
mount //192.168.0.2/Users /mnt/user/ -o username=user,password=pwd
```

The "Users" subfolder is due to how windows 7 organises the files it exposes to the network, this folder then contains a public folder and a private one.  With the correct username/password I successfully get these two folders under /mnt/user, and all is good.

However, the machines are coming and going from the network, so in the search of something more flexible I found smbnetfs, which should automagically mount/unmount network shares as they appear.  I have configured the program, started it like so:

```
smbnetfs -o allow_other /mnt/samba
```

and as expected I get a /mnt/samba/WORKGROUP/ subdirectory.  Within this subdirectory are all the machines on the network, including the shares from the NAS itself.  I can access these shares under /mnt/samba/WORKGROUP/Gentoo_NAS with no issue whatsoever.  However any attempt to enter /mnt/samba/WORKGROUP/WINDOWS_MACHINE gives me the following:

```
cannot open directory /mnt/samba/WORKGROUP/WINDOWS_MACHINE/: Permission denied
```

A similar error is what I get if I try to access the share via the dolphin network browser.  I get prompted for a user password, insert the same ones which worked for the manual mount, and I get told they are incorrect and get a "permission denied" error.

I know the password file is getting parsed correctly, as under /mnt/samba/WORKGROUP/Gentoo_NAS the folders change according to which username/password I use to login.

SUMMARY: can't access my windows 7 network shares without manual mounting, despite the same login info being provided!

I am quite stuck, and would much appreciate an input from someone more knowledgeable than myself  :Very Happy: 

Thanks in advance!

PS Feel free to ask for logs or whatever may be required

----------

## gerdesj

I may be completely offtrack but specify the username as .\user  .  The .\ is shorthand for remotedomain.  

All Windows logins are to DOMAIN\user.  If an AD is involved then DOMAIN is the AD domain, if not the domain is the local machine.

In theory when you don't specify a domain it should use the local machine name - that is the other end's local machine name.

I think that different utilities handle passing the domain differently.  You need to specify it somehow - either by the utility doing it automagically or by doing it by hand.

Now that might help your smbfs but to be honest I have no problem using Dolphin to get to Win 7 shares - oooh what version of Samba are you using?

Cheers

Jon

----------

## optiluca

Hey thanks for the help  :Smile: 

Unfortunately no luck with that  :Sad:   My new authentication file (/root/.smb/smbnetfs.auth) reads  *Quote:*   

> 
> 
> # auth [computer[/share]] [domain_or_workgroup/]user password
> 
> #       auth [workgroup]        [domain_or_workgroup/]user password
> ...

 

But browsing my network, I still get:

 *Quote:*   

> optilaptop luca # ls /mnt/samba/WORKGROUP/GENTOO_NAS/
> 
> luca  public

 

Two folders, one for the user, one public as expected

 *Quote:*   

> optilaptop luca # ls /mnt/samba/WORKGROUP/WINDOWS_MACHINE/
> 
> ls: cannot open directory /mnt/samba/WORKGROUP/WINDOWS_MACHINE/: Permission denied

 

Usual error  :Sad: 

Samba version is latest ~amd64, samba 3.5.4

 *Quote:*   

> net-fs/samba
> 
>      Available versions:  3.0.37!t 3.0.37-r1!t (~)3.2.15!t (~)3.2.15-r1!t 3.4.6!t 3.4.8!t (~)3.5.3!t (~)3.5.4!t [M](~)4.0.0_alpha11!m {acl addns ads aio async automount avahi caps cifsupcall +client cluster cups debug doc dso examples fam gnutls ipv6 kernel_linux ldap ldb +netapi oav pam (+)python quota quotas (+)readline selinux +server +smbclient smbsharemodes sqlite swat syslog threads +tools winbind}
> 
>      Installed versions:  3.5.4!t(16:36:59 10.09.2010)(acl caps client examples fam ldap netapi pam readline server smbclient smbsharemodes swat winbind -addns -ads -aio -avahi -cluster -cups -debug -doc -ldb -quota -syslog)

 

EDIT 21/9/10 : Still broken...   :Sad: 

----------

## optiluca

Does anyone at all use Dolphin/smbnetfs to access windows 7 shares?  Sounds like a pretty common scenario  :Razz: 

Even just seeing the samba use flags being used by others could help me sort this out.  If I am correct the smb.conf file has nothing to do with accessing shares with these problems anyway, so delving into that should not be necessary (thankfully!)

----------

## gerdesj

Sorry for the delay in response.  This should have been fixed for you a while ago!

I don't use smbfs but as soon as the wife comes back with her Win7 laptop (which is due a Gentooing soon  :Cool:  I'll give it a go.

In the mean time please try:

#mount -t cifs -o user=<user>,pass=<pass> //<machine name>/<windows share> /mnt/<directory>

Replace the bits in <> accordingly without the <>!

You'll need all the bits in your kernel for this:

-> File systems                                                                                                         │   

  │       -> Network File Systems  

  │         -> CIFS support

I know I've done this in the past to get at the wife's laptop when she's using it and I'm pretty sure you wont need the domain= bit in the options.

Your mount command in your first post may be trying to use the old smb kernel code and not cifs.  The cifs thing is the way to go, force it with -t cifs.  If you get an error then you haven't got it compiled in

If that works then a quick n dirty "daemon" could be a script that pings a Win7.  If it is not there then dismount the share.  If it is there and the mount is unreadable (eg look for a standard file on the share) then remount it.  Put that logic into a for i in LIST OF WIN7 COMPUTERS loop Pop this in a cronjob running say every five minutes.

I'll have a go with smbfs when I can and post back

Cheers

Jon

[Edited after re reading the thread!]

----------

## optiluca

I had already tried cifs mounting, and that works just fine (just like the normal mount command does, which I also assume to be cifs by default, since that is what I have compiled in my kernels).

I was resorting to smbnetfs as my scripting skills are approximately nil, and I thought it was a nice and easy solution for what I am trying to do.  If you could give me a hand in writing a script that manually mounts/unmounts windows 7 shares based on availability then that would be great also   :Very Happy: 

In any case, my first attempts were without any domain info, but just a plain "username" "password" smbnetfs.auth file, which was behaving identically, eg mounting shares from the samba server running on the same machine just fine, but refusing to open shares on windows 7 machines.

Thanks again

----------

## gerdesj

Just to let you know I am writing the script.  I'll even test it!

My BASH fu is not too good either ...

EDIT: on the other hand I'm going to plough through this: 

http://en.gentoo-wiki.com/wiki/Autofs#Write_the_mount.2Funmount_scripts_2

... and give it a go

Cheers

Jon

----------

## shadesdude

So I was having similar issues under arch.

My XP machines share mounts correctly however my Windows 7 machine gives the same error about not having permissions.

Based on a suggestion from a friend I uninstalled all windows live components from the Windows 7 machine and lo and behold

the share shows up.

Moral of the story

Windows Live breaks things.

That being said I am still having some permission issues but I haven't gotten a chance to restart my win7 machine yet.

Hopefully some of that helps you out.

----------

## optiluca

What if I want Windows Live components?   :Confused:    Anyway I read something about that on the interwebs but I did not give it a shot.  I am currently having an email exchange with the smbnetfs developer himself who has asked for some logs, he hasn't seen anything wrong so far though.  Anyway if all else fails I shall try removing windows live components.  I won't be able to do any testing on this till xmas I am afraid, as I am leaving for 2 months.

@gerdesj: Thanks, your effort is much appreciated  :Smile:   No rush though, it really isn't a massive deal (well it isn't for the next 2 months anyway  :Razz:  )

----------

## vladx

Hi,

It seems I cannot access Win7 shares from Dolphin but cifs mount is working. IS there any solution for this? Dolphin simply don't ask for password, just says access denied...

Thanks

Laszlo

----------

## optiluca

 *vladx wrote:*   

> Hi,
> 
> It seems I cannot access Win7 shares from Dolphin but cifs mount is working. IS there any solution for this? Dolphin simply don't ask for password, just says access denied...
> 
> Thanks
> ...

 

No luck so far I am afraid.  I have not been able to try anything for the past 2 months though, so I might give it another shot in the coming weeks...

----------

