WindowsWindows 10

An Internal Error has Occurred: Remote Desktop Connection Error

By November 2, 2020No Comments

I saw a strange message “An internal error has occurred” when trying to connect from Windows 10 to a recently deployed RDSH server running Windows Server 2012 R2 using RDP. For the longest while the Remote Desktop connection to the server worked fine, but after the installation and configuration of RemoteApps and server restart, I was not able to connect to its desktop. Obviously, the Remote Desktop Services seems to be working, since a user is prompted for a password when connecting.

As I have understood, the RDP console message “An internal error has occurred” may appear in different cases and be caused by both Remote Desktop server and client issues. In this post I’ll try to describe all the ways to solve the problem and the scenario that had helped me.

windows 10 remote desktop connection error An internal error has occurred

First of all, make sure that the RDP port 3389 accepts connection on your RDS server, and that the connection is not blocked by the firewall (Test-NetConnection your_rdp_server –port 3389).

Having studied the RDP connection logs on the RDS server, I did not see any errors. The Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational log showed that the RDP session was created:

The server accepted a new TCP connection from client
Connection RDP-Tcp#4 created

However, the RDP session was terminated later without any error:

The server has terminated main RDP connection with the client.
The disconnect reason is 0
The server has terminated main RDP connection with the client: Microsoft-Windows-RemoteDesktopServices-RdpCoreTS

Check the status of the Remote Desktop Services on your remote server and restart the service. You can do it remotely through the Services.msc console (use the “Connect to another computer” option), but it is easier to check a service status and restart it using PowerShell:

(Get-Service TermService -ComputerName ny-rds1).status

The service is running, let’s restart it:

Get-Service TermService -ComputerName ny-rds1| Restart-Service –force –verbose

restart TermService powershell

But this did not solve the problem.

Here are some other ways to solve it I have managed to find in the Web:

  • If you see the EventID 1057 in the TerminalServices-RemoteConnectionManager event log (The RD Session Host Server has failed to create a new self signed certificate to be used for RD Session Host Server authentication on SSL connections), go to the folder C:\ProgramData\Microsoft\Crypto\RSA, rename the Machinekeys folder into Machinekeys_bak and restart the TermService;
  • I have also found that the RDP problem “An internal error has occurred” happened in Windows 10 1809 if the Configure H.264/AVC hardware encoding for Remote Desktop connections policy is enabled on the remote computer (it is located in the following GPO section: Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Remote Session Environment). To solve the problem, you just need to disable the UDP protocol for RDP by creating the fClientDisableUDP parameter with the value 1 in the registry key HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client;
  • If the error appears immediately after clicking connect (the connection attempt seem to be immediately rejected by remote desktop server), try to increase the maximum outstanding RDP connections limit. On Windows 10 the SKUs by default is set to 100, but on Windows Server is 3000. Run the regedit.exe and create the DWORD registry parameter MaxOutstandingConnections with the value 10000 in the reg key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\. (The special RDP counter takes into account not quite correct RDP logins, and upon reaching the specified MaxOutstandingConnections value, the RDP access is blocked.)

Neither of the scenarios described above was applicable in my case. Occasionally, I found that other computers did not experience any problems when connecting to this RDS server. It meant that there was an issue with my computer, not with the Remote Desktop server.

I cleared the RDP connection history in the registry key HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers and reset the RDP cache in C:\Users\%Username%\AppData\Local\Microsoft\Terminal Server Client\Cache (prior to doing it, close all running mstsc.exe sessions):

del "C:\Users\%Username%\AppData\Local\Microsoft\Terminal Server Client\cache"

clean rdp cache cmd

Then I restarted my computer, and the RDP connection error disappeared!

Leave a Reply