Share via

I rebooted my VM in safe mode and now I can't access it

Rick Sypriano 0 Reputation points
2026-03-12T02:07:05.33+00:00

How can I reset the safe mode flag on my VM?

????????????????????????????????????????????????????????????????????????????

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

{count} votes

3 answers

Sort by: Most helpful
  1. Praveen Valluri 0 Reputation points
    2026-03-12T04:13:19.36+00:00

    If your VM keeps booting into Safe Mode, the Safe Mode flag may still be set in the Windows boot configuration.

    You can remove it by opening Command Prompt as Administrator and running:

    bcdedit /deletevalue {current} safeboot

    After that, restart the virtual machine and it should boot normally.

    I also wrote a detailed step-by-step guide here if you need more troubleshooting steps: https://winchatsupport.com/reset-safe-mode-flag-vm/

    0 comments No comments

  2. Rick Sypriano 0 Reputation points
    2026-03-12T02:45:19.2333333+00:00

    For some reason, I can't log in. I reset my password, so I know what the username and password are, but I'm guessing about the domain. I tried just hitting enter." "<my VN name>" and "localhost". AI thinks it may be because of Safe Mode.

    0 comments No comments

  3. Q&A Assist
    2026-03-12T02:07:14.2766667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To reset the Safe Mode flag on an Azure Windows VM so it boots normally again, use one of these methods.

    1. Connect to the VM’s Serial Console and open a CMD instance. See: Serial Console and open CMD instance.
    2. In the command prompt, list the current boot configuration:
         bcdedit /enum
      
    3. In the Windows Boot Loader section, look for the safeboot flag (value may be minimal or network). Its presence means the VM is forced into Safe Mode.
    4. Remove the Safe Mode flag so the VM boots normally:
         bcdedit /deletevalue {current} safeboot
      
    5. Confirm the flag is gone:
         bcdedit /enum
      
    6. Restart the VM from the Azure portal and then reconnect via RDP.

    Method 2 – Repair the VM offline using a recovery VM

    Use this if Serial Console is not available.

    1. Attach the OS disk to a recovery VM
      1. In the Azure portal, stop the affected VM.
      2. Detach its OS disk and attach the OS disk to a recovery VM.
      3. RDP to the recovery VM and open Disk Management to confirm the attached OS disk is Online and note its drive letter (assume F: below; replace with the actual letter).
    2. Check the BCD store on the attached OS disk
      1. Open an elevated Command Prompt on the recovery VM.
      2. Run:
              bcdedit /store F:\boot\bcd /enum
        
      3. Identify the entry that has the \Windows folder; its identifier is typically {default} or named Default.
    3. Remove the Safe Mode flag from that entry
         bcdedit /store F:\boot\bcd /deletevalue {Default} safeboot
      
    4. Verify the flag is removed
         bcdedit /store F:\boot\bcd /enum
      
    5. Detach and reattach the OS disk
      1. In the Azure portal, detach the OS disk and recreate the VM using that disk.
      2. Start the VM and connect via RDP; it should now boot in normal mode.

    These steps clear the safeboot setting so the VM no longer forces Safe Mode at boot.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.