How to enable SAC with Cloud Shell

0

I am unable to take RDP of ec2 instance since it is gone to safe mode with network, is it possible to enable SAC by using AWS CloudShell

1 Answer
0

Hi there,

SAC needs to be enabled within the OS and since Cloudshell is similar to the AWS CLI, I believe you will only be able to make API calls on it. To solve this issue you can use bcdedit utility on the rescue instance and use EC2Rescue to recover your instance to the last know working state. To revert back out of Safe Mode with Network I was able to do that by following the steps below:

Note: Please create a backup of your instance in case something happens :-)  
  1. Open the Amazon EC2 console. Locate and select the affected instance. Choose Instance state option then stop the instance.
  2. Launch a new instance (rescue instance) in the same in the same Availability Zone as the impaired instance.
  3. Detach the volume from the impaired instance.
  4. Attach the volume of impaired instance to a rescue instance as secondary drive (xvdf).
  5. RDP into the rescue instance and bring the drive online from the Disk Management.
  6. Open Command prompt as administrator and run this command:
bcdedit /store D:\boot\bcd /deletevalue safeboot

(replace D with the right drive letter of the impaired disk. You can get that from the Disk Management).

  1. Download EC2Rescue on your rescue instance.
  2. Open the EC2Rescue application and select next. From Select mode window choose Offline instance your secondary disk will show on the list, select it and click next.
  3. Choose restore option on Select Offline Instance Option window then restore from the last known good configuration. The disk will automatically go offline from the disk manager after this.
  4. Detach the volume from the rescue instance and attach it back to the impaired instance as a primary disk (/dev/sda1).
  5. Start the instance. It will boot in normal mode and will be available in few minutes.

You can technically be able to enable Windows SAC (Special Admin Console), which will allow you to boot to safe mode directly using EC2 serial console (for Nitro instances) . By connecting to the instance's serial console and using SAC, you can interrupt the boot process and boot Windows in safe mode.

[1] Use SAC to troubleshoot your Windows instance: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/troubleshooting-sac.html

[2] Configure access to the EC2 Serial Console: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configure-access-to-serial-console.html

[3] Using EC2Rescue to troubleshoot Amazon EC2 windows: https://aws.amazon.com/premiumsupport/knowledge-center/ec2rescue-windows-troubleshoot/

Cebi
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions