Troubleshoot Windows VM OS boot failure
Applies to: ✔️ Windows VMs
This article explains why a Windows VM cannot boot and how to solve the problem.
Symptoms
When you pull the screenshot of the virtual machine (VM), the screenshot shows the message that the boot partition could not be found:
Boot failure. Reboot and Select proper Boot device or Insert Boot Media in selected Boot device
Causes
There are several causes for this error:
- The operating system (OS) is unable to boot due to the partition holding the Boot Configuration Data (BCD) Store is inactive.
- The OS is unable to boot due to BCD Corruption.
- The OS is unable to boot due to the boot sector not being found.
Solution
Tip
If you have a recent backup of the VM, you may try restoring the VM from the backup to fix the boot problem.
Process overview
- Create and access a Repair VM.
- Verify that the OS partition is active.
- Fix the missing reference on the BCD store.
- Rebuild the VM.
Note
When encountering this error, the Guest OS is not operational. Troubleshoot this issue in offline mode to resolve this issue.
Create and access a repair VM
- Use steps 1-3 of the VM Repair Commands to prepare a Repair VM.
- Using Remote Desktop Connection, connect to the Repair VM.
Verify that the OS partition is active
Note
This mitigation applies only for Generation 1 VMs. Generation 2 VMs (using UEFI) does not use an active partition.
Verify the OS partition that holds the BCD store for the disk is marked as active.
Open an elevated command prompt and open the DISKPART tool.
diskpart
List the disks on the system and look for added disks and proceed to select the new disk. In this example, the new disk is Disk 1.
list disk sel disk 1
List all of the partitions on the disk and then proceed to select the partition you want to check. Usually System Managed partitions are smaller and around 350 Mb in size. In the image below, this partition is Partition 1.
list partition sel partition 1
Check the status of the partition. In our example, Partition 1 is not active.
detail partition
If the partition isn't active, set the Active flag and then recheck that the change was done properly.
active detail partition
Now exit the DISKPART tool.
exit
Fix the missing reference in the BCD store
Open up an elevated CMD and run CHKDSK on the disk.
chkdsk <DRIVE LETTER>: /f
Gather the current boot setup info and document it, take note of the identifier on the active partition.
For Generation 1 VM:
bcdedit /store <drive letter>:\boot\bcd /enum
If this command errors out due to
\boot\bcd
not being found, then go to the following mitigation.Write down the identifier of the Windows Boot loader. This identifier is the one with the path
\windows\system32\winload.efi
.
For Generation 2 VM:
bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /enum
If this errors out due to
\boot\bcd
not being found, then go to the following mitigation.Write down the identifier of the Windows Boot loader. This is the one with the path
\windows\system32\winload.efi
.
Run the following commands:
For Generation 1 VM:
bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {bootmgr} device partition=<BCD FOLDER - DRIVE LETTER>: bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {bootmgr} integrityservices enable bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} device partition=<WINDOWS FOLDER - DRIVE LETTER>: bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} integrityservices enable bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} recoveryenabled Off bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} osdevice partition=<WINDOWS FOLDER - DRIVE LETTER>: bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} bootstatuspolicy IgnoreAllFailures
Note
In case the VHD has a single partition and both the BCD Folder and Windows Folder are in the same volume, and if the above setup didn't work, then try replacing the partition values with boot.
bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {bootmgr} device boot bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {bootmgr} integrityservices enable bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} device boot bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} integrityservices enable bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} recoveryenabled Off bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} osdevice boot bcdedit /store <BCD FOLDER - DRIVE LETTER>:\boot\bcd /set {<IDENTIFIER>} bootstatuspolicy IgnoreAllFailures
For Generation 2 VM:
bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {bootmgr} device partition=<Volume Letter of EFI System Partition>: bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {bootmgr} integrityservices enable bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {<IDENTIFIER>} device partition=<WINDOWS FOLDER - DRIVE LETTER>: bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {<IDENTIFIER>} integrityservices enable bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {<IDENTIFIER>} recoveryenabled Off bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {<IDENTIFIER>} osdevice partition=<WINDOWS FOLDER - DRIVE LETTER>: bcdedit /store <Volume Letter of EFI System Partition>:EFI\Microsoft\boot\bcd /set {<IDENTIFIER>} bootstatuspolicy IgnoreAllFailures
Rebuild the VM
Use step 5 of the VM Repair Commands to rebuild the VM.
Contact us for help
If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.