LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2012, 05:27 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Samba share access from XP works - Win 7 share access disappear after about 3 minutes


Hi Guys

As is standard for a samba post, here's my smb.conf (it works 100% fine with Windows XP) in Centos 6, both physical on hardware and virtual in a KVM instance:

Code:
[global]	
workgroup = SCRUB
server string = Samba Server Version %v
netbios name = VERIPDC
interfaces = lo eth0
hosts allow = 127. 172.
admin users = root
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
domain master = yes 
domain logons = yes
encrypt passwords = yes
os level = 65
log level = 3
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384 SO_SNDBUF=16384
preferred master = auto
local master = yes
wins support = yes
name resolve order = bcast wins lmhosts host
dns proxy = yes
lm announce = no
logon script = %U.bat
logon path = 
logon drive = O:
load printers = no
time server = yes
ntlm auth = yes
client ntlmv2 auth = yes
client lanman auth = yes
lanman auth = yes
remote announce = 172.16.0.0

[homes]
	comment = Home Directories
	browseable = no
	writable = yes
	valid users = %S
	valid users = VERIPDC\%S
	dos filetimes = yes
	dos filetime resolution = yes
	fake directory create times = yes
	
#[printers]
#	comment = All Printers
#	path = /var/spool/samba
#	browseable = no
#	guest ok = no
#	writable = no
#	printable = yes
	
# Un-comment the following and create the netlogon directory for Domain Logons
	[netlogon]
	comment = Network Logon Service
	path = /var/lib/samba/netlogon
	guest ok = yes
	writable = no
	
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
	[Profiles]
	path = /var/lib/samba/profiles
	browseable = no
	guest ok = yes
	
# A publicly accessible directory, but read only, except for people in
# the "staff" group
;	[public]
;	comment = Public Stuff
;	path = /home/samba
;	public = yes
;	writable = yes
;	printable = no
;	write list = +staff
I've got a Centos 6 machine running Samba shares by users via the [homes] share. I'm running
in a KVM virtual machine. The Samba instance is the PDC, and my Win XP and Win 7 machines are full domain members. The Centos machine provides DHCP and DNS. I'm on a closed testing network that is Class B and is isolated from the internet.

Everything works 100% from Windows XP to the [homes] share for the Windows XP user. I can read and write no problem. I can ping back and forth across all machines, both by IP and by machine name, including to the Centos Samba server.

I can log in as domain user on both machines no problem, with the Samba instance in the KVM virtual machine, running Centos 6, no problem.

I can open a file on the share in Windows XP, leave it open for an hour, and then save the file, for example.

With Windows 7, the Centos KVM samba shares only works for about 3 minutes - this varies though, sometimes the Windows 7 [homes] share for the Windows 7 user "lasts" for 5 minutes, but never longer than that. The share literally gets a red cross in the Windows 7 computer browser, all by itself. If I try to access the share Windows 7 states that "The network path could not be found". When this is in effect, the Windows 7 machine is still on the network, can be pinged, and can ping.

It is the same if I access the share from Windows 7 directly via IP e.g. 172.16.1.1\\sharename - it works immediately, always, for the FIRST time, after booting Windows 7. After about 3 minutes, the share gets marked with a red cross and becomes inaccessible with "The network path could not be found".

If I wait about 15 minutes and click on the Share again in Windows 7, it will SOMETIMES start working again - it gets the spinning circle thingy and the green bar at the top slowly going from left to right. Sometimes I can then access the Samba share again, other times I have to do this three or four times before the Samba share comes back.

If it DOES come back, it never lasts longer than 3 or 4 minutes, before disappearing again.

I'm reasoning that my setup MUST be correct on the Linux side, since XP works flawlessly. At the moment the Windows 7 share disappears, I can still access from XP the share for the XP user. There is nothing the in Samba logs (at level 3) as regards any issue with the Windows 7 machine. When the "disappearing Windows 7 share" is in effect, all machines can ping each other and the server, by name, and by IP.

Why would Windows 7 behave like this? Is it a Samba setting?

