How do I use the Amazon EC2 serial console to troubleshoot my Windows instance?

3 minute read
0

I want to use the Amazon Elastic Compute Cloud (Amazon EC2) serial console to troubleshoot my Windows instance.

Short description

Amazon EC2 serial console connects to your instance's serial port to help you troubleshoot boot, network configuration, and other issues. The serial console doesn't require your instance to have any networking capabilities and uses commands to function from your instance's serial port. The serial console session lasts during the instance reboot and stop. When your instance reboots, boot messages are viewed from the start.

For more information about supported instance families and AWS Regions, see Prerequisites.

To use the serial console to troubleshoot your Windows instance, complete one of the following tasks:

  • Turn on Special Admin Console (SAC)
  • Turn on SAC offline

Resolution

Note: Before you begin, make sure that you configure access to the serial console.

Turn on SAC

To turn on SAC, complete the following steps:

  1. Use the Remote Desktop Protocol (RDP) to connect to your Windows instance, and then run the following commands:

    Turn on SAC:

    `bcdedit /ems {current} on`  
    `bcdedit /emssettings EMSPORT:1 EMSBAUDRATE:115200`

    Turn on the boot menu:

    `bcdedit /set {bootmgr} displaybootmenu yes`  
    `bcdedit /set {bootmgr} timeout 15`  
    `bcdedit /set {bootmgr} bootems yes`
  2. Reboot the instance to apply the updated configuration:

    shutdown -r -t 0

    Note: When you use the preceding commands to turn on and configure SAC, you can directly connect SAC from the Amazon EC2 console

  3. Use SAC to troubleshoot your Windows instance.

Turn on SAC offline

You can also turn on SAC when you're offline.

To turn on SAC offline, complete the following steps:

  1. Open the Amazon EC2 console.

  2. In the navigation pane, choose Instances.

  3. Select the affected instance and choose Instance state, and then Stop instance.

  4. Choose Launch instances, and then create a temporary instance in the same Availability Zone as the affected instance.
    Note: Make sure that you choose an instance type that uses a different version of Windows. For example, if your instance is Windows Server 2016, then choose a Windows Server 20012 R2 or 2019 instance.

  5. In the navigation pane, choose Volumes, and then locate the root Amazon Elastic Block store (Amazon EBS) volume of the affected instance. 

  6. Detach the Amazon EBS volume and use the default device name (xvdf) to attach the volume to the temporary instance.

  7. Use RDP to connect to the temporary instance, and then use the Disk Management utility to make the volume available for use on Windows.

  8. Open a command prompt and run the following command:
    Note: Replace d with the drive letter of the secondary volume that you attached:

    bcdedit /store d:\boot/bcd /set {default} ems on  
    bcdedit /store d:\boot/bcd /emssettings EMSPORT:1 EMSBAUDRATE:115200  
    bcdedit /store d:\boot/bcd /set {bootmgr} displaybootmenu yes  
    bcdedit /store d:\boot/bcd /set {bootmgr} timeout 15  
    bcdedit /store d:\boot/bcd /set {bootmgr} bootems yes
  9. In the Disk Management utility, choose the drive that you attached. Open the context (right-click) menu, and choose Offline.

  10. In the Amazon EC2 console, detach the affected volume from the temporary instance. Reattach the original volume to your original instance with the device name /dev/sda1. To designate the volume as a root volume, make sure that you specify this device name.

  11. Use SAC from the serial console to start the instance.

  12. (Optional) Delete or stop the temporary instance.

AWS OFFICIAL
AWS OFFICIALUpdated 3 months ago