0

I have a Linux box that connects to a shared folder on a Windows 7 desktop. When the Windows computer goes to sleep and then resumes, the share is no longer accessible. If I reboot the Linux computer, the Windows share becomes accessible again.

The share is mounted by a systemd automount unit. Once the Windows box has gone to sleep and resumed, if I try to cd to the mount point of the share, I get a "Host is down" message.

If I run smbclient -L xxx.xxx.x.xx -U user -d 256 the share is visible in the list but at the end are the errors:

SPNEGO login failed: The transport connection has been reset.
session setup failed: NT_STATUS_CONNECTION_RESET

Why does the share become accessible again when I reboot Linux?

_update I'm adding info to my own question. I've tried all the power options I can find in Windows 7 and in my (updated) NIC driver. No help.

I've updated samba. I've also tried several different approaches to mounting, including with and without automount and adding "noperm" and "_netdev" to the mount command in fstab. I've tried enabling winbind and adding "wins" to the nsswitch.conf file.

Still the share mounts on a reboot, but gets lost after a short time, even if the Windows host doesn't go to sleep. If I unmount and try to remount the share, I get a "no such file or directory" error. But I can connect to the share with smbclient with no problem.

To me all this suggests that the problem is at least partially with Linux, but I'd still like to hear any suggestions as to possible Windows settings that might be contributing. TIA

1
  • Update: after messing around with permissions a bit I can now connect to the share with smbclient, but the automount fails until I reboot the Linux box.
    – Lestrad
    Commented Jul 7, 2021 at 19:52

1 Answer 1

0

Windows 10 disconnects the network during sleep, but this can be fixed.

Step 1: Add "Network connectivity in Standby" to Power Options

  • Run regedit
  • Position to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\F15576E8-98B7-4186-B944-EAFA664402D9
  • Double-click the Attributes item
  • Change its value to 2
  • Click OK.

Step 1: Keep Network Connection Active When in Sleep Mode (On Battery & Plugged in)

  • Run Start > Power Options
  • Click "Change plan settings" for your power plan
  • Click "Change advanced power settings"
  • Under your power plan, you should see a branch named "Network connectivity in Standby", so expand it
  • Select "Enable" for both "On battery" and "Plugged in"
  • Click OK.

A reboot might be required.


Another method is via the Local Group Policy Editor:

  • Run the Policy Editor (gpedit.msc)
  • Position to Computer Configuration > Administrative Templates > System > Power Management > Sleep Settings
  • Double-click and set to Enabled the two settings: "Allow network connectivity during connected-standby (on battery)" and "Allow network connectivity during connected-standby (plugged in)".

A reboot might be required.

For more information see the article Prevent Windows 10 from Disconnecting Network during Sleep.

1
  • Wow. But what about in Windows 7? I was able to find Sleep Settings, but I don't see those two settings. Might there be some other setting in Windows 7 that would do what I want? Maybe in Security settings? TIA
    – Lestrad
    Commented Jul 5, 2021 at 16:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .