This article provides solutions to an issue where Windows VM doesn't start and generates errors.
Symptom
Windows doesn't start and generates the one of the following errors:
Error 1:
File: \Windows\system32\winload.exe
Status: 0xc000000f
Info: The application or operating system couldn't be loaded because a required file is missing or contains errors.
Error 2:
File: \Boot\BCD
Status: 0xc000000f
Info: The Boot Configuration Data for your PC is missing or contains errros
Error 3:
File: \Windows\System32\drivers\<Binary>
Status: 0xc000000f
Info: The operating system couldn't be loaded because a critical system driver is missing or contains errors.
In this message, <BINARY> represents the actual binary file that's found.
Cause
This issue occurs when one of following conditions is true:
The Boot Configuration Data (BCD) is corrupted.
The reference to DEVICE and OSDEVICE on the boot configuration data is missing or unknown.
The binary displayed on the screenshot (other than winload.exe or \boot\BCD) is missing from the operating system disk.
Connect to the troubleshooting VM. Open Computer management > Disk management. Make sure that the OS disk is online and that its partitions have drive letters assigned.
Identify the Boot partition and the Windows partition. If there's only one partition on the OS disk, this partition is the Boot partition and the Windows partition.
If the OS disk contains more than one partition, you can identify them by viewing the folders in the partitions:
The Windows partition contains a folder named "Windows," and this partition is larger than the others.
The Boot partition contains a folder named "Boot." This folder is hidden by default. To see the folder, you must display the hidden files and folders and disable the Hide protected operating system files (Recommended) option. The boot partition is typically 300 MB~500 MB.
Step 2: Repair the Boot Configuration data
Run the following command line as an administrator, and then record the identifier of Windows Boot Loader (not Windows Boot Manager). The identifier is either the tag {default} or a 32-character code and it looks like this: xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. You will use this identifier in the next step.
In Generation 2 VMs, the boot partition isn't labeled by default. You can run the diskpart command to label the partition so it can be used with the BCDEdit tool.
Repair the Boot Configuration data by running the following command lines. You must replace these placeholders by the actual values:
Note
This step is applied to most Boot configuration data corruption issues. You need perform this step even if you see the Device and OSDevice are pointing to the correct partition.
<Windows partition> is the partition that contains a folder named "Windows." <Boot partition> is the partition that contains a hidden system folder named "Boot." <Identifier> is the identifier of Windows Boot Loader you found in the previous step.
Open an elevated CMD prompt and run chkdsk on the disk:
Windows Command Prompt
chkdsk <drive-letter>: /F
Replace the corrupt binary file
On the attached disk, browse to the location of the binary file that's displayed in the error message.
Rename the file from <binary-name>.sys to <binary-name>.sys.old.
On the attached disk, browse to the \Windows\WinSxS folder. Then, search for the binary file that's displayed in the error message. To do this, run the following command at a command prompt:
Windows Command Prompt
dir <binary-name> /s
The command lists all the different versions of the binary file together with the created date. Copy the latest version of the binary file to the \Windows\System32\Drivers folder by running the following command:
E:\Windows\WinSxS>dir ACPI.sys /s
Volume in drive E has no label.
Volume Serial Number is A0B1-C2D3
Directory of E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_cdef0123456789ab
11/21/2014 07:48 PM 94,989 acpi.sys
1 File(s) 94,989 bytes
Directory of E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_89abcdef01234567
11/21/2014 07:48 PM 119,547 acpi.sys
1 File(s) 119,547 bytes
Directory of E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_456789abcdef0123
11/21/2014 04:06 PM 533,824 acpi.sys
1 File(s) 533,824 bytes
Total Files Listed:
3 File(s) 748,360 bytes
0 Dir(s) 123,967,512,576 bytes free
E:\Windows\WinSxS>copy E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_cdef0123456789ab\acpi.sys E:\Windows\System32\Drivers\
1 file(s) copied.
E:\Windows\WinSxS>
Note
If the system binary file can't be renamed, take ownership of the file. This action gives you full access to this file.
The example console output shows volume E as an example. The actual letter should reflect the faulty drive (the OS disk attached as a data disk on the troubleshooting VM).
If the latest binary doesn't work, you can try the previous file version to obtain an earlier system update level on that component.
If the only binary that's returned in this step matches the file that you're trying to replace on the affected VM, and if both files have the same size and time stamp, you can replace the corrupted file by copying it from another working VM that has the same OS and, if possible, the same system update level.
Learn to troubleshoot configuration issues that affect connectivity to your Azure-hosted Windows Server virtual machines (VMs). Explore approaches to resolve issues with VM startup, extensions, performance, storage, and encryption.