# [SOLVED] Remote Desktop idle being terminated.



## Playerpawn (Mar 21, 2011)

When I remote to my Windows 7 x64 SP1 PC from another (same OS), if I leave the session idle for half a minute or so (doesn't require minimized, just no inputs) it loses connection.

Remote Desktop on either end has no timeout set. Should last indefinitely.

I assume because it's a TCP connection and it's going idle, SOMETHING is killing it... but I'm not sure what. Any suggestions? Some Windows 7 service?

Only additional considerations:

D-Link router (I see no option killing anything)
Cox Cable ISP - Ultimate Tier (don't think ISP would kill anything)
Microsoft Security Essentials (don't see anything related)
Microsoft Windows Firewall (don't see anything related, except allowing RDP port)

I'm stumped. Please help.


----------



## Wand3r3r (Sep 17, 2010)

*Re: Remote Desktop idle being terminated.*

unclear if your are rdping to a local machine or one across the internet

might want to review the settings on the remote pc
Configure Timeout and Reconnection Settings for Remote Desktop Services Sessions


----------



## Playerpawn (Mar 21, 2011)

*Re: Remote Desktop idle being terminated.*

It's across the internet (work to home) and the host system (home) is indeed setup for no timeout.

I have the feeling something, altho I'm not sure what, is killing the idle TCP session. Either a Windows service, router or ISP. Not sure how to find out.


----------



## Wand3r3r (Sep 17, 2010)

*Re: Remote Desktop idle being terminated.*

settings on your local don't count. It the settings on the remote.

open a window [command prompt] and run a ping to the remote router while you run your rdp session. See if ping fails when your session cancels.


----------



## Playerpawn (Mar 21, 2011)

*Re: Remote Desktop idle being terminated.*

Tested: The ping does not fail when the RDP session does.


----------



## Wand3r3r (Sep 17, 2010)

*Re: Remote Desktop idle being terminated.*

That would indicate something off on the remote computer. Anyone at the remote end can review that pc for you?


----------



## Playerpawn (Mar 21, 2011)

*Re: Remote Desktop idle being terminated.*

Yes, I entirely think it's something on the host (remote) end. However, I'm confident it's not RDP itself terminating the session. I think *something* is seeing an idle TCP session and outright killing it. I head home in about an hour to examine the PC; unfortunately, nobody is there now.


----------



## Wand3r3r (Sep 17, 2010)

*Re: Remote Desktop idle being terminated.*

and you are forwarding port 3389 in the home router to the static ip of the rdp pc at home, right?


----------



## Playerpawn (Mar 21, 2011)

*Re: Remote Desktop idle being terminated.*

Yes, technically. My router does support manual PAT, so external:1337 is routing to internal:3389. The internal:3389 is indeed on a static IP. Regardless, even if I did external:3389 to internal:3389, issue persists.


----------



## Wand3r3r (Sep 17, 2010)

*Re: Remote Desktop idle being terminated.*

You dont' do pat. that is packet address translation
You simply do port forwarding which is 3389 to 3389

If that doesn't work you have a problem with your router.

Way you check is when home to to a port checker site like Shields UP! or Portforward.com and test port 3389


----------



## Playerpawn (Mar 21, 2011)

*Re: Remote Desktop idle being terminated.*

Wand3r3r I appreciate your assistance. I was able to discover the issue; I had a feeling it would be "different".

My D-Link router's SPI firewall did not properly support Microsoft's TCP window size scaling. When RDP was returning from idle, it sent larger than normal TCP packet sizes per this technology, and the router's SPI firewall determined the length of the packet greater than a standard max size TCP packet to be a worm or bad data in general, thus cut it off. This caused the SSL connection to become corrupted, and the connection lost.

If I let the RDP session close itself instead of spamming mouse clicks and closing it when it froze up, I eventually get this in the host computers event viewer:

56, TermDD
The Terminal Server security layer detected an error in the protocol stream and has disconnected the client

Googling this error message doesn't prove very helpful, however I was able to resolve the issue.

The fix is to obtain a router with modern TCP technology support (E2000 on order). However, the workaround is to disable TCP scaling on the host computer, which will not break anything else, as scaling is only used for optimization (usually on slower networks):

From an elevated (administrator) command prompt:

netsh interface tcp set global autotuninglevel=disabled

Upon receipt of the better router, I will re-enable this tech.

Figured I would document my findings here incase they help someone else.

Thanks, again.


----------



## Wand3r3r (Sep 17, 2010)

*Re: Remote Desktop idle being terminated.*

Thanks for the update. Glad you worked it out.


----------

