Setup BCD to boot PE from RAM?

Kristoffer Nyqvist 121 Reputation points
2021-09-23T06:51:22.077+00:00

I'm trying to configure a running Windows 10 system to boot Windows PE from RAM but so far no luck.

I've read the documentation but my understanding of the boot parameters are a bit lacking.

This is what I have right now:

Windows Boot Loader
-------------------
identifier              {a84dfb42-1b85-11ec-b7bc-b42e99f68438}
device                  ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
path                    \windows\system32\winload.efi
description             Windows PE
osdevice                ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
systemroot              \windows
nx                      OptIn
detecthal               Yes
winpe                   Yes

I created this boot option with the following commands:

bcdedit -create /d "Windows PE" -application osloader
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} device ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} path \windows\system32\winload.efi
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} osdevice ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} systemroot \windows
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} winpe yes
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} nx optin
bcdedit /set {a84dfb42-1b85-11ec-b7bc-b42e99f68438} detecthal yes

Then I set a one-time boot:

bcdedit /bootsequence {a84dfb42-1b85-11ec-b7bc-b42e99f68438}

Finally, to test and reboot:

shutdown /r /f /t 0

Upon restarting, when the system boots I hear the fans start but then they stop following a few seconds of silence.
The system then starts again with the fans at full speed it sounds like but nothing is displayed on the monitor.
I then have to power it off 1 or 2 times to let the normal boot procedure kick in so I can get back into Windows.

I created the Windows PE files from the Deployment and Imaging Tools Environment from the Windows ADK and WinPE add-on.
The boot.wim is a copy from c:\winpe_amd64\media\sources

Also, I noticed I don't have any .sdi file specified.

What does the .sdi do and what is it for?

Also, It just hit me, do I need to make any changes to the BCD store located in the boot.wim?

Or is configuring the currently running operativ systems BCD enough?

To my understanding the above settings should:

  • Create a RAMDISK
  • Load boot.wim
  • Access \windows\system32\winload.efi after boot.wim has been mounted to load Windows PE

Please correct me if I'm wrong or missing anything.

EDIT: After checking the {ramdiskoptions} with:

bcdedit /enum {ramdiskoptions}

I noticed it was empty:

Setup Ramdisk Options
---------------------
identifier              {ramdiskoptions}

So I added some more information after some research:

bcdedit /set {ramdiskoptions} ramdisksdidevice partition=C:
bcdedit /set {ramdiskoptions} ramdisksdipath winpe_amd64\media\Boot\boot.sdi

Using this configuration gives me the boot error:

Status: 0xc000000f "A required device isn't connected or can't be accessed."

Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,899 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kristoffer Nyqvist 121 Reputation points
    2021-09-23T07:40:43.74+00:00

    I did it!

    I copied the .sdi file to a new location and fixed it's path:

    bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
    

    This solved my problem and I now can boot into PE!

    The final boot entry looks like this if anyone else wants to boot into Windows PE too from the .WIM and .SDI file generated from Windows ADK and ADK Pe Addon:

    Windows Boot Loader
    -------------------
    identifier              {a84dfb42-1b85-11ec-b7bc-b42e99f68438}
    device                  ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
    path                    \windows\system32\winload.efi
    description             Windows PE Test
    osdevice                ramdisk=[C:]\sources\boot.wim,{ramdiskoptions}
    systemroot              \windows
    nx                      OptIn
    detecthal               Yes
    winpe                   Yes
    
    Setup Ramdisk Options
    ---------------------
    identifier              {ramdiskoptions}
    ramdisksdidevice        partition=C:
    ramdisksdipath          \boot\boot.sdi
    
    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful