Remote Desktop intermittently freezing

270,624

Solution 1

I also ran into this issue since July 2019 on a Windows 10 1903 acting as the client machine. The following workaround on the client works for me, so that RDP no longer freezes.

Start an elevated command prompt (run cmd.exe as administrator), and then run:

reg add "HKLM\software\policies\microsoft\windows nt\Terminal Services\Client" /v fClientDisableUDP /d 1 /t REG_DWORD

After that, close and reopen all your RDP sessions on your client computer to restart the Remote Desktop Client (mstsc.exe, aka Microsoft Terminal Services Client) application.

I'm waiting for a final fix to this issue.

Follow-up: I am not sure, but it looks like fixed in 21H1 (both client and server must run 21H1 or higher). For me I no longer see freezes without the disable UDP workaround.

Solution 2

Encountered this with Windows 10 (1903 and 1909).

Manifestations of the problem:

  1. RDP session updates oddly, distorting audio and video.

  2. RDP session hard-freezes. Client window is responsive, but the content within it is essentially a static image.

    • Sometimes the RDP session recovers, resuming normal function.

    • Other times the RDP session seems to hang indefinitely. No error messages seen; client window can be closed and restarted normally.

Speculated causation:

  • Seems to occur primarily when using the UDP protocol under load.

  • My guess is that the RDP protocol has lost some of its resilience to packets getting lost or out-of-order.

Work-arounds:

No single work-around seems complete. For example, I've had RDP completely freeze even in TCP-only mode. However, TCP-only coupled with trying to improve network connectivity or/and reducing load (such as video and audio) seems to greatly reduce the incident rate.

  1. Partial work-around: Improve network connectivity.
    A direct local connection may be relatively reliable.

  2. Partial work-around: Reduce network strain.
    Reducing RDP session settings, avoiding audio, and avoiding video seem to help.

  3. Full-ish work-around: Disable UDP.
    RDP seems to behave a lot better with TCP than UDP. Switching to TCP-only does seem a bit more laggy, but the lag is more ordered (which is strangely nicer than the erratic lag) and I've yet to encounter an indefinite hang.

    Three ways to implement (probably mutually compatible, but probably only need to do one):

    1. On client: Local Group Policy Editor
      → Local Computer Policy
      → Computer Configuration
      → Administrative Templates
      → Windows Components
      → Remote Desktop Services
      → Remote Desktop Connection Client
      → Turn Off UDP On Client
             → Enabled

    2. On server [untested]: Local Group Policy Editor
      → Local Computer Policy
      → Computer Configuration
      → Administrative Templates
      → Windows Components
      → Remote Desktop Services
      → Remote Desktop Session Host
      → Connections
      → Select RDP transport protocols
             → Enabled
             → Use only TCP

    3. Not recommended (tweaking Registry Editor)
      Source: @robbiefan's answer.
      On client: Registry Editor
      → Computer
      → HKEY_LOCAL_MACHINE
      → SOFTWARE
      → Policies
      → Microsoft
      → Windows NT
      → Terminal Services
      → Client
      → [right-click] → New → DWORD (32-bit) Value
             → Name: fClientDisableUDP
             → Value data: 1
             → Base: Decimal
      Note: This seems to have worked for me when I tried it, but can't verify much beyond that. I reverted this solution after trying it, preferring to rely on the Group Policy instead.


Discussion: Background

I'm fuzzy on the details, but in short, I think there was something about some bugs being discovered in the RDP protocol as implemented prior to Windows 10 1903:

  1. CVE-2019-1181 | Remote Desktop Services Remote Code Execution Vulnerability;

  2. CVE-2019-1182 | Remote Desktop Services Remote Code Execution Vulnerability.

Then Windows 10 1903 was meant to fix these, I think.

Apparently the new version of the RDP protocol has some issues, e.g. this one. Disabling UDP (to force TCP) seems to be a decent enough work-around, though the protocol can feel a bit laggier. That said, the older RDP protocol also had some rather obnoxious audio latency problems that seem to be a lot better now, so, personally, I'm happy about that!

Solution 3

For me, connecting with Remote Desktop over VPN, the fix seems to be to disable Persistent bitmap caching under Show Options >> Local Experience

options dialog

