Skip to content

bcdboot.exe failed with code 87! #32

@huberthk

Description

@huberthk

Hi,

On Azure Stack HCI 22H2 when deploying Hyper-V VM gen 2 with UEFI layout I get error "bcdboot.exe failed with code 87!".
It does not happen every time and on every system.
Any ideas as to why and how to troubleshoot?

Here's the (scrapped) transcript


Windows PowerShell transcript start
Start time: 20230829091249
Username: (removed)
RunAs User: (removed)
Configuration Name:
Machine: (removed) (Microsoft Windows NT 10.0.20349.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noExit -Command Invoke-SConfigLogon
Process ID: 8000
PSVersion: 5.1.20348.1850
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.20348.1850
BuildVersion: 10.0.20348.1850
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Transcript started, output file is C:\Users(removed)\Documents\PowerShell_transcript.(removed).J1uA9K8f.20230829091249.txt

Windows(R) Image to Virtual Hard Disk Converter for Windows(R)
Copyright (C) Microsoft Corporation. All rights reserved.
Copyright (C) 2019 x0nn
Version 10.0.14278.1000.amd64fre.rs1_es_media.160201-1707
VERBOSE: Target Image Version 10.0.20349.1906
DEBUG: 2023-08-29T14:12:49 [(removed)] isUserAdmin? True
Confirm
Continue with this operation?
&Yes Yes to &All &Halt Command &Suspend
A
DEBUG: 2023-08-29T14:12:56 [(removed)] is Windows 8 or Higher? True
Confirm
Continue with this operation?
&Yes Yes to &All &Halt Command &Suspend
A
VERBOSE: 2023-08-29T14:13:00 [(removed)] Temporary VHDX path is : c:\ClusterStorage\VOL_1(removed)\Virtual Hard Disks\4de048e3-9158-4069-993f-7247dd6d203c.vhdx
VERBOSE: 2023-08-29T14:13:00 [(removed)] Looking for the requested Windows image in the WIM/ESD file...
VERBOSE: 2023-08-29T14:13:01 [(removed)] Image 1 selected "Windows Server 2022 Standard"
VERBOSE: 2023-08-29T14:13:01 [(removed)] Creating sparse disk...
VERBOSE: 2023-08-29T14:13:02 [(removed)] Mounting VHDX...
VERBOSE: 2023-08-29T14:13:02 [(removed)] Initializing disk...
VERBOSE: 2023-08-29T14:13:03 [(removed)] Creating EFI system partition...
VERBOSE: 2023-08-29T14:13:03 [(removed)] Formatting system volume...
VERBOSE: 2023-08-29T14:13:06 [(removed)] Setting system partition as ESP...
VERBOSE: 2023-08-29T14:13:06 [(removed)] Creating MSR partition...
VERBOSE: 2023-08-29T14:13:07 [(removed)] Creating windows partition...
VERBOSE: 2023-08-29T14:13:07 [(removed)] Formatting windows volume...
VERBOSE: 2023-08-29T14:13:10 [(removed)] Windows path (K:) has been assigned.
VERBOSE: 2023-08-29T14:13:10 [(removed)] Windows path (K:) took 1 attempts to be assigned.
VERBOSE: 2023-08-29T14:13:11 [(removed)] System volume location: J:
VERBOSE: 2023-08-29T14:13:11 [(removed)] Applying image to VHDX. This could take a while...
VERBOSE: 2023-08-29T14:14:17 [(removed)] Image was applied successfully.
VERBOSE: 2023-08-29T14:14:17 [(removed)] Making image bootable...
DEBUG: 2023-08-29T14:14:17 [(removed)] Running bcdboot.exe K:\Windows /s J: /v /f UEFI
Confirm
Continue with this operation?
&Yes Yes to &All &Halt Command &Suspend
A
DEBUG: 2023-08-29T14:14:25 [(removed)] Return code was 87.
Confirm
Continue with this operation?
&Yes Yes to &All &Halt Command &Suspend
Y
PS>TerminatingError(): "bcdboot.exe failed with code 87!"
Write-LogMessage : 2023-08-29T14:14:40 [(removed)] bcdboot.exe failed with code 87!
At C:\DeployVMs\Convert-WindowsImage.ps1:2183 char:13

  •         Write-LogMessage $_ -logType Error
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-LogMessage
      Write-LogMessage : 2023-08-29T14:14:40 [(removed)] bcdboot.exe failed with code 87!
      At C:_Scripts\DeployVMs\Helper\Convert-WindowsImage.ps1:2183 char:13
  •         Write-LogMessage $_ -logType Error
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-LogMessage

VERBOSE: 2023-08-29T14:14:40 [(removed)] Log folder is (removed)
VERBOSE: 2023-08-29T14:14:41 [(removed)] Done.


Windows PowerShell transcript end
End time: 20230829091442


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions