By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How do I resolve a Windows activation fail message on my Amazon EC2 Windows instance?

4 minute read
1

I want to resolve a Windows activation fail message on my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance.

Short description

Windows instances use Microsoft Key Management Service (Microsoft KMS) on AWS for activation. If your instance can't reach the Microsoft KMS server, then you might receive a Windows activation error message. For more Information, see Understanding KMS on the Microsoft Learn website.

Resolution

To resolve a Windows activation failure on an Amazon EC2 instance, complete one of the following:

Use an AWS Systems Manager Automation document to activate Windows

The AWSSupport-ActivateWindowsWithAmazonLicense automation document activates an Amazon EC2 Windows instance with an Amazon-provided license. The automation checks the current status of Windows for your instance, and then activates Windows if its status is inactive.

Note: You can't use the AWSSupport-ActivateWindowsWithAmazonLicense automation document to activate Bring Your Own License (BYOL) Windows instances. To use your own license, see Microsoft licensing on AWS.

To use an AWS Systems Manager Automation document to activate Windows, complete the following steps:

  1. Open the AWS Systems Manager console. Be sure to select the same AWS Region as the Amazon EC2 Windows instance that needs to be activated.
  2. In the navigation pane, choose Automation, and then choose Execute automation.
  3. In the search field, enter ActivateWindowsWithAmazonLicense.
  4. Select the AWSSupport-ActivateWindowsWithAmazonLicense Automation document, and then choose Next.
  5. For Execute automation document, choose Simple execution.
  6. For Input parameters, turn on Show interactive instance picker.
  7. Choose your Amazon EC2 instance, and then proceed to step 9. If you don't see your instance in the list, then proceed to step 8.
  8. Configure AWS Systems Manager for your Amazon EC2 instance.
    -or-
    If you can't configure AWS Systems Manager or if the instance isn't available for Input parameters, then turn off Show interactive instance picker.
    For InstanceID, enter the ID for your Amazon EC2 instance.
    For AllowOffline, choose True.
    Note: If you set AllowOffline to True, then your Amazon EC2 will stop and then restart. After Amazon EC2 restarts, the data in your instance store volumes will be deleted. Also, if you don't use an Elastic IP address, then your public IP address will change.
  9. Choose Execute.

To monitor AWS Systems Manager's progress, complete the following:

  1. Open the AWS Systems Manger console.
  2. From the navigation pane, choose Automation.
  3. Choose the running automation, and then choose Executed steps.
  4. To view the automation's output, choose Outputs.

Manually activate Windows

Complete the following based on the version of Windows Server that your instance uses and the Amazon EC2 configuration tool that's installed:

Windows Server 2016 or 2019

  1. Verify that the latest version of EC2Launch v1 is installed.

  2. Open PowerShell as an administrator.

  3. Import the EC2Launch module:

    Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1"
  4. Add the routes:

    Add-Routes
  5. Set the activation settings:

    Set-ActivationSettings
  6. Activate Windows:

    slmgr /ato

Windows Server 2022 or instances with EC2Launch v2 installed

  1. Verify that the latest version of EC2Launch v2 is installed.
    Note: EC2Launch v2 is installed by default on instances that use Windows Server 2022.

  2. Open PowerShell as an administrator.

  3. Restart EC2Launch v2:

    Net Restart "Amazon EC2Launch"

    Note: When EC2Launch v2 restarts, it automatically resets the OS-level routes.

  4. If Windows doesn't activate, then check the network communication from the instance to the Microsoft KMS server.

  5. Perform telnet from your Amazon EC2 instance to the Microsoft KMS servers , and then open PowerShell.

  6. Run the following commands:

    Test-netconnection 169.254.169.250 -Port 1688  
    Test-netconnection 169.254.169.251 -Port 1688
  7. Confirm that the connection status output is TcpTestSuccessed=True. If the connection status output is False, then verify that the following registry keys have the correct Microsoft KMS values:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows  
    NT\CurrentVersion\SoftwareProtectionPlatform  
    KeyManagementServiceName - 169.254.169.250  
    KeyManagementServicePort - 1688

    Note: You can also enter 169.254.169.251 as the KeyManagementServiceName value.

  8. Repeat step 6. If the connection status output is False, then check the Amazon Time Sync Service on your Amazon EC2 instance.

Troubleshoot an "Unable to Activate Windows" error

If you launch a Windows instance from an Amazon Elastic Block Store (Amazon EBS) snapshot, then you might receive the error "A problem occurred when Windows tried to activate. Error Code 0xC004F074". To troubleshoot this error, see "Unable to activate Windows".

Note: Amazon EBS snapshots are supported only for Linux instances.

Related information

EC2Config settings files

Upgrade PV drivers on EC2 Windows instances

How do I troubleshoot time issues with my EC2 Windows instance?

AWS OFFICIAL
AWS OFFICIALUpdated 25 days ago