Creating a dual-boot WinPE 5.0 boot image (x86 and x64 support)

Earlier this afternoon I got a question in my YouTube channel, where a fellow deployment geek wanted to know if it was possible to create a WinPE image that had support for both x86 and x64 boot images. E.g. a dual-boot boot image (my own wording). My first thought was to respond and say: No problem just check the x86 and x64 options in the MDT Media and it will build a dual-boot image for you, but then I thought I should also describe what MDT actually does in the background. Meaning, you can also use this guide for custom boot images that you build, even without MDT.

MDTMedia
Enabling dual-boot on a MDT Media.

Create a WinPE 5.0 boot image that has both x86 and x64 versions – Step-by-Step guide

To create the boot image you need to have Windows ADK 8.1 installed. Then creating the dual-boot boot image is quite straightforward and consists of the following steps:

  • Create the x86 boot image
  • Create the x64 boot image
  • Modify the BCD entry to contain both boot images
  • Create the ISO or USB stick

Create the x86 WinPE 5.0 boot image

  1. On the machine with Windows ADK 8.1 installed, from the Start screen, launch Deployment and Imaging Tools Environment
  2. In the Command prompt that appears, run the following command:

    copype x86 C:\Tmp\WinPE50_x86

  3. Using File Explorer, create the C:\Tmp\WinPE50_Combined folder
  4. Navigate to the C:\Tmp\WinPE50_x86media folder and copy the content to the  C:\Tmp\WinPE50_Combined folder
  5. In the C:\Tmp\WinPE50_Combined\Sources folder, rename boot.wim to boot_x86.wim

Create the x64 WinPE 5.0 boot image

  1. Still in the Deployment and Imaging Tools Environment Command prompt run the following command:

    copype amd64 c:\tmp\WinPE50_x64

  2. Navigate to the C:\Tmp\WinPE50_x64\media\sources folder and copy the boot.wim file to the  C:\Tm\pWinPE50_Combined\Sources folder
  3. In the C:\Tmp\WinPE50_Combined\Sources folder, rename boot.wim to boot_x64.wim

    CombinedFolder

    The C:\Tmp\WinPE50_Combined\Sources folder after adding the x86 and x64 boot images.

Modify the BCD entry

  1. Still in the Deployment and Imaging Tools Environment Command prompt run the following command to find out the guid for the x86 boot image:
    bootx86

    bcdedit /store C:TmpWinPE50_CombinedBootBCD /enum | find "osdevice"


    The guid for the x86 boot image displayed.

  2. Make a note of the guid (copy it), you need it in the next step. In this example my guid was {7619dcc8-fafe-11d9-b411-000476eba25f}.
  3. Modify the x86 boot entry by typing the following commands, press Enter after each command (replace the guid with your guid value):

    bcdedit /store C:\Tmp\WinPE50_Combined\Boot\BCD /set {default} device ramdisk=[boot]\sources\boot_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}

    bcdedit /store C:\Tmp\WinPE50_Combined\Boot\BCD /set {default} osdevice ramdisk=[boot]\sources\boot_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}

    bcdedit /store C:\Tmp\WinPE50_Combined\Boot\BCD /set {default} description "WinPE 5.0 x86"

  4. Create a x64 boot entry by making a copy of the x86 entry. Run the following command and make a note of the new guid. In this example the guid for the copied entry was {c449d072-26f3-11e3-af16-00155da12e2b}:

    bcdedit /store C:\Tmp\WinPE50_Combined\Boot\BCD /copy {default} /d "WinPE 5.0 x64"

    bootx6401


    The new x64 boot entry, copied from the x86 entry.

  5. Next step is to modify the new x64 entry. In these steps you use both the original guid from the x86 boot image (it's the RAM disk), and the new guid you got when copying the x86 entry. Again, in my example the original x86 guid was {7619dcc8-fafe-11d9-b411-000476eba25f} and the new x64 entry was {c449d072-26f3-11e3-af16-00155da12e2b}. Run the following commands:

    bcdedit /store C:\Tmp\WinPE50_Combined\Boot\BCD /set {c449d072-26f3-11e3-af16-00155da12e2b} device ramdisk=[boot]\sources\boot_x64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}bcdedit /store C:\Tmp\WinPE50_Combined\Boot\BCD /set {c449d072-26f3-11e3-af16-00155da12e2b} osdevice ramdisk=[boot]\sources\boot_x64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}

  6. And finally, enable the menu selection in the boot manager menu, by running the following command:

    bcdedit.exe /store C:\Tmp\WinPE50_Combined\Boot\BCD /deletevalue {default} bootmenupolicy