I've already tried on the Windows 7 box, to fix this "randomly disappearing shares" issue:

Code:
1.Run registry update file Win7_Samba3DomainMember.reg on provided media.
2.Run gpedit.msc and find “Computer Configuration\Administrative Templates\System\User Profiles\Set maximum wait time for the network if the user has a roaming user profile or remote home directory.”
3.Activate the policy and set the time to 0 seconds.
4.Apply the change.
5.In gpedit, find “Computer Configuration\Administrative Templates\System\Scripts\Run startup scripts asynchronously.”
6.Activate the policy and set to disabled.
7.Apply the change.
8.In gpedit, find “Computer Configuration\Administrative Templates\System\Scripts\Do not detect slow network connections.”
9.Activate the policy and set to enabled.
10.Apply the change.
11.In gpedit, find “Computer Configuration\Administrative Templates\System\Group Policy\Startup policy processing wait time.”
12.Active the policy and set to enabled, set the wait time to 1 second.
13.Apply the change. Keep gpedit open.
14.For services on the Windows 7 machine TCP/IP NetBios helper service set to automatic and started.
15.For services on the Windows 7 machine Computer Browser service must be started.
16.For services on the Windows 7 machine Routing and Remote access service must be stopped and disabled.
17.In Network Connections, under IPV4, under advanced, click on WINS tab and under NetBIOS setting, select Enable NetBios over TCP/IP and click OK.
18.In the still open gpedit, find “Computer Configuration\Windows Settings\Security Settings\Local  Policies\Security Options\Network Security: LAN Manager authentication level”.
19.Activate the policy and set to Send LM & NTLM – use NTLMv2 session security if negotiated.
20.Apply the change.
2.Go to Network and sharing center.
3.Click on Advanced Sharing settings.
4.Select Domain.
5.Turn on Network Discovery, and file and printer sharing.
6.Click on Save changes.
7.Start regedit, find HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters
8.Set EnableSecuritySignature to 1.
9.Set RequireSecuritySignature to 0.
10.Start regedit find HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters
11.Set EnableSecuritySignature to 1.
12.Set RequireSecuritySignature to 0.
13.For the above two keys (point 29 and 32) insert a new DWORD key called Smb2 as a REG_DWORD and set to 0.
The Windows 7 machine however keeps doing what it did out of the box, even after all these changes. The Windows 7 machine was a clean, standard install. It was doing this from the start when I started testing this.

It was also doing this when Centos was running as a real machine direct on hardware...

Anybody got ANY idea at all? I'm at wit's end - the random share failures in Win 7 is driving me nuts.

Is there some way to get "persistence" in Windows 7 for Centos 6 provided samba shares?

Why does it work 100% with XP?

Last edited by rylan76; 10-26-2012 at 05:34 AM.
 
Old 11-03-2012, 06:00 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
Hi All

I managed to solve this!

It turns out (in my setup at least) for some reason, Win 7 wasn't keeping the share open on its side if it did not get NetBIOS "keepalive" packets for the share in question.

So, I simply added these two parameters to the [global] section of my smb.conf:

Code:
deadtime = 1440
keepalive = 5
The key was the keepalive statement - the keepalive = 5 means that Samba broadcasts NetBIOS keepalive packets every 5 seconds.

This seems to be keeping Win7 happy, the share has stayed open in testing for more than an hour when Samba sends the keepalive packets. Win XP seems fine too, and unaffected.

Therefore, if you have my problem, try adding the above two statements to the [global] section in smb.conf...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Share Access with Samba? your_shadow03 Linux - Newbie 1 03-25-2009 09:51 AM
Access denied when attempting access samba share warlockvix Linux - Software 1 05-11-2007 02:36 PM
Samba Share access Spadge67 Fedora 3 11-19-2005 06:57 PM
SAMBA can't access win share through ip address emailssent Linux - Software 4 09-19-2004 07:29 AM
Is it possible to share broadband access between linux and win ?? andybelfort Linux - Networking 5 01-30-2004 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration