View a markdown version of this page

Troubleshoot issues connecting to your Amazon EC2 Windows instance - Amazon Elastic Compute Cloud

Troubleshoot issues connecting to your Amazon EC2 Windows instance

The following information and common errors can help you troubleshoot issues when connecting to your Windows instance.

Remote Desktop can't connect to the remote computer

Try the following to resolve issues related to connecting to your instance:

  • Verify that you're using the correct public DNS hostname. (In the Amazon EC2 console, select the instance and check Public DNS (IPv4) in the details pane.) If your instance is in a VPC and you do not see a public DNS name, you must enable DNS hostnames. For more information, see DNS attributes for your VPC in the Amazon VPC User Guide.

  • Verify that your instance has a public IPv4 address. If not, you can associate an Elastic IP address with your instance. For more information, see Elastic IP addresses.

  • To connect to your instance using an IPv6 address, check that your local computer has an IPv6 address and is configured to use IPv6. For more information, see Configure IPv6 on your instances in the Amazon VPC User Guide.

  • Verify that your security group has a rule that allows RDP access on port 3389.

  • If you copied the password but get the error Your credentials did not work, try typing them manually when prompted. It's possible that you missed a character or got an extra white space character when you copied the password.

  • Verify that the instance has passed status checks. For more information, see Status checks for Amazon EC2 instances and Troubleshoot Amazon EC2 Linux instances with failed status checks.

  • Verify that the route table for the subnet has a route that sends all traffic destined outside the VPC to the internet gateway for the VPC. For more information, see Creating a custom route table (Internet Gateways) in the Amazon VPC User Guide.

  • Verify that Windows Firewall, or other firewall software, is not blocking RDP traffic to the instance. We recommend that you disable Windows Firewall and control access to your instance using security group rules. Try one of the following options:

    • Use AWSSupport-TroubleshootRDP to disable the Windows Firewall profiles using SSM Agent. This option requires that the instance is configured for AWS Systems Manager.

    • Use AWSSupport-ExecuteEC2Rescue.

    • Stop the instance, detach the root volume, and attach the volume to a temporary instance as a data volume. Connect to the temporary instance and bring the volume online. Load the registry hive from the data volume. Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicyStandardProfile, set EnableFirewall to 0. Unload the registry hive and then bring the volume offline. Detach the volume from the temporary instance and attach it to the original instance as the root volume. Start the original instance.

  • Verify that Network Level Authentication is disabled on instances that are not part of an Active Directory domain (use AWSSupport-TroubleshootRDP to disable NLA).

  • Verify that the Remote Desktop Service (TermService) Startup Type is Automatic and the service is started (use AWSSupport-TroubleshootRDP to enable and start the RDP service).

  • Verify that you are connecting to the correct Remote Desktop Protocol port, which by default is 3389 (use AWSSupport-TroubleshootRDP to read the current RDP port and change it back to 3389).

  • Verify that Remote Desktop connections are allowed on your instance (use AWSSupport-TroubleshootRDP to enable Remote Desktop connections).

  • Verify that the password has not expired. If the password has expired, you can reset it. For more information, see Reset the Windows administrator password for an Amazon EC2 Windows instance.

  • If you attempt to connect using a user that you created on the instance and receive the error The user cannot connect to the server due to insufficient access privileges, verify that you granted the user the right to log on locally. For more information, see Grant a Member the Right to Logon Locally.

  • If you attempt more than the maximum allowed concurrent RDP sessions, your session is terminated with the message Your Remote Desktop Services session has ended. Another user connected to the remote computer, so your connection was lost. By default, you are allowed two concurrent RDP sessions to your instance.

Error using the macOS RDP client

If you are connecting to a Windows Server instance using the Remote Desktop Connection client from the Microsoft website, you may get the following error:

Remote Desktop Connection cannot verify the identity of the computer that you want to connect to.

Download the Microsoft Remote Desktop app from the Mac App Store and use the app to connect to your instance.

RDP displays a black screen instead of the desktop

Try the following to resolve this issue:

  • Check the console output for additional information. To get the console output for your instance using the Amazon EC2 console, select the instance, and then choose Actions, Monitor and troubleshoot, Get system log.

  • Verify that you are running the latest version of your RDP client.

  • Try the default settings for the RDP client.

  • If you are using Remote Desktop Connection, try starting it with the /admin option as follows.

    mstsc /v:instance /admin
  • If the server is running a full-screen application, it might have stopped responding. Use Ctrl+Shift+Esc to start Windows Task Manager, and then close the application.

  • If the server is over-used, it might have stopped responding. To monitor the instance using the Amazon EC2 console, select the instance and then select the Monitoring tab. If you need to change the instance type to a larger size, see Amazon EC2 instance type changes.

Unable to remotely log on to an instance with a user that is not an administrator

If you are not able to remotely log on to a Windows instance with a user that is not an administrator account, ensure that you have granted the user the right to log on locally. See Grant a user or group the right to log on locally to the domain controllers in the domain.

Troubleshooting Remote Desktop issues using AWS Systems Manager

You can use AWS Systems Manager to troubleshoot issues connecting to your Windows instance using RDP.

AWSSupport-TroubleshootRDP

The AWSSupport-TroubleshootRDP automation document allows the user to check or modify common settings on the target instance that can impact Remote Desktop Protocol (RDP) connections, such as the RDP Port, Network Layer Authentication (NLA), and Windows Firewall profiles. By default, the document reads and outputs the values of these settings.

The AWSSupport-TroubleshootRDP automation document can be used with EC2 instances, on-premises instances, and virtual machines (VMs) that are enabled for use with AWS Systems Manager (managed instances). In addition, it can also be used with EC2 instances for Windows Server that are not enabled for use with Systems Manager. For information about enabling instances for use with AWS Systems Manager, see Managed nodes in theAWS Systems Manager User Guide.

To troubleshoot using the AWSSupport-TroubleshootRDP document
  1. Log in to the Systems Manager Console.

  2. Verify that you are in the same Region as the impaired instance.

  3. Choose Documents from the left navigation pane.

  4. On the Owned by Amazon tab, enter AWSSupport-TroubleshootRDP in the search field. When the AWSSupport-TroubleshootRDP document appears, select it.

  5. Choose Execute automation.

  6. For Execution Mode, choose Simple execution.

  7. For Input parameters, InstanceId, enable Show interactive instance picker.

  8. Choose your Amazon EC2 instance.

  9. Review the examples, then choose Execute.

  10. To monitor the execution progress, for Execution status, wait for the status to change from Pending to Success. Expand Outputs to view the results. To view the output of individual steps, in Executed Steps, choose an item from Step ID.

AWSSupport-TroubleshootRDP examples

The following examples show you how to accomplish common troubleshooting tasks using AWSSupport-TroubleshootRDP. You can use either the example AWS CLI start-automation-execution command or the provided link to the AWS Management Console.

Example: Check the current RDP status

AWS CLI:

aws ssm start-automation-execution --document-name "AWSSupport-TroubleshootRDP" --parameters "InstanceId=i-1234567890abcdef0, Action=Custom" --region region_code

AWS Systems Manager console:

https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootRDP?region=region#documentVersion=$LATEST
Example: Disable the Windows Firewall

AWS CLI:

aws ssm start-automation-execution --document-name "AWSSupport-TroubleshootRDP" --parameters "InstanceId=i-1234567890abcdef0, Action=Custom, Firewall=Disable" --region region_code

AWS Systems Manager console:

https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootRDP?region=region_code#documentVersion=$LATEST&Firewall=Disable
Example: Disable Network Level Authentication

AWS CLI:

aws ssm start-automation-execution --document-name "AWSSupport-TroubleshootRDP" --parameters "InstanceId=i-1234567890abcdef0, Action=Custom, NLASettingAction=Disable" --region region_code

AWS Systems Manager console:

https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootRDP?region=region_code#documentVersion
Example: Set RDP Service Startup Type to Automatic and start the RDP service

AWS CLI:

aws ssm start-automation-execution --document-name "AWSSupport-TroubleshootRDP" --parameters "InstanceId=i-1234567890abcdef0, Action=Custom, RDPServiceStartupType=Auto, RDPServiceAction=Start" --region region_code

AWS Systems Manager console:

https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootRDP?region=region_code#documentVersion=$LATEST&RDPServiceStartupType=Auto&RDPServiceAction=Start
Example: Restore the default RDP Port (3389)

AWS CLI:

aws ssm start-automation-execution --document-name "AWSSupport-TroubleshootRDP" --parameters "InstanceId=i-1234567890abcdef0, Action=Custom, RDPPortAction=Modify" --region region_code

AWS Systems Manager console:

https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootRDP?region=region_code#documentVersion=$LATEST&RDPPortAction=Modify
Example: Allow remote connections

AWS CLI: