Skip to content

Troubleshooting

Remote Desktop connection timeout and random disconnects: causes and fixes

Sessions that end after a fixed time, drop when idle, or vanish at random have different causes. Work out which one you have, then apply the matching Group Policy, client or network fix.

RyzenRDP guide cover: Remote Desktop connection timeout and random disconnects: causes and fixes

Key takeaways

  • Sessions that end after a set time are almost always Session Time Limits in Group Policy.
  • Sessions that drop when idle after a few minutes usually mean a router or firewall closed the idle connection: enable the RDP keep-alive policy.
  • Random drops point to the network: test with UDP turned off on the client, and check VPN and MTU settings.
  • To keep programs running, disconnect instead of signing out, and leave the disconnected-session limit at Never.
On this page
  1. Quick fix checklist
  2. Timeout vs disconnect: what each message means
  3. Session time limits in Group Policy
  4. Idle, keep-alive and reconnection settings
  5. Network causes: MTU, UDP and VPNs
  6. Server-side causes
  7. Keep programs running after you disconnect

Quick fix checklist

  1. Note the pattern. Does the session end after the same amount of time, only when you are idle, or at random? Each pattern has a different cause.
  2. Fixed time: check Session Time Limits in Group Policy (below).
  3. Idle for a few minutes: enable "Configure keep-alive connection interval".
  4. Random: test from another network, turn off UDP on the client, and check your VPN.
  5. Can't connect at all: confirm the server is running, the address and port are right (RDP port guide) and the firewall allows them.

Timeout vs disconnect: what each message means

  • A connection timeout when connecting means the client never reached a working RDP listener: wrong IP or port, a firewall in the way, the server restarting, or no network path.
  • "Your session ended because a time limit was reached" style messages come from Session Time Limits set on the server.
  • A session that freezes, then reconnects or drops is usually the network between you and the server: Wi-Fi, a VPN, a home router or a congested link.

On the server, Event Viewer shows the server's side of the story under Applications and Services Logs > Microsoft > Windows > TerminalServices-LocalSessionManager and TerminalServices-RemoteConnectionManager.

Session time limits in Group Policy

Open gpedit.msc on the server and go to:

Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits

Group Policy Editor showing the Remote Desktop session time limit settings

Policy What it does For an always-on server
Set time limit for active but idle Remote Desktop Services sessions Disconnects (or ends) a session with no input for the set time Never, or Not Configured
Set time limit for disconnected sessions Ends a disconnected session after the set time, closing its programs Never, or Not Configured
Set time limit for active Remote Desktop Services sessions Ends even busy sessions after the set time Never, or Not Configured
End session when time limits are reached Ends instead of disconnects when a limit is hit Disabled

The same settings exist under User Configuration; if either side is set, it applies. Run gpupdate /force, then sign out and back in. gpresult /h C:\gp.html shows which policies are in effect and where they come from.

Idle, keep-alive and reconnection settings

Many routers, firewalls and NAT devices silently drop a TCP connection that carries no traffic for a few minutes. RDP keep-alives prevent that.

Under Remote Desktop Session Host > Connections (same Group Policy path as above):

  • Configure keep-alive connection interval: Enabled, with an interval of 1 minute. This is the usual fix for sessions that drop after a short idle period or while minimised.
  • Automatic reconnection: Enabled, so the client reconnects by itself after a short network blip.

Network causes: MTU, UDP and VPNs

  • UDP transport. RDP prefers UDP when it can. Some networks pass the first UDP packets and then drop them, which shows up as freezes and disconnects. To test, enable Turn Off UDP On Client on your own PC under Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client. If the drops stop, the UDP path is the problem.
  • MTU on VPNs. VPNs add headers, so large packets may no longer fit. Find the largest packet that passes with ping -f -l 1472 SERVER_IP, lowering the size until it stops failing, and check your VPN's MTU setting.
  • Wi-Fi. Test once on a cable. If wired sessions are stable, look at your Wi-Fi signal or the adapter's power-saving settings.
  • Distance. A server far away is more exposed to congestion on the way. Choose a location near you, as covered in our Windows VPS guide.

Server-side causes

  • Windows Update restarts. Set active hours, or schedule updates outside the hours you work.
  • Memory pressure. If the server is out of RAM, sessions become unresponsive and may drop. Check Task Manager; a bigger plan or fewer programs fixes it.
  • The Remote Desktop listener. qwinsta should show rdp-tcp in the Listen state. If not, restart the Remote Desktop Services service.
  • Two sessions already in use. Windows Server allows two simultaneous administrative sessions; a third person connecting is asked to disconnect one of the existing users.

Keep programs running after you disconnect

This matters for bots, trading platforms and long jobs:

  1. Disconnect, don't sign out. Close the Remote Desktop window with the X, or run tsdiscon. Choosing Sign out closes every program.
  2. Leave "Set time limit for disconnected sessions" at Never (or Not Configured; by default Windows keeps disconnected sessions without a time limit).
  3. For anything critical, run it as a service or a startup task so it also survives reboots. Our bot hosting page shows how.

FAQ

Why does my RDP session keep disconnecting?

The usual causes are a session time limit set in Group Policy, an idle connection being closed by a router or firewall, or an unstable network path. Note when it happens (after a fixed time, when idle, or at random) and apply the matching fix in this guide.

How do I stop Remote Desktop from timing out?

In Group Policy, under Remote Desktop Session Host > Session Time Limits, set the idle and disconnected-session limits to Never (or disable them), and enable "Configure keep-alive connection interval" under Connections. Then run gpupdate /force.

Do programs keep running after I disconnect from RDP?

Yes, if you disconnect rather than sign out, and if no "Set time limit for disconnected sessions" policy ends the session. By default Windows keeps disconnected sessions with no time limit.

Sources

  1. Microsoft Learn: Session Time Limits (Group Policy settings for Remote Desktop Services)
  2. Microsoft Learn: Troubleshoot Remote Desktop disconnected errors (keep-alive policy, Event Viewer paths, listener checks)
  3. Microsoft Learn: Change the listening port for Remote Desktop

Run Windows Server on AMD Ryzen or AMD EPYC

Full Administrator access, Remote Desktop ready, set up within 24 hours. Plans from $14.99/mo.