60

Have updated to windows 10 pro edition

In power options have sleep/turn off display - never when powered and 30/15 minutes when battery.

Computer is powered

Every time i go out for 1-2 minutes it go to login screen, broke all my opened ssh session etc.

Anyone have same? Any way fix it? Maybe there is somewhere logoff timeout option?

arheops
  • 1,425

6 Answers6

49

This is most likely happening due to a hidden power option called System unattended sleep timeout. On my machine it was set to 2 minutes, which was mighty annoying, as it would cause behavior described by OP (sleep, wake-up, login screen, Event Viewer saying: "The system is entering sleep; Sleep Reason: System Idle"). You have to enable this option in registry before being able to change it.

From http://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/windows-10-keeps-going-into-sleep-after-1-minute:

  1. Click on the windows icon
  2. Type regedit
  3. Right-click on regedit icon, click Run as administrator
  4. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0
  5. Double click on Attributes
  6. Enter number 2.
  7. Go to Advanced power settings (click on Windows button, write power options, click on Power Options, in the selected plan click on the Change plan settings, click on the Change advanced power settings).
  8. Click on the Change settings that are currently unavailable
  9. Click Sleep, then System unattended sleep timeout, then change these settings from 2 Minutes to 20 for example.

This solved the issue for me.

predi
  • 972
21

There is a screen saver setting hidden in the old Control Panel from previous versions of Windows. To get to the setting, follow the steps below:

  1. Open the start menu up and search for "Control Panel"
  2. Go to "Appearance and Personalization"
  3. Click on "Change screen saver" underneath Personalization on the right (or search in the top right as the option appears to be gone in recent version of windows 10)
  4. Under Screen saver, there is an option to wait for "x" minutes to show the log off screen (See below)

If you uncheck the checkbox, you should be able to prevent your computer from logging off.

5

For those of you that end up here and still experience Windows 10 locking the computer, even after following @predis answer: have a look in "Sign-in Options" by pressing WIN key then typing Sign-in Options, then scroll down to Dynamic Lock and un-check the Allow Windows to lock your device automatically when you're away-option. As in the picture below.

enter image description here

This option seems to superseed any option you have in Power Settings.

2

Another possible answer: increase the sleep timeout.

enter image description here

Control Panel -> Hardware and Sound -> Power Options -> Change plan settings -> Change advanced power settings

Tonatio
  • 191
0

None of the above solutions worked for me. (And believe me, I tried. And tried. And tried.)

However, I discovered that if music is playing in the background, my system never auto-locks the screen.

My solution is to keep a copy of VLC Media Player (or any media player, such as BSplayer or Media Player Classic, or WinAmp, etc) playing quietly in the background (volume set to 1, completely inaudible), looping the music so it never ends.

For those who can script, I also wrote a WinBatch script that loops forever and uses Rob LaTour's freebie SetVol program to monitor audio output and start/restart the background music if it ever stops.

This solution is a bandaid, but it works.

cssyphus
  • 1,202
0

How life works...

A handful of minutes after posting the bandaid solution that I've been using successfully for several weeks, I stumbled upon what might end up being the actual answer. However, I will leave the bandaid answer in case this more technical answer does not work for someone.

  1. Open a DOS prompt (i.e. Start button, cmd, Enter key)
  2. secpol.msc Enter
  3. "Local Policies"
  4. "Security Options"
  5. "Interactive logon: Machine inactivity limit"
  6. Set to number of seconds before screen auto-locks (max is 599940 (which is 9999 mins) )

Source: https://www.livelaptopspec.com/how-to-stop-computer-from-logging-off-windows-10/
(Scroll down to "How do I make Windows 10 not lock after inactivity?" )

cssyphus
  • 1,202