Windows 10 Home build 18363 connecting to Win10 Enterprise build 18363 over Checkpoint VPN.

I tried disabling UDP as per the top voted answer but that resulted in frequent outright disconnects instead of frozen-screen symptoms.

Update: This isn't a complete fix. The freezing happens less often but still happens. I can trigger the freezing semi-"reliably" by copying dozens to hundreds of rows in Excel. Appears to be sensitive to size of the selection (smaller is less likely to freeze). Disabling clipboard under Local Resources doesn't seem to matter.

Solution 4

I have had this issue for several weeks. I believed it to coincide with my laptop (that I'm connecting too) coming under heavy load.

This made me think that its possibly a result of the laptop throttling itself and loosing packets/connection, possibly as a result of prioritizing other things..

Yesterday I placed my laptop on 3 upside down shot glasses and aimed a fan at it to keep it cool.

I have not had a disconnect since. So from getting this issue at least 10 times per day I now have 0 cases in 2 days.

Not a real fix, but possibly something to keep in mind as a temporary workaround.

Share:
270,624

Related videos on Youtube

andre_ss6
Author by

andre_ss6

All original source code I post on answers on stackoverflow.com and other StackExchange sites are dual-licensed under the MIT license.

Updated on September 18, 2022

Comments

  • andre_ss6
    andre_ss6 almost 2 years

    I use a Windows 10 machine remotely at work. Both the local and remote machine are in the same ISP network (not same local network, but same ISP). I've been using it like that for almost a year now and I had never experienced absolutely any issues.

    Until recently. I don't know if anything specific triggered this behavior, but I feel that it started happening after I upgraded the remote to W10 1903. I later upgraded the local one as well and I feel that it only made the problem worse (but I don't really have any data).

    From time to time, the session will freeze - the image stops updating. However, what I type and mouse clicks are still being sent. No error message is shown whatsoever, the image simply freezes. To make it work again, I have to close and re-open the session. Everything that I had typed and/or clicked while it was frozen is there.

    Is there any way I can debug this?

  • user0000001
    user0000001 almost 5 years
    Thank you! Been using RDP for over a decade and never had issues until 1903. I am keeping my fingers crossed that this is my solution!
  • stevek_mcc
    stevek_mcc over 4 years
    Many thanks, working well again for a few days now, after running that on the client! Here the problem started after the RDP host was upgraded to 1903 (client is still 1809).
  • adabyron
    adabyron over 4 years
    Thanks! Haven't had a freeze for over a day now, what a relief. I was restarting RDP about 20 times a work day, absolutely horrible experience. I assume following the instructions in this post lets you turn off the UDP protocol by policy setting.
  • Vylix
    Vylix over 4 years
    is this for the client(s) or host?
  • hasc
    hasc over 4 years
    @Vylix The client, i.e. the machine from which you connect to the remote host.
  • derek1284
    derek1284 over 4 years
    This is still broken in Windows 10 1909. (I updated my server from Windows 7 and this problem started at that point). The UDP workaround prevents the freezing, but ultimately UDP is preferable for this protocol.
  • Nat
    Nat over 4 years
    Note: I started encountering this problem despite already having the check-box for smart cards unchecked, so this may not be a full solution.
  • Nat
    Nat over 4 years
    Ugh, just had my first freeze under TCP-only, so I guess it's still just a partial work-around. A pretty good partial, though.
  • Nat
    Nat over 4 years
    Not long after posting this, a client of mine received what (according to the update logs) appears to have been KB4551762 (2020-03-12). Since receiving this update, RDP has been significantly better.
  • jaybro
    jaybro over 4 years
    Are there any security implications for implementing this registry entry?
  • Py Mongo
    Py Mongo over 4 years
    @jaybro no, just performance implications
  • Py Mongo
    Py Mongo over 4 years
    not for me with that update. However I'm using RDP over SSTP VPN - I think VPN within this can also cause some issues.
  • Matty Brown
    Matty Brown about 4 years
    Same as @Nat, I have Smart Cards disabled, yet this issue can still occur, so your solution doesn't solve the issue completely.
  • bugybunny
    bugybunny about 4 years
    Might be that 1903 made this worse but I’ve had such freezes with other Win10 versions prior to 1903 already. Switching to TCP-only made it much better. No freeze yet after a few days.
  • Mr. Boy
    Mr. Boy about 4 years
    How can RDP be broken and this not be a major issue given how central RDP is to Windows?
  • Mr. Boy
    Mr. Boy about 4 years
    Is the local group policy fix doing the same thing as the raw registry hack?
  • Nat
    Nat about 4 years
    @Mr.Boy: I assume so. I figure that disabling UDP is a feature of RDP that can be triggered in different ways, where the registry hack and policy settings are just different ways to access it.
  • Nat
    Nat about 4 years
    Note: It may help to force a policy update since policy can update on a delay. Personally I've gotten into a habit of forcing policy updates via gpupdate, though I'm hesitant to make general claims about exactly how it works across all sorts of different Windows environments.
  • chdev77
    chdev77 about 4 years
    I did this manually on my local and remote PC's. Usually anytime I would compile my apps the output log of the compile would cause the session to freeze almost immediately. This solved my problem by disabling UDP.
  • Adambean
    Adambean about 4 years
    I don't think this applies to the Remote Desktop app via the Microsoft Store. With UDP disabled the screen freezing (with inputs still working) occurs quite regularly on that.
  • Tom
    Tom about 4 years
    This fixed my issue with Win10 1909 remoting into another Win10 1099 box, even though my symptoms were a little different. For me, mouse clicks on buttons/controls didn't work, and I could click on inactive windows to raise them. That would happen 2-10x per day, and restarting the RDP session always fixed it. I made the above reg change 2 days ago, and the problem has not reappeared.
  • user1696603
    user1696603 about 4 years
    For me on build 18363 applying this changed the behaviour from RD screen turning into a static image to "Remote Desktop lost connection. Reconnecting attempt n of 20". So for reconnection has never been successful. :-/ Another factor: the network to my RD is over Checkpoint VPN.
  • NateJ
    NateJ about 4 years
    And in case you're running Win10 Home, a helpful link to get gpedit.msc enabled (because it's not there by default): itechtics.com/enable-gpedit-windows-10-home
  • Ian Boyd
    Ian Boyd about 4 years
    @Mr.Boy The MS developers don't handle packets being lost, or received out of order, when UDP is enabled. Next up: a hash list that crashes if there's a collision.
  • Allan F
    Allan F almost 4 years
    Will give this a try ... If it works will come back and give this a vote up ..
  • Allan F
    Allan F almost 4 years
    nope .. still a freeze an hour or so after trying this ..
  • user1696603
    user1696603 almost 4 years
    @AllanF post updated. For me it seems to be related to Excel and copying.
  • Allan F
    Allan F almost 4 years
    Same .. something to do with copy to clipboard ..
  • Rajasekhar
    Rajasekhar over 3 years
    You save my day. Frustrated with 2 days. I should have searched for the solution earlier.
  • Nat
    Nat over 3 years
    I wonder if disabling animations might help? The hypothesis being that RDP's buffer is getting overloaded with micro-updates, which might be reduced if micro-animations are disabled.
  • aggieNick02
    aggieNick02 over 3 years
    I'll add that this seems more likely to occur if it has just recently occurred. That is, I'll go hours without hitting it, and then hit it maybe 5 times within a 30 minute span. Definitely jives with theories about dropped packets. Hoping the UDP disabling improves things.
  • Vaccano
    Vaccano over 3 years
    I find it hilarious (in a very sad way) that my Windows 7 box (as client) did not have any issues, but once I moved to a Windows 10 box, BOOM! Remote Desktop random failures!
  • gogagubi
    gogagubi over 3 years
    What a precious solution. When I moved on windows 10 after several updates it started to freeze. I installed VMware and windows 7 on it to have RDP working properly. After applying this config RDP works as expected. So Far so good. Thanks a lot.
  • v.oddou
    v.oddou about 3 years
    this issue is still severe (April 2021), the TCP switch does improve. But introduces lag and blurring. And a desynch of sound & video in media playback. But more stable and predictable. I tested solution 2. with apparently appreciable results.
  • Jari Turkia
    Jari Turkia almost 3 years
    This UDP-fix helped my hanging RDP-connections from 21H1 to Windows 11.