SAXD Posted March 1, 2010 Share Posted March 1, 2010 Over the past few months, I have been working to create a single USB flash drive (UFD) that is bootable, and can boot into various versions of Windows PE for offline servicing. I was successful, and by following my instructions, you can boot into ERD Commander 2005 (PE 1.6), Microsoft Diagnostics and Recovery Toolsets 6.0 and 6.5, Windows PE 3.0, and Windows Recovery Environment 3.0. Below is the result of my efforts, please leave your feedback. HOW TO: Create Windows PE Recovery Media Audience: Advanced technology professionals and/or enthusiasts. Objective: Create bootable Windows environment for offline servicing of Windows 2000, XP, Server 2003, Vista, Server 2008, and Windows 7. Notes: In this guide, the term media is used interchangeably for CD, DVD, ISO, ZIP, and UFD. All software used in this guide is 32-bit. The latest versions of the prerequisites should be utilized, except where noted otherwise. Commands to be entered in the Deployment Tools Command Prompt are indicated in this type format. Prerequisites: 1. Windows 7 Installation 2. Windows 7 Installation Media 3. Windows Automated Installation Kit for Windows 7 4. Pre-Built Microsoft Diagnostics and Recovery Toolsets 5.0, 6.0, and 6.51 5. 7-Zip 6. SetRes 2.12 7. GSAR 8. DVD Burner and/or Bootable UFD3 9. Proper Software Licenses4 Step 1: Setting up the Environment Run Deployment Tools Command Prompt elevated. mkdir C:\ProjectFiles\ set path=%path%;C:\ProjectFiles Extract the downloads of SetRes and GSAR to C:\ProjectFiles. From the Windows 7 installation media, browse to \sources, and select install.wim. Open install.wim using 7-Zip. Browse to \1\Windows\System32\Recovery and copy winRE.wim to C:\ProjectFiles. From the Microsoft Diagnostics and Recovery Toolset 6.0 media, browse to \sources and copy boot.wim to C:\ProjectFiles. rename C:\ProjectFiles\boot.wim erd60.wim From the Microsoft Diagnostics and Recovery Toolset 6.5 media, browse to \sources and copy boot.wim to C:\ProjectFiles. rename C:\ProjectFiles\boot.wim erd65.wim Step 2: Building and Customizing the Base Windows PE Image copype x86 c:\winpe_x86 copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim copy "c:\program files\windows aik\tools\x86\imagex.exe" c:\winpe_x86\iso\ Mount the boot.wim file to be customized. dism /Mount-Wim /WimFile:C:\winpe_x86\ISO\sources\boot.wim /index:1 /MountDir:C:\winpe_x86\mount Four optional components are added, as well as the required language files. dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-hta.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-hta_en-us.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-mdac.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-mdac_en-us.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-scripting.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-scripting_en-us.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab" dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-wmi_en-us.cab" Validate that all eight packages are installed. dism /image:c:\winpe_x86\mount /Get-Packages The files below add the Remote Desktop Client and support for additional applications. copy c:\windows\system32\d3d10_1.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\d3d10_1core.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\dxgi.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\msacm32.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\mstsc.exe c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\mstscax.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\msvbvm60.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\msvfw32.dll c:\winpe_x86\mount\windows\system32\ copy c:\windows\system32\en-us\msacm32.dll.mui c:\winpe_x86\mount\windows\system32\en-us\ copy c:\windows\system32\en-us\mstsc.exe.mui c:\winpe_x86\mount\windows\system32\en-us\ copy c:\windows\system32\en-us\mstscax.dll.mui c:\winpe_x86\mount\windows\system32\en-us\ copy c:\windows\system32\en-us\msvfw32.dll.mui c:\winpe_x86\mount\windows\system32\en-us\ SetRes allows the screen resolution to be changed. copy C:\ProjectFiles\SetRes.exe c:\winpe_x86\mount\windows\system32\ copy C:\ProjectFiles\setres_2_1.txt c:\winpe_x86\mount\windows\system32\ Unmount boot.wim and commit the changes. dism /unmount-Wim /MountDir:C:\winpe_x86\mount /Commit Step 3: Adding the Windows 7 Recovery Environment copy C:\ProjectFiles\winRE.wim c:\winpe_x86\iso\sources\ Add the Windows 7 Recovery Environment to the boot menu. bcdedit /store c:\winpe_x86\iso\boot\bcd /copy {default} /d "Windows Recovery Environment" bcdedit /store c:\winpe_x86\iso\boot\bcd Note the identifier {GUID} assigned to the new entry, such as {f4fd38d3-221d-11df-bff5-005056c00008}. bcdedit /store c:\winpe_x86\iso\boot\bcd /set {GUID} device ramdisk=[boot]\sources\winre.wim,{7619dcc8-fafe-11d9-b411-000476eba25f} bcdedit /store c:\winpe_x86\iso\boot\bcd /set {GUID} osdevice ramdisk=[boot]\sources\winre.wim,{7619dcc8-fafe-11d9-b411-000476eba25f} Rename the default boot entry from "Windows Setup" to "Windows Preinstallation Environment".5 bcdedit /store c:\winpe_x86\iso\boot\bcd /set {default} description "Windows Preinstallation Environment" Step 4: Adding the Microsoft Diagnostics and Recovery Toolsets 6.0 and 6.5 copy C:\ProjectFiles\erd60.wim c:\winpe_x86\iso\sources\ copy C:\ProjectFiles\erd65.wim c:\winpe_x86\iso\sources\ Add the Diagnostics and Recovery Toolset 6.0 to the boot menu. bcdedit /store c:\winpe_x86\iso\boot\bcd /copy {default} /d "Diagnostics and Recovery Toolset 6.0" bcdedit /store c:\winpe_x86\iso\boot\bcd Note the identifier {GUID} assigned to the new entry, such as {8629abaf-221e-11df-bff5-005056c00008}. bcdedit /store c:\winpe_x86\iso\boot\bcd /set {GUID} device ramdisk=[boot]\sources\erd60.wim,{7619dcc8-fafe-11d9-b411-000476eba25f} bcdedit /store c:\winpe_x86\iso\boot\bcd /set {GUID} osdevice ramdisk=[boot]\sources\erd60.wim,{7619dcc8-fafe-11d9-b411-000476eba25f} Add the Diagnostics and Recovery Toolset 6.5 to the boot menu. bcdedit /store c:\winpe_x86\iso\boot\bcd /copy {default} /d "Diagnostics and Recovery Toolset 6.5" bcdedit /store c:\winpe_x86\iso\boot\bcd Note the identifier {GUID} assigned to the new entry, such as {e80f6056-221e-11df-bff5-005056c00008}. bcdedit /store c:\winpe_x86\iso\boot\bcd /set {GUID} device ramdisk=[boot]\sources\erd65.wim,{7619dcc8-fafe-11d9-b411-000476eba25f} bcdedit /store c:\winpe_x86\iso\boot\bcd /set {GUID} osdevice ramdisk=[boot]\sources\erd65.wim,{7619dcc8-fafe-11d9-b411-000476eba25f} Step 5: Adding the Microsoft Diagnostics and Recovery Toolset 5.0 From the Microsoft Diagnostics and Recovery Toolset 5.0 media, copy the contents to C:\winpe_x86\ISO. copy c:\winpe_x86\iso\i386\ntdetect.com c:\winpe_x86\iso\ Use GSAR to modify setupldr.bin.6 gsar -o -s":x00\minint\txtsetup.sif:x00" -r":x00\i386\txtsetup.sif:x00:x00:x00" c:\winpe_x86\iso\i386\setupldr.bin gsar -o -s":x00\minint\system32\:x00" -r":x00\i386\system32\:x00:x00:x00" c:\winpe_x86\iso\i386\setupldr.bin The setupldr.bin file has checksum validation that needs to be removed.7 gsar -o -s":x46:xda:x74:x03" -r":x46:xda:xEB:x1A" c:\winpe_x86\iso\i386\setupldr.bin Add the Diagnostics and Recovery Toolset 5.0 to the boot menu. bcdedit /store c:\winpe_x86\iso\boot\bcd /create {ntldr} /d "Diagnostics and Recovery Toolset 5.0" bcdedit /store c:\winpe_x86\iso\boot\bcd /set {ntldr} device boot bcdedit /store c:\winpe_x86\iso\boot\bcd /set {ntldr} path \i386\setupldr.bin bcdedit /store c:\winpe_x86\iso\boot\bcd /displayorder {ntldr} /addlast Reorder the boot menu. bcdedit /store c:\winpe_x86\iso\boot\bcd bcdedit /store c:\winpe_x86\iso\boot\bcd /displayorder {default} {winre.wim GUID} {ntldr} {erd60.wim GUID} {erd65.wim GUID} Step 6: Adding the Windows Memory Diagnostic copy c:\windows\boot\pcat\memtest.exe c:\winpe_x86\iso\boot\ md c:\winpe_x86\iso\boot\en-us copy c:\windows\boot\pcat\en-us\memtest.exe.mui c:\winpe_x86\iso\boot\en-us\ Step 7: Creating the ISO oscdimg -n -m -o -bc:\winpe_x86\etfsboot.com c:\winpe_x86\iso c:\winpe_x86\winpe_x86.iso Appendix A: Create a Bootable UFD diskpart list disk select disk x clean create partition primary select partition 1 active format quick fs=fat32 assign exit Appendix B: Additional Notes and Considerations Applications may be added to UFD as desired, most PortableApps work fine, as well as most utilities from Sysinternals and NirSoft. If Windows PE is built using 64-bit media, only 64-bit applications will be able to run, as there is no Windows on Windows (WOW64). Toolset Version: Supported Operating System(s): Diagnostics and Recovery Toolset 5.0 Windows 2000, XP, and Server 2003 Diagnostics and Recovery Toolset 6.0 Windows Vista and Server 2008 Diagnostics and Recovery Toolset 6.5 Windows 7 Footnotes 1 If the Microsoft Diagnostics and Recovery Toolsets are unavailable, these instructions can still be followed, simply by omitting references in steps 1, 4, and 5. 2 The current release, SetRes 3.0, does not appear to be working successfully in Windows PE. 3 1 GB or larger. See Appendix A for commands to make UFD bootable. 4 These instructions serve as a proof-of-concept only. It is your responsibility to ensure compliance with your software license agreements. 5 With more than one boot option present, the Windows Boot Manager will be displayed. 6 The Microsoft Diagnostics and Recovery Toolset 5.0 is built from Windows PE 2005 (1.6). When booting from optical media, setupldr.bin looks for txtsetup.sif and the system32 folder to be at \I386. However, when booting from other media (including HDD or UFD), the path setupldr.bin uses changes to \MININT. Forcing setupldr.bin to use \I386 ensures boot compatibility with optical and UFD media. 7 Each GSAR command replaces one occurrence. Last revised February 26th, 2010. Copyright ? 2010 Jackson Technology. All rights reserved. Personal use of this material, including one hard copy reproduction, is permitted. Permission to reprint, republish and/or distribute this material in whole or in part for any other purposes must be obtained from Jackson Technology. For information on obtaining permission, send an e-mail message to Adam@JacksonTechnology.net. By choosing to view this document, you agree to all provisions of the copyright laws protecting it. Source: http://jacksontechnology.net/winpe.aspx Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/ Share on other sites More sharing options...
SyntaxError Posted March 1, 2010 Share Posted March 1, 2010 This is pretty sweet, but how do I add x64 Vista and Win7 DaRTs into it as well? Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592295128 Share on other sites More sharing options...
SAXD Posted March 1, 2010 Author Share Posted March 1, 2010 This is pretty sweet, but how do I add x64 Vista and Win7 DaRTs into it as well? Honestly, that should be pretty easy. On the MDOP 2009 R2 media, there are separate installers for the x64 DaRT builds. You could add those WIMs by repeating step 4, but obviously with different filenames for the x64 DaRT packages. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592295566 Share on other sites More sharing options...
SyntaxError Posted March 1, 2010 Share Posted March 1, 2010 I'll try that. Thanks. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592295670 Share on other sites More sharing options...
SAXD Posted March 1, 2010 Author Share Posted March 1, 2010 I've updated my site with some screen shots of the progress... Link in first post. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592297786 Share on other sites More sharing options...
SyntaxError Posted March 2, 2010 Share Posted March 2, 2010 Killer guide, thanks. Adding the x64 .wim files works perfectly. I've been wanting to combine the various ERDs for some time now. I've added the following to mine: ERD 5.0 ERD 6.0 in x86 and x64 ERD 6.5 in x86 and x64 Windows Recovery Environment in x86 and x64 and of course WinPE 3.0 x86. Haven't added any portable tools yet. I've read on Technet that WinPE 3.0 x86 is fine for installing a 64 bit OS from, but would the x86 win recovery environment work fine for working on a 64 bit Windows? I've never used either of those tools before, so I can't be sure. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592298636 Share on other sites More sharing options...
SAXD Posted March 2, 2010 Author Share Posted March 2, 2010 (edited) Killer guide, thanks. Adding the x64 .wim files works perfectly. I've been wanting to combine the various ERDs for some time now. I've added the following to mine: ERD 5.0 ERD 6.0 in x86 and x64 ERD 6.5 in x86 and x64 Windows Recovery Environment in x86 and x64 and of course WinPE 3.0 x86. Haven't added any portable tools yet. I've read on Technet that WinPE 3.0 x86 is fine for installing a 64 bit OS from, but would the x86 win recovery environment work fine for working on a 64 bit Windows? I've never used either of those tools before, so I can't be sure. Cool, glad to hear it's working out well for you. Honestly, had my primary system been x64 capable during this project, I probably would have included those builds as well. My thoughts -- although unverified -- are that for the scope of WinRE and the DaRT builds, I would think that the 32-bit versions would service the 64-bit OS as well. At least until Windows Server 2008 R2 enters the picture, since that's 64-bit only. Some of the DaRT functionality may not work correctly going from 32 to 64-bit, such as the system restore/registry functionality. Just a reasonable guess, honestly. If you do try it, please post your results, I'd love to know conclusively. Regarding installing a 64-bit OS from within a 32-bit PE, I think that should be fine from what I remember, but I think again that Windows Server 2008 R2 needs to be installed from a 64-bit PE. For <Snipped>, or any other Linux boot CD, from what I understand, you would need a 3rd party boot loader first, such as Grub4DOS, and then load the Windows Boot Manager from there (chainloader?). Edited March 2, 2010 by Anaron Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592298922 Share on other sites More sharing options...
SyntaxError Posted March 2, 2010 Share Posted March 2, 2010 (edited) From past experience with the various ERD Commanders as stand alone cds, I can say the 32 bit versions work in a limited capacity on a 64 bit OS, and vice versa. Various tools will be grayed out in the DaRT menu, just like if you use an ERD disc that doesn't match the OS. I think I read somewhere last year that Win7's boot loader is based on a linux boot loader, so I'm hoping it can handle <Snipped>. Don't know if that's true though, I haven't been able to find anything on it. Edited March 2, 2010 by Anaron Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592299580 Share on other sites More sharing options...
markwolfe Veteran Posted March 2, 2010 Veteran Share Posted March 2, 2010 (edited) <Snipped> I think I read somewhere last year that Win7's boot loader is based on a linux boot loader... I seriously doubt it is, though I am not very experienced on the Windows side of things. And, while GRUB may be often associated with Linux, it is not a "Linux boot loader". It is an OS-agnostic boot loader. It doesn't care what OS is booting. It isn't written for one specific OS. "GRUB" stands for "GRand Unified Bootloader", so it obviously is written to work for any OS. Edited March 2, 2010 by Anaron Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592299826 Share on other sites More sharing options...
Yusuf M. Veteran Posted March 2, 2010 Veteran Share Posted March 2, 2010 Thread Cleaned No Illegal Software/Copyrighted Discussion.Discussions involving warez, cracks, security circumvention, using torrents for downloading copyrighted or illegal material is strictly prohibited. This includes music files or other unauthorized software. Asking for help in doing so will cause warns or suspensions of accounts. The following punishments may be applied to your account following infractions: Posting a link to pirated software/film/tv/music. = SNIP POST + WARNING LEVEL RAISE Suggesting (overtly endorsing) that somebody pirate material. = SNIP POST + WARNING LEVEL RAISE Requesting assistance in pirating material. = SNIP POST + WARNING LEVEL RAISE Posting screenshots that show obviously pirated material (e.g. someone's uTorrent download screen) = SNIP POST + PM and/or ZERO LEVEL WARN Openly discussing pirated material (e.g. z0mg - new episode of Lost was amazing!! BitTorrent FTW!) = SNIP POST + PM and/or ZERO LEVEL WARN Repeat offenders of the above examples will eventually be restricted from posting all together. https://www.neowin.net/forum/index.php?app=forums&module=extras§ion=boardrules Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592300278 Share on other sites More sharing options...
SyntaxError Posted March 2, 2010 Share Posted March 2, 2010 Just great, sanitize a discussion because it contains mention of a certain boot cd, yet you won't do **** about the thread full of links to copyrighted Microsoft files. Hypocrites and double standards. Good to know it's alive and well. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592301102 Share on other sites More sharing options...
markwolfe Veteran Posted March 2, 2010 Veteran Share Posted March 2, 2010 Just great, sanitize a discussion because it contains mention of a certain boot cd, yet you won't do **** about the thread full of links to copyrighted Microsoft files. Hypocrites and double standards. Good to know it's alive and well. Instead of complaining, if you find legitimate issues that a staffer has not addressed, please use the "report" button. The only sanitized items relate only to the mention of obtaining warez. All of the multiboot and PE stuff is still present, is it not? Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592302448 Share on other sites More sharing options...
SyntaxError Posted March 3, 2010 Share Posted March 3, 2010 I won't do the mods job for them, that's why I don't use the report button. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592302922 Share on other sites More sharing options...
macf13nd Posted March 3, 2010 Share Posted March 3, 2010 I won't do the mods job for them, that's why I don't use the report button. fair enough. If they were paid, that is. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592306312 Share on other sites More sharing options...
lacky Posted April 13, 2010 Share Posted April 13, 2010 Once that has been taken care of you can simply copy over the contents of your winpe_x86\ISO folder to the thumb drive and you're done, well you'll be able to boot into the WinPE environment from a thumb drive. There's a ton of stuff you'll want to do one of which will be working with imagex to customize your boot.wim file (located in the sources folder of winpe_x86\ISO). You'll also want to start working on a shell since you won't have anything other than a CLI to work with. I went with writing an HTA interface since I'm familiar with wscript and there were some examples out there. I used a dreamweaver 8 template that I got the way I wanted and simply cut and pasted it right into my .HTA file. It took some time to figure out how to get vbscript components into the html but I finally found some info to help me there. Link to comment https://www.neowin.net/forum/topic/879468-multiple-versions-of-windows-pe-on-1-ufd/#findComment-592485946 Share on other sites More sharing options...
Recommended Posts