• Home  / 

Booting WinPE 2.0 from a third party PXE Server

By arwidmark / March 28, 2007

 Welcome

This article describes how to configure a third party PXE Server (Jounin Tftpd32) for booting Windows PE 2.0

Perform all steps on a Vista Machine (the files/folders can of course later be transferred to a Windows 2003 SP1 server)

The guide covers the following steps

  • Configure and the Install WAIK
  • Create a x86 Windows PE 2.0 image
  • Prepare the PXE Server folder structure
  • Create a new BCD store
  • Install and Configure the PXE Server (Tftpd)
  • Create an x64 Windows PE 2.0 Image
  • Create a BCD store with multiple choices

Step 1 – Creating the Server Structure

Download and install WAIK to the default location
Start an elevated command prompt (Run as administrator) and type the following commands

cd /d “C:\Program Files\Windows AIK\Tools\PETools”
copype x86 c:\winpe_x86
ren winpe.wim winpe_x86.wim
imagex /mount c:\winpe_x86\winpe_x86.wim 1 c:\winpe_x86\mount
md C:\PXEServer\TFTPRoot\Boot\Fonts
copy c:\winpe_x86\mount\Windows\Boot\PXE\pxeboot.n12  C:\PXEServer\TFTPRoot\boot /y
copy c:\winpe_x86\ISO\boot\fonts\*.* c:\PXEServer\TFTPRoot\Boot\Fonts /y
copy c:\winpe_x86\mount\Windows\Boot\PXE\bootmgr.exe C:\PXEServer\TFTPRoot /y
imagex /unmount c:\winpe_x86\mount
copy C:\winpe_x86\ISO\boot\boot.sdi C:\PXEServer\TFTPRoot\boot /y
copy c:\winpe_x86\winpe_x86.wim C:\PXEServer\TFTPRoot\boot /y

Note: Each line beginning with imagex or copy is a separate line (might have been wrapped)
                                

Step 2 – Create a new BCD Store

In the C:\PXEServer folder, create a batchfile in named CreateBCD.cmd with the following content

Rem Creates BCD (boot configuration data) for Windows PE 2.0
set BCD-File=c:\PXEServer\Tftproot\Boot\BCD
del %BCD-File%
Bcdedit /createstore %BCD-File%
Bcdedit /store %BCD-File% /create {ramdiskoptions}
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdidevice  boot
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdipath  \boot\boot.sdi
for /f “tokens=1-3” %%a in (‘Bcdedit /store %BCD-File% /create /d “WinPE x86” /application osloader’) do set guid1=%%c
Bcdedit /store %BCD-File% /set %guid1% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid1% detecthal Yes
Bcdedit /store %BCD-File% /set %guid1% winpe Yes
Bcdedit /store %BCD-File% /set %guid1% osdevice ramdisk=[boot]\Boot\winpe_x86.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid1% device ramdisk=[boot]\Boot\winpe_x86.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /create {bootmgr} /d “Windows Vista BootManager” 
Bcdedit /store %BCD-File% /set {bootmgr} timeout 30
Bcdedit /store %BCD-File% /set {bootmgr} displayorder %guid1%
Bcdedit /store %BCD-File% /enum all

Note: Each line beginning with bcdedit or for is a separate line (might have been wrapped)
In the Command prompt, run the CreateBCD.cmd batch file.
 

Step 3 – Configure the PXE Server

Download Tftpd32 v3.03 from http://www.jounin.net/tftpd32_download.html and extract the tftpd32.exe and tftpd.hlp files to C:\PXEServer.
Start Tftpd32 (Unblock for Vista Firewall) and configure the following TFTP Server Settings:
– Base Directory: C:\PXEServer\TFTPRoot
– Allow “\” As virtual root
– TFTP Security: Read Only
– Use anticipation windows of: 8192

Note: Using anticipation windows can greatly improve transfer speed, but since it is prohibited by the TFTP specification, a special warning is displayed when this box is checked.
DHCP Server Settings, change to reflect your environment.

– IP pool starting address: 192.168.1.100
– Size of pool: 99
– Boot File: /boot/pxeboot.n12
– Default Router: 192.168.1.1
– Mask: 255.255.255.0
– Domain name: tslab.net

Optional – Add a x64 Image

Create a x64 Windows PE 2.0 Image

copype amd64 c:\winpe_x64
ren winpe.wim winpe_x64.wim
copy c:\winpe_x64\winpe_x64.wim C:\PXEServer\TFTPRoot\boot /y
In the C:\PXEServer folder, create a batch file in named CreateBCD2.cmd with the following content.

Rem Creates BCD (boot configuration data) for two Windows PE 2.0 images
set BCD-File=c:\PXEServer\Tftproot\Boot\BCD
del %BCD-File%
Bcdedit /createstore %BCD-File%
Bcdedit /store %BCD-File% /create {ramdiskoptions}
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdidevice  boot
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdipath  \boot\boot.sdi