Create the bootable ISO or USB stick

  1. Rename the C:\Tmp\WinPE50_Combined folder to C:\Tmp\Media (the MakeWinPEMedia.cmd is hardcoded to look for a folder named media)
  2. Copy the C:\Tmp\WinPE50_x86\fwfiles folder to C:\Tmp.
  3. If you want to create a bootable ISO, run the following command (the /f forces to overwrite if the ISO already exist, not required, but good to know about):

    MakeWinPEMedia /iso /f C:\Tmp C:\Tmp\WinPE50_DualBoot.iso

  4. If you want to create a bootable USB, run the following command (the /f forces suppresses the warning about formatting the USB stick):

     MakeWinPEMedia /ufd /f C:\Tmp H:

Bootmenu
The working boot menu in WinPE 5.0.

Happy deployment, Johan

About the author

Johan Arwidmark

0 0 votes
Article Rating
Subscribe
Notify of
guest
53 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Handeson Miller
Handeson Miller
2 years ago

Hi Johan Arwidmark!

It's possible to create a multiple boot images (x86 and x64) using the boot/setup archive of Windows ISO's?
Example: Boot.wim x86/x64 files of Windows 7, 8.1, 10 etc? Sorry for my poor english and thanks from Brazil!

Handeson Miller
Handeson Miller
2 years ago

Thanks again! I have a "last" question: bcd commands are the same if i use Winpe 10 based? Other question: Is possible to add Powershell, network lan, Wireless and Net applications support? If yes, how?
bcd commands are not clear for me.

Last edited 2 years ago by Handeson Miller
ChrizK
ChrizK
3 years ago

I appreciate that this was written in 2013, but I think it is still relevant. Has the page become corrupt, as I believe the paths in the bcdedit commands to be missing backslash'\' Also, I believe the Boot and Sources directories are now under Media (my tmpWinPE50_x directories have three sub-directories; fwfiles, media, mount). I had to search for boot.wim to rename them. I think I have struggled through this, but got stuck @ ramdisk=[boot]sourcesboot. ie should this be ramdisk=[boot]\sources\boot? I have assumed [boot] is part of the path, and entered (as an example) bcdedit /store C:\TmpWinPE50_Combined\media\Boot\BCD /set {default} device… Read more »

ChrizK
ChrizK
3 years ago
Reply to  ChrizK

