We are working on client-provided VMs. We connect to these VMs using Remote Desktop, and each VM is running Windows XP.

After some time, the machine gets locked and we need to re-enter the password to continue working. Unfortunately, this is causing our automated scripts to fail.

Note: we have already disabled the screen saver.

  • Yes it is XP Professional. – Anand Jul 28 '11 at 5:11

There are three other likely places where the machine can be automatically locked:

  1. Power management settings can be set to automatically lock after coming back from standby but this shouldn't apply with a VM (check anyway though, only takes a second).
  2. Group policy may be set to force the computer to lock every so often (VERY likely if these VMs are joined to a domain)
  3. Logging out of remote desktop should lock the machine, but you can supply credentials so it's unlocked as you connect.

Check your power management settings -- make sure it's all turned off since the environment is contained within a Virtual Machine (so there's no point in using power management in the Guest OSes).

There is a setting in Power Management that will require the user to enter their password when leaving the power-saving state, so you might want to double-check this option while you're at it:

enter image description here


If you disconnect from an RDP session, it locks the user session. Take a look at a different remote console app (vnc, Remote Adminstrator, etc)


If it is XP Pro, the easiest way to fix this is to change the Terminal Services settings using gpedit.msc on the computer you are connecting to.

You then navigate to:

Computer Configuration>Administrative Templates>Windows Components>Terminal Services>Sessions

Set these setting:

  1. Sets a time limit for active Terminal Services sessions
  2. Sets a time limit for active but idle Terminal Services sessions
  3. Terminate session when time limits are reached

Then run gpupdate /force at a command prompt.

If these are on a domain, you may need to also set these in the domain group policy, or they will be overwritten every 90 minutes.

These settings handle how RDP sessions are handled.

enter image description here

  • As a side note, your scripts should probably be set up as scheduled tasks, so they will not be dependent on your being logged in. – KCotreau Jul 28 '11 at 5:06
  • I tried reaching the Terminal Services section, but it is not available there. – Anand Jul 28 '11 at 5:18
  • Right-click on "Administrative Templates" and click Add/Remove templates. Is the "system" template installed? If not, click Add, and select it from the list (should default to the windows\inf folder, if not navigate there). – KCotreau Jul 28 '11 at 5:24
  • Just to be clear, you run this on the computer you are trying to connect to, not your computer. – KCotreau Jul 28 '11 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.