for /f “tokens=1-3” %%a in (‘Bcdedit /store %BCD-File% /create /d “WinPE x86” /application osloader’) do set guid1=%%c
Bcdedit /store %BCD-File% /set %guid1% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid1% detecthal Yes
Bcdedit /store %BCD-File% /set %guid1% winpe Yes
Bcdedit /store %BCD-File% /set %guid1% osdevice ramdisk=[boot]\Boot\winpe_x86.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid1% device ramdisk=[boot]\Boot\winpe_x86.wim,{ramdiskoptions}

for /f “tokens=1-3” %%a in (‘Bcdedit /store %BCD-File% /create /d “WinPE x64” /application osloader’) do set guid2=%%c
Bcdedit /store %BCD-File% /set %guid2% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid2% detecthal Yes
Bcdedit /store %BCD-File% /set %guid2% winpe Yes
Bcdedit /store %BCD-File% /set %guid2% osdevice ramdisk=[boot]\Boot\winpe_x64.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid2% device ramdisk=[boot]\Boot\winpe_x64.wim,{ramdiskoptions}

Bcdedit /store %BCD-File% /create {bootmgr} /d “Windows VISTA BootManager”
Bcdedit /store %BCD-File% /set {bootmgr} timeout 30
Bcdedit /store %BCD-File% /set {bootmgr} displayorder %guid1% %guid2%
Bcdedit /store %BCD-File% /enum all

Note: Each line beginning with bcdedit or for is a separate line (might have been wrapped)

 

Optional – BCD with multiple entries.

In the C:\PXEServer folder, create a batchfile in named CreateBCD3.cmd with the following content.

Rem Creates BCD (boot configuration data) for three Windows PE 2.0 images
set BCD-File=c:\PXEServer\Tftproot\Boot\BCD
del %BCD-File%
Bcdedit /createstore %BCD-File%
Bcdedit /store %BCD-File% /create {ramdiskoptions} 
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdidevice  boot
Bcdedit /store %BCD-File% /set {ramdiskoptions} ramdisksdipath  \boot\boot.sdi

for /f “tokens=1-3” %%a in (‘Bcdedit /store %BCD-File% /create /d “WinPE x86” /application osloader’) do set guid1=%%c
Bcdedit /store %BCD-File% /set %guid1% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid1% detecthal Yes
Bcdedit /store %BCD-File% /set %guid1% winpe Yes
Bcdedit /store %BCD-File% /set %guid1% osdevice ramdisk=[boot]\Boot\winpe_x86.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid1% device ramdisk=[boot]\Boot\winpe_x86.wim,{ramdiskoptions}

for /f “tokens=1-3” %%a in (‘Bcdedit /store %BCD-File% /create /d “WinPE x86 2” /application osloader’) do set guid2=%%c
Bcdedit /store %BCD-File% /set %guid2% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid2% detecthal Yes
Bcdedit /store %BCD-File% /set %guid2% winpe Yes
Bcdedit /store %BCD-File% /set %guid2% osdevice ramdisk=[boot]\Boot\winpe_x86_2.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid2% device ramdisk=[boot]\Boot\winpe_x86_2.wim,{ramdiskoptions}

for /f “tokens=1-3” %%a in (‘Bcdedit /store %BCD-File% /create /d “WinPE x64” /application osloader’) do set guid3=%%c
Bcdedit /store %BCD-File% /set %guid3% systemroot \Windows
Bcdedit /store %BCD-File% /set %guid3% detecthal Yes
Bcdedit /store %BCD-File% /set %guid3% winpe Yes
Bcdedit /store %BCD-File% /set %guid3% osdevice ramdisk=[boot]\Boot\winpe_x64.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /set %guid3% device ramdisk=[boot]\Boot\winpe_x64.wim,{ramdiskoptions}
Bcdedit /store %BCD-File% /create {bootmgr} /d “Windows VISTA BootManager” Bcdedit /store %BCD-File% /set {bootmgr} timeout 30
Bcdedit /store %BCD-File% /set {bootmgr} displayorder %guid1% %guid2% %guid3%
Bcdedit /store %BCD-File% /enum all

Note: Each line beginning with bcdedit or for is a separate line (might have been wrapped)

/ Johan

About the author

arwidmark

Stratuscaster - January 28, 2009

I’ve gotten this to work well – I can boot multiple WIMs just fine…

The problem is that in the Windows Boot Manager, all the entries are shown as “Ramdisk options” and not the descriptions give to them (like “WinPE x86” and “WinPE x64”) – and that makes it difficult for others to know what WIMs they are choosing.

Any thoughts? I’ve been working on this issue all day today, and am happy that it works as far as the booting part – but without the correct names in the menu, I cannot put it into production.

-jim

Stratuscaster - January 29, 2009

Issue solved.