Hi, I have answered my questions, by going through your instructions once more, and paying greater attention to the screenshots. I made a fundamental mistake, not spotting \media in 'Create the x86 WinPE 5.0 boot image', Step 4. Also, I initially Copy/Paste your instructions from 'Modify the BCD entry', filling in \, but only pasting in the hex GUID. This time around, I spotted that the result from 'find "osdevice"', actually provides the full path for ramdisk (=[boot]\sources\boot.wim), and so I simply copied it directly from the output. Success! Thank you (maybe adding the \ in the page will help… Read more »

Admin
Admin
8 years ago

I haven't tried dualboot with UEFI enabled, but if you only have an x64 boot image, the same USB stick can support both MBR and UEFI as long as its FAT32.

/ Johan

TinyPaw
TinyPaw
8 years ago

Hi,

Thanks for the step-by-step guide Johan.
Is there a way to add support for x64 UEFI booting ? or for the time being one have to stick with a single x64 boot iso.

Will also love to read about booting Winpe 5x from USB FLASH stick (with UEFI support) [ie:1GB] (as opposed to a USB drive, which could be a Western Digital drive for instance) for deployment on "legacy" devices (traditional laptops & PC's) as well as on newer machines (tablets…).

Thanks for your insight.

Admin
Admin
8 years ago

Haven't tried using Rufus, but if you just format the USB stick, make it active, and then copy the content of the ISO to the root if the USB stick you should be good.

/ Johan

Croemega
Croemega
8 years ago

Thank you for these instructions!

I've done all of the above with no issue's on a virtual box running Server 2012 R2, but when I go to boot from my usb (I created the iso and then used Rufus to create a bootable usb stick from the iso) I get stuck on command prompt showing X:WindowsSystem32>winpeinit.

After waiting a while the winpeinit command goes away but nothing happens.

Can you tell me what I did wrong?

jlo834
jlo834
8 years ago

Thank you Johan!

Admin
Admin
8 years ago

It's been a while since I used PXELinux (Syslinux), but you should be able to just add another menu entry for the x86 boot image. No need to change the loader.

/ Johan

jlo834
jlo834
8 years ago

This was an awesome write-up! Thank you for sharing it and allowing us to utilize it. I do have a "next step" question. I run a centos pxe server that currently boots up winpe 5.0 but only a 64bit version. From your write-up do you know what I need to do in order for me to pxe boot the dual boot?

Here's a file list of my current winpe that pxe boots:

abortpxe.com BCD.LOG2 hdlscom1.com pxeboot.com wdsmgfw.efi
BCD bootmgr.exe hdlscom1.n12 pxeboot.n12 wdsnbp.com
BCD.LOG boot.sdi hdlscom2.com startrom.0 winpe.wim
BCD.LOG1 boot.wim hdlscom2.n12 WdsConfig.inf

sbeaudette
sbeaudette
9 years ago

found it!!!

thank you!!

Admin
Admin
9 years ago

You only need to create (or edit) the bcd with the correct info… If you search for WinPE and Windows 7 dual boot you find plenty of examples.

/ Johan

sbeaudette
sbeaudette
9 years ago

uh ho, both my WINPE_X86 and my Windows 7 X64 deploy have the same GUID (7619dcc8-fafe-11d9-b411-000476eba25f) I am screwed aren't i? 🙁

Also, I am a bit lost since my files don't match the ones from the procedure above (for my windows 7 x64 deploy) so I am having a hard time following the procedure and trying to compensate for the windows 7 x64 structure… doh!

I realize you must be super busy Johan so I really appreciate the time you take to answer us (me)

Much obliged!

cheers!

Admin
Admin
9 years ago

Sure, you can use the above techniques to select between different WIM files.

Personally I normal add customizations to the MDT WinPE boot image instead of generating a separate WinPE bootimage.

/ Johan

sbeaudette
sbeaudette
9 years ago

Hi Seb, For MDT, you can use a single x86 boot image deploy both x86 and x64 operating systems (except x64 UEFI). / Johan Thanks for the answer Johan but this isn't what I am looking for unfortunetely, I am not sure I explained myself correctly the first time, let me try again. I am trying to dual boot (on a usb stick) a WinPE session (already created with Microsoft AIK not MDT) and a windows 7 x64 deploy created in MDT. So basically i want the option to boot either into WinPE or deploy windows 7 x64. Both are… Read more »

Admin
Admin
9 years ago

Hi Seb,

For MDT, you can use a single x86 boot image deploy both x86 and x64 operating systems (except x64 UEFI).

/ Johan

sbeaudette
sbeaudette
9 years ago

Is it possible to dual boot say: a Winpe 5.0 X64 and a windows 7/8 deployment created in MDT ? How different would the steps be? this would be gold in my organisation, we already have a nice windows 8 Build create in MDT and a WinPE 5.0 X64 build also, putting them both on a usb bootable stick would be a dream come true, if anyone can help, pleeeeease let me know!

thanking you in advance

Cheers
Seb

poppyq
poppyq
9 years ago

Sorry for the comment spam. I think I just figured out my problem. I'm testing this on a notebook, but it looks like the 32-Bit UEFI only works on IA32, which are typically only tablets with Intel Atom CPUs (hence the IA).

poppyq
poppyq
9 years ago

Sorry, let me add more detail. The entries both appear in UEFI boot mode, but when I select the 32-Bit, the progress bar gets all the way across and then I get a blackscreen error referencing winload.efi.

poppyq
poppyq
9 years ago

Ok, so I've had this dual boot scenario working for quite a while. My problem is getting a working BCD for UEFI booting to both options. The default EFI BCD for WinPE 5.0 works for both 64 and 32-bit if I swap out my boot.wims, but any time I try creating a BCD with multiple boot options the 32-bit will always fail. I'm not sure what commands I'm missing to get 32-bit to work. Any thoughts?

Admin
Admin
9 years ago

The copype x86 C:TmpWinPE50_x86 command create the copype x86 C:TmpWinPE50_x86media folder.

Second. If you are new into windows deployment/imaging, you should not do this as a first step. Use the free MDT 2013 deployment solution from Microsoft to replace your ghost images. In fact, everybody doing Windows deployment should use MDT 2013.

/ Johan

qzmicro
qzmicro
9 years ago

I was hoping that someone might be able to explain what I'm missing here. I have never done this before so please bare with me. In the first step, it states this: Create the x86 WinPE 5.0 boot image1.On the machine with Windows ADK 8.1 installed, from the Start screen, launch Deployment and Imaging Tools Environment 2.In the Command prompt that appears, run the following command: copype x86 C:TmpWinPE50_x86 3.Using File Explorer, create the C:TmpWinPE50_Combined folder 4.Navigate to the C:TmpWinPE50_x86media folder and copy the content to the C:TmpWinPE50_Combined folder 5.In the C:TmpWinPE50_CombinedSources folder, rename boot.wim to boot_x86.wim … when I… Read more »

Admin
Admin
9 years ago

For WDS, you simply add two boot images, one x86 and and one x64, and they will be listed in the menu.

/ Johan

whhaatt
whhaatt
9 years ago

Hi
Thanks for the detailed guide.

How can you set this in (Boot Menu) WDS for PXE (Server 2003 R2).

Eg:- PXE show Main Menu EG: WinPE5.0, when clicked on then the 2 sub menus will show?

whhaatt
whhaatt
9 years ago

Hi
Thanks for the detailed guide.

How can you set this in (Boot Menu) WDS for PXE (Server 2003 R2).

Eg:- PXE show Main Menu EG: WinPE5.0, when clicked on then the 2 sub menus will show?

Admin
Admin
9 years ago

Hi Crispywhip,

Make sure you typed in the correct path when creating the store, check if the C:TmpWinPE50_CombinedBootBCD file exist.

/ Johan

Admin
Admin
9 years ago

Hi afarrukh, I would recommend starting over, and making sure you do all the steps in the same Deployment and Imaging Tools Environment command prompt. I have been testing these steps quite many times.

/ Johan

Admin
Admin
9 years ago

Hi heckishfire, the setupact.log is moved around during deployment, search for it. MDT 2012 Update 1 does not support WinPE 5.0, you need to upgrade to MDT 2013, and then MDT will create the boot image for you.

/ Johan

Crispywhip
Crispywhip
9 years ago

I'm having problems getting guid for the boot image. Running the program as administrator of course and getting nothing.
Also tried just with "bcdedit /store C:TmpWinPE50_CombinedBootBCD /enum", It gave me "The boot configuration data store could not be opened.". Help?

afarrukh
afarrukh
9 years ago

Hi
everything is working uptil no5 but when run the command to enable the menu /deletevalue {default} bootmenupolicy it fails sysing
D:BootDual-Boot>bcdedit /store d:bootdual-bootbootbcd /deletevalue {default} bootmenupolicy
The element data type specified is not recognized, or does not apply to the
specified entry.
Run "bcdedit /?" for command line assistance.
Element not found.
Could you please help?

heckishfire
heckishfire
9 years ago

I've used MDT 2012 before for larger image role outs but this is only four workstations, so i figured I would simply make a new WinPE disc to upgrade from my winpe 3.0 disc. I've used the winpe 3 disc to great success with small role outs, so I was hoping for the same with the winpe 5. The setupact.log file, where is that located? Thanks!

heckishfire
heckishfire
9 years ago

I've used MDT 2012 before for larger image role outs but this is only four workstations, so i figured I would simply make a new WinPE disc to upgrade from my winpe 3.0 disc. I've used the winpe 3 disc to great success with small role outs, so I was hoping for the same with the winpe 5. The setupact.log file, where is that located? Thanks!

Admin
Admin
9 years ago

It depends, the setupact.log jumps around to different locations during setup, search for it 🙂

/ Johan

heckishfire
heckishfire
9 years ago

I've used MDT 2012 before for larger image role outs but this is only four workstations, so i figured I would simply make a new WinPE disc to upgrade from my winpe 3.0 disc. I've used the winpe 3 disc to great success with small role outs, so I was hoping for the same with the winpe 5. The setupact.log file, where is that located? Thanks!

Admin
Admin
9 years ago

The Setupact.log file should give you more info…. That being said, if you want to deploy Windows, you should be using the free MDT 2013 solution. It takes away pains like this 🙂

/ Johan

heckishfire
heckishfire
9 years ago

I successfully created the boot cd from the iso file and successfully can choose between x86/x64. I added a few packages from the Windows ADK and a batch script that will give the user the option to launch cmd, smartnet, diskpart and gimagex. I chose diskpart to wipe the factory partitions: select disk 0cleancreate part primaryselect part 1activeassign c format fs=ntfs quick I then map a drive to the network share and launch gimagex, choose source/dest and let the image apply. After it finishes and I restart I get this: Windows failed to start. A recent hardware or software change… Read more »

Oglar
Oglar
9 years ago

That was it could have sworn I had secure boot turned off, and legacy boot on.

Admin
Admin
9 years ago

UEFI based machines maybe?

/ Johan

Oglar
Oglar
9 years ago

Ok I can successfully create a dual boot that will work on our basic laptops for deployment, but as soon as I try to run it on our tablets it goes into a loop and never brings up the selection. Any idea what could be going on?

nahhee
nahhee
9 years ago

Another thing that may bite you is trying this on an ancient PC as I did. Followed every step carefully, USB stick booted and showed the two choices, picking either one resulted in blue screens on multiple PCs I tried it on. Ran through the procedure to create the dual boot sticks on multiple other PCs and it worked flawlessly. Decided to test whether NX bit capability was the cause. Seemed to be the case – the PC that produced the bad stick output "False" in response to the wmic OS Get DataExecutionPrevention_Available command. It's an ancient Athlon XP 3000… Read more »

nahhee
nahhee
9 years ago

Had exact same issue as prz on, "bcdedit /store C:TmpWinPE50_CombinedBootBCD /enum | find "osdevice" I pasted the command line into and nothing came back." Found that the issue was caused by not right clicking on Deployment and Imaging Tools Environment and running as administrator. Being rather lazy to write stuff down or type I modified the command slightly to redirect the output to a file like this
bcdedit /store C:TmpWinPE50_CombinedBootBCD /enum | find "osdevice" > C:tmpx86_GUID.txt
and after that just copied and pasted the GUID into subsequent commands.

Admin
Admin
9 years ago

Probably a typo, what does bcdedit /store C:TmpWinPE50_CombinedBootBCD /enum give you?

/ Johan

prz
prz
9 years ago

Everything went fine until I hit. bcdedit /store C:TmpWinPE50_CombinedBootBCD /enum | find "osdevice" I pasted the command line into and nothing came back. I even made sure the prompt was c:tmp> any idea's?

Admin
Admin
9 years ago

Yes, WinPE 4.0 has the same capabilities, but this doesn't work with the ConfigMgr 2012 PXE provider.

You can use third party PXE menus to select ConfigMgr 2012 boot images, but that's a blog post for another day.

/ Johan

Veddo
Veddo
9 years ago

Dear Johan,

Would this soltuion work with Windows ADK 8 (Win PE 4.0)? In addition I would be interested in to use this dual boot image with CM12 SP1 in combination with PXE boot.

Thanks for your answer, clarification in advanced!

MBManiac
MBManiac
9 years ago

Duhh!!! Never mind.

I checked the GUID for the 64-bit boot.wim I was using and realized mine was different then yours. Once I made the realization and used the correct GUID, everything worked fine.

Thank you again.

Admin
Admin
9 years ago

Please mail me a screendump of your commands, you find contact info on the about page.

/ Johan

MBManiac
MBManiac
9 years ago

I am only able to get to Step 4.

When I attempt to either command in Step 5, I receive the following error: "An error occurred while attempting to reference the specified entry.
The system cannot find the file specified."

It might be that I've been looking at this too long and I can no longer see the forest from the trees.

I'm running the Windows ADK 8.1 on a laptop running Windows 8.1 32-bit upgraded from Windows 8.0.

Thank you in advance of any suggestions you may have as they would be greatly appreciated.

Mosquat
Mosquat
9 years ago

I always find BCDEdit a nightmare to use – it's great to have a nice step by step process documented, thanks Johan


>