Keep Remote Desktop Session Active
In this article
Yes, you can keep a Remote Desktop session active. The most common cause of disconnections is inactivity timeouts set by either your client computer, the server computer, or group policies. Adjusting these settings, along with power management options, can prevent unwanted disconnections.
What You'll Need
- Access to the computer you are connecting *to* (the server). You may need administrator privileges.
- Access to the computer you are connecting *from* (the client).
- Knowledge of your username and password for the server computer.
Step-by-Step
-
On the Server Computer: Adjust Power Management Settings. Windows often disconnects Remote Desktop sessions to conserve power. To prevent this:
- Open the Control Panel (search for "Control Panel" in the Start menu).
- Go to "Hardware and Sound" and then "Power Options." (Note: Labels can differ slightly by Windows version or device.)
- Click "Change plan settings" next to your currently selected power plan (e.g., Balanced, Power saver, High performance).
- Click "Change advanced power settings."
- Expand "Sleep" and set both "Sleep after" and "Hibernate after" to "Never."
- Expand "USB settings" and ensure "USB selective suspend setting" is set to "Disabled." This can sometimes cause disconnects when USB devices go into power saving mode.
- Click "Apply" and then "OK."
-
On the Server Computer: Modify Remote Desktop Services Settings. This is a crucial step to prevent timeouts.
- Press the Windows key + R to open the Run dialog box.
- Type
services.mscand press Enter. - Scroll down and locate "Remote Desktop Services."
- Right-click "Remote Desktop Services" and select "Properties."
- Go to the "Session" tab.
- Look for "Timeout (minutes):" If it's set to a low value (e.g., 10, 30), increase it to a higher value or set it to "0" to disable the timeout. A value of 0 means the session will remain active until manually disconnected or the server shuts down.
- Click "Apply" and then "OK."
- You may be prompted to restart the "Remote Desktop Services" service. Click "Yes" if prompted.
-
On the Server Computer: Check Group Policy (if applicable). If your computer is part of a domain, Group Policy settings might override your local settings. This requires administrator access and knowledge of Group Policy Editor.
- Press the Windows key + R, type
gpedit.msc, and press Enter. - Navigate to:
Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Timeout. - Double-click "Timeout (minutes)."
- If the policy is set to "Enabled" with a low timeout value, change it to "Disabled" or increase the timeout value.
- Click "Apply" and then "OK."
- Restart the computer for the changes to take effect.
- Press the Windows key + R, type
- On the Client Computer: Adjust Idle Time Settings. Some client operating systems or third-party utilities have their own idle time settings that can disconnect Remote Desktop sessions. Check your power settings and any installed utilities. Windows Power Options (similar to the server steps) can be adjusted to prevent sleep or hibernation.
- On the Client Computer: Keep the Session Active. The simplest method is to periodically interact with the Remote Desktop session. Moving the mouse or pressing a key every few minutes will prevent the session from being considered idle.
Common Mistakes
- Forgetting to apply changes: After modifying settings, always click "Apply" and "OK" to save them.
- Overlooking Group Policy: Domain-joined computers are often governed by Group Policy, which can override local settings.
- Incorrectly identifying the server vs. client: The power management and Remote Desktop Services settings need to be adjusted on the *server* computer, the one you are connecting *to*.
- Confusing Power Options with Session Timeouts: Power options prevent the computer from sleeping or hibernating, while session timeouts specifically disconnect Remote Desktop sessions after a period of inactivity.
- Not restarting services: Some changes, especially to services like Remote Desktop Services, require a restart to take effect.
Tips
- Use a Remote Desktop Manager: Tools like Royal TS or Terminals provide features to keep sessions active and manage multiple connections.
- Schedule a Task to Simulate Activity: You can create a scheduled task on the server that periodically moves the mouse or presses a key to keep the session alive. (Use caution, as this can be resource-intensive.)
- Consider a Third-Party Solution: Some commercial software is specifically designed to maintain Remote Desktop connections.
- Test Your Settings: After making changes, test the connection by leaving it idle for the expected timeout period to ensure it remains active.
Troubleshooting
- Restart Both Computers: A simple restart can often resolve temporary glitches.
- Update Remote Desktop Client and Server: Ensure you're using the latest versions of the Remote Desktop client and server software.
- Check Network Connectivity: Ensure a stable network connection between the client and server. Packet loss or high latency can cause disconnections.
- Firewall Issues: Verify that your firewall isn't blocking Remote Desktop connections.
- Event Viewer: Check the Windows Event Viewer (search for "Event Viewer" in the Start menu) on the server for any errors related to Remote Desktop Services.
- Sign Out and Sign In: Sometimes, simply signing out and back into the Remote Desktop session can refresh the connection and resolve issues.