none
Terminal Services session automatically logged out on reconnect after network interruption RRS feed

  • Question

  • We are connecting to a Windows XP SP3 machine remotely via RDP.

    The following works CORRECTLY:

    • Start a remote desktop client and connect to the host
    • Log in
    • Disconnect via the Start button
    • Connect again using the remote desktop client
    • We are reconnected to the running session as expected

    This proves that terminal services are working, policies are correct, the graphics drivers are ok, etc.

    If, however, the session is interrupted by a network problem, it cannot be successfully resumed. The behavior is as follows:

    • Start a remote desktop client and connect to the host
    • Log in
    • NETWORK INTERRUPTION OCCURS
    • Remote desktop client signals that the network connection is lost and waits for it to be reestablished
    • Network connection is reestablished (doesn't matter whether 10 seconds later, 30 seconds later, a few minutes later, the behavior is identical)
    • Remote desktop client reconnects
    • The XP host logs the user out immediately upon reconnect. The remote desktop client renders the initial part of the logout sequence, until "closing network connection", and then signals that the session has been closed.
    • We can then start the remote desktop client again and log in successfully. The XP host has not crashed, Terminal Services have not stopped, everything is working normally, and there are no error messages in any of the event logs.

    We've tested this with different remote desktop clients, including the newest Microsoft clients under Windows XP and Windows 7, RDC for Mac, and CoRD for Mac. The behavior is identical, i.e. it seems to be unrelated to the client.

    If our recollection is correct, resuming an RDP session after a network interruption was possible when connecting to a Windows XP SP2 host. We can't verify this any more, because we have no SP2 hosts to test with.

    Windows 7 and Windows Server 2008 hosts do not exhibit the same behavior. After a network interruption, the remote desktop client reconnects and the session is resumed. It's only the XP SP3 hosts that are doing the autologout.

    I've searched long and hard and haven't found any solution to this problem, or any clues on where the problem could lie. In most cases, terminal services either work or they don't, so the usual troubleshooting involves checking the basics, the permissions and policies, and the graphics drivers. These are all ok in our case, so the standard answers unfortunately aren't going to help.

    Here's hoping someone out there has seen this problem before, and has a useful tip for me!

    Tony

    Tuesday, June 28, 2011 3:34 PM

Answers

  • Have you tried doing a RSOP (resultant set of policy)  to see if all GPs are being enforce properly?

     

    Next look to the following key in the registry:

    HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\Console

    &

    HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

     

    Look for fInheritresetBroken (make dword 0)

    fInheritReconnectSame (make dword 0)

    fReconnectSame (make dword 1)

    fResetBroken (make dword 0)

     

    If all those values are OK then we'll look at the MaxDisconnectionTime values under the Terminal Server Key. You'll need to expand each subskey and look for these two entries in EVERY key, it exists multiple times

    fInheritMaxDisconnectionTime (make this dword 0 to disable Inherit)

    &

    MaxDisconnectionTime (0 should be never)

     

    These can also be change enterprise wide via GP @ - Make sure you verify both the Computer and the User settings.

    Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Session Time Limits

    User Configuration\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Session Time Limits

    • Marked as answer by Anthony Dyson Thursday, June 30, 2011 8:11 AM
    Wednesday, June 29, 2011 1:53 PM
  • OK, problem solved.

    The culprit was fResetBroken as you suspected. Not set in the local registry, but via GPO "Terminate session when time limits are reached".

    It seems that this policy does not work as it should under Windows XP SP3. 

    For now we have deactivated the policy, and will reactivate it when we migrate our clients to Windows 7 in September.

    Bill, thank you very much for your help, much appreciated indeed.

    Tony

    • Marked as answer by Anthony Dyson Thursday, June 30, 2011 8:11 AM
    Thursday, June 30, 2011 8:10 AM

All replies

  • Tony, a few questions.

    Whats the event log showing?  Do you have fast user switching enabled? Is this a Domain environment? Browse to the following registry key:

    HKLM\System\CurrentControlSet\Control\Terminal Server

    Look at the DefaultUserConfiguration .

    Key fResetBroken DWORD should be 0

     

    What is the setting for the following keys:

    1. (most important) fResetBroken

    fInheritAutoClient
    fInheritMaxDisconnectionTime
    fInheritMaxIdleTime
    fInheritMaxSessionTime
    fInheritReconnectSame
    fInheritResetBroken

     

     

    Bill

    MCSA2k3

    Tuesday, June 28, 2011 4:12 PM
  • Hi Bill

    I don't see any log entries at all in the system log or the application log, except those normally associated with a user login.

    Fast user switching is not enabled.

    Yes it's an AD environment.

    fResetBroken: 0
    fInheritAutoClient: key does not exist 
    fInheritAutoLogon: 1
    fInheritInitialProgram: 1
    fInheritMaxDisconnectionTime: 0
    fInheritMaxIdleTime: 0
    fInheritMaxSessionTime: 0
    fInheritReconnectSame: 0
    fInheritResetBroken: 0

    We do have a GPO in force for terminal services, which ends inactive sessions after 2 hours. This shouldn't be relevant to this problem though, because we are able to disconnect and resume successfully when we disconnect cleanly. 

    Perhaps there's a way to instruct the system to log more verbosely?

    Tony

    Wednesday, June 29, 2011 8:31 AM
  • Have you tried doing a RSOP (resultant set of policy)  to see if all GPs are being enforce properly?

     

    Next look to the following key in the registry:

    HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\Console

    &

    HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

     

    Look for fInheritresetBroken (make dword 0)

    fInheritReconnectSame (make dword 0)

    fReconnectSame (make dword 1)

    fResetBroken (make dword 0)

     

    If all those values are OK then we'll look at the MaxDisconnectionTime values under the Terminal Server Key. You'll need to expand each subskey and look for these two entries in EVERY key, it exists multiple times

    fInheritMaxDisconnectionTime (make this dword 0 to disable Inherit)

    &

    MaxDisconnectionTime (0 should be never)

     

    These can also be change enterprise wide via GP @ - Make sure you verify both the Computer and the User settings.

    Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Session Time Limits

    User Configuration\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Session Time Limits

    • Marked as answer by Anthony Dyson Thursday, June 30, 2011 8:11 AM
    Wednesday, June 29, 2011 1:53 PM
  • Was just onto that RSOP when you replied.

    It shows that we have set the following GPOs:

    Set time limit for disconnected sessions: enabled, 30 minutes
    Sets a time limit for active but idle Terminal Server sessions: enabled, 3 hours
    Terminate session when time limits are reached: enabled

    We'll disable all three and do some systematic tests.

    Looking at the registry keys under
    HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

    Here fInheritReconnectSame and fInheritResetBroken were both 1, fReconnectSame was 0. I've changed them all to match your recommendations, but I guess they're being overridden by the GPOs at the moment anyway.

    I'll be back once we do the GPO tests.

    Thanks
    Tony

     

    Wednesday, June 29, 2011 2:24 PM
  • OK, problem solved.

    The culprit was fResetBroken as you suspected. Not set in the local registry, but via GPO "Terminate session when time limits are reached".

    It seems that this policy does not work as it should under Windows XP SP3. 

    For now we have deactivated the policy, and will reactivate it when we migrate our clients to Windows 7 in September.

    Bill, thank you very much for your help, much appreciated indeed.

    Tony

    • Marked as answer by Anthony Dyson Thursday, June 30, 2011 8:11 AM
    Thursday, June 30, 2011 8:10 AM
  • My pleasure, happy RDP'ing!
    Thursday, June 30, 2011 3:50 PM