Turns out that the BOOTMGR.EXE provided with the latest WAIK is the cause of the problem. Using the BOOTMGR.EXE from the older WAIK displays the menu choices correctly.

-jim

Mel - July 14, 2009

Better issue solved:

For some unfathomable reason, the boot menu entries inherit the name from the ‘{ramdiskoptions}’ section, due to the references in ‘device’ and ‘osdevice’. This is actually the normal behaviour, so don’t expect it to be fixed any time soon…

The solution? Delete ‘{ramdiskoptions}’s description, something like:

> Bcdedit /store /deletevalue {ramdiskoptions} description

And now, the boot entries have no description to inherit, and so display their own.

Tested with BOOTMGR.EXE from Vista SP1, SP2, Windows 7 Beta and Windows 7 RC1.


Mel.

zstokes - August 27, 2009

So I’ve been doing this successfully ever since WinPE 2.0 came out. So long as you get the remapping right on your Linux PXE server, it works like a charm.

Now I have a somewhat related question:
I’m booting WinPE via Linux PXE. I have created a Windows 7 autounattend.xml file that works with all the options I want. An unattended build works perfectly with this file on a USB stick.

How can I build Win7 unattended using this file (or unattend.xml – I’m not sure what the differences between these two files are) in such a way that I don’t have to use WDS, OR a USB key with the xml file on it, OR booting from DVD with the xml file on it? Can’t one of these files be encapsulated into the image and get called during install?

Sorry if this is a rudimentary question….I just can’t find the answer since my environment is different, i.e. no WDS.

Z

dangrrr - August 3, 2010

Update on Bubble’s “better issue solved:”

– You can avoid the issue altogether by correcting the command from:

—Bcdedit /store %BCD-File% /create {ramdiskoptions} /d “Ramdisk options”—

To the following:

—Bcdedit /store %BCD-File% /create {ramdiskoptions}—

————————-
Removing the description allows you to skip deleting the description later.

arwidmark - August 10, 2010

Thanks, I have updated the article

/ Johan

The Dude - January 13, 2011

I recently got this to work without using the WAIK altogether and everything from Linux, so you do not need bcdedit, imagex etc. The BCD file can be edited in Linux with the help of hivex (library for editing registry hives). I created a perl-script that will do the bcdedit changes described above. Check it out at http://www.ultimatedeployment.org/win7pxelinux1.html

arwidmark - January 14, 2011

You most likely will use WAIK anyway for offline servicing etc. of the winpe image, but thanks for sharing the non-WAIK solution.

/ Johan

swilsonj - March 14, 2011

I have tested this with Windows 7 and I can not get it to work. I keep getting a File: BootBcd. Status: 0xc000000f error.

arwidmark - April 20, 2011

The network boot of boot images has not changed much between 2.x and 3.x… what pxe server are you using? does your winpe image work booting on a standard wds machine?

/ Johan

del - July 21, 2011

Hi

Thanks for the info… It was of great help…

I did a remap which is working fine.
I followed the steps as written, but getting the errors below….

Windows failed to start. A recent hardware or software change might be the cause. To fix the problem:

1. Insert your windows installation disc and restart your computer.
2. Choose your language settings and then click Next.
3. Click Repair your computer

If you do not have this disk, contact your system admin.

File: BootBCD

Status: 0xc0000001

Info: An error occurred while attempting to read the boot configuration data.

I am using WAIK 3. Although i did not setup the tftp server, but i think its tftpd32. It was originally setup for win xp and centos which is still being used…. But have issues adding win7.

del - July 21, 2011

Additionally to the above comment, on my log file,

Jul 21 17:37:55 xxxxxx in.tftpd[24889]: remap: input: boot.ini
Jul 21 17:37:55 xxxxxx in.tftpd[24889]: remap: rule 1: rewrite: /boot.ini
Jul 21 17:37:55 xxxxxx in.tftpd[24889]: remap: done
Jul 21 17:37:55 xxxxxx in.tftpd[24889]: RRQ from 172.xx.xxx.xxx filename boot.ini remapped to /boot.ini
Jul 21 17:37:55 xxxxxx in.tftpd[24889]: sending NAK (1, File not found) to 172.xx.xxx.xxx

arwidmark - July 23, 2011

For WinPE 3.x you need to put the pxeboot.n12 into the base root, instead of the boot folder.

del - July 25, 2011

Thanks for the response… But unfortunately still same error as initial posted. I initially used pxeboot.n12 then renamed to both pxeboot.0 and startrom.0 but non worked.
This is my directory path /srv/tftpboot/Boot.
I copied pxeboot.n12 to /srv/tftpboot directory. Also within that directory is the bootmgr.exe
All other files and the Font directory where in /srv/tftpboot/Boot

Not sure what else might be the issue.

arwidmark - August 5, 2011

Can you please verify what pxe server you are using, and also post additional info about the server configuration.

/ Johan

Comments are closed