You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Windows operating system issue
Solution for "Because of a protocol error, this session will be disconnected. Please try connecting to the remote computer again." error occurred when local PC connects to Windows ECS instance via Remote Desktop
Copy page
Download PDF
Solution for "Because of a protocol error, this session will be disconnected. Please try connecting to the remote computer again." error occurred when local PC connects to Windows ECS instance via Remote Desktop
Problem description​
When a local PC connects to an ECS instance running the Windows operating system via Remote Desktop, the "Because of a protocol error, this session will be disconnected. Please try connecting to the remote computer again." error occurs.​
Causes​
Some causes of this error are as follows:​
Solutions​
In the example provided in this topic, Windows Server 2016 Datacenter Edition 64 bit is used as an example to introduce solutions. The solutions include modifying the security configuration policy of the Remote Desktop Session Host, closing the application that is occupying the remote connection port, or changing the remote connection port.​
Modify the security configuration of the Remote Desktop Session Host​
  1. Log in to the instance HammerDB-01 via VNC. For detailed steps, refer to Using the console to log in to a Windows instance.​
If you are unable to use VNC to log in to the instance, reset the login password and then try again.​
  1. Click the "Start" icon, and select "Windows System > Run".​
  1. Enter the following command in the "Run" dialog box, and click the "OK" button.​
  • ​
    gpedit.msc​
    ​
  1. In the "Local Group Policy Editor" window, select "Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Security".​
  1. Double-click "Require use of specific security layer for remote (RDP) connections" to open the security layer configuration window.​
  1. Click "Enabled", select "RDP" in the "Security Layer" drop-down list, and then click the "Apply" and "OK" buttons in sequence to complete the operation.​
  1. Click the "Start" button, and select "Windows System > Command Prompt".​
  1. Execute the following command to make the updated policy take effect.​
  • ​
    gpupdate​
    ​
  1. Use Remote Desktop to connect to the instance again and check whether you can log in to the instance as expected.​
Close the application that is occupying the remote connection port​
  1. Log in to the instance HammerDB-01 via VNC. For detailed steps, refer to Using the console to log in to a Windows instance.​
If you are unable to use VNC to log in to the instance, reset the login password and then try again.​
  1. Click the "Start" button, and select "Windows PowerShell > Windows PowerShell".​
  1. Execute the following command to obtain the PID (process ID) of the process occupying the remote connection port.​
  • ​
    Get-NetTCPConnection -LocalPort 3389 | Select-Object OwningProcess, State | Get-Unique​
    ​
tip​
In the example provided in this topic, port 3389 is used as the default port for Remote Desktop connections. Replace it with the actual port used by your Remote Desktop service.​
  1. Execute the following command to view the application associated with the process ID (PID).​
  • ​
    Get-Process -Id <PID>​
    ​
tip​
Replace <PID> with the process ID obtained in Step 3.​
  1. Execute the following command to close the process with the specified PID.​
warning​
There are risks associated with closing a process directly. Make sure that this operation will not affect the normal operation of your business. ​
  • ​
    Stop-Process -Id <PID> -Force​
    ​
tip​
Replace <PID> with the ID of the process that you want to close.​
  1. Execute the following command to restart the RDP service.​
  • ​
    Restart-Service -Name TermService -Force​
    ​
  1. Use Remote Desktop to connect to the instance again and check whether you can log in to the instance as expected.​
Change the remote connection port​
  1. Log in to the instance HammerDB-01 via VNC. For detailed steps, refer to Using the console to log in to a Windows instance.​
If you are unable to use VNC to log in to the instance, reset the login password and then try again.​
  1. Click the "Start" icon, and select "Windows System > Run".​
  1. Enter the following command in the "Run" dialog box, and click the "OK" button.​
  • ​
    regedit​
    ​
  1. In the "Registry Editor" window, select "HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Terminal Server > WinStations > RDP-Tcp".​
  1. Double-click "PortNumber" in the parameter list on the right.​
  1. On the parameter editing page, set the "Base" option to "Decimal", modify the value in the "Value data" field to the new port number used for remote connection, and click the "OK" button to complete the operation.​
  • ​​​
  1. Click the "Start" button, and select "Windows PowerShell > Windows PowerShell".​
  1. Execute the following command to restart the RDP service.​
  • ​
    Restart-Service -Name TermService -Force​
    ​
  1. Use Remote Desktop to connect to the instance again and check whether you can log in to the instance as expected.​
Last updated: 2026.04.13 16:50:03