In today’s IT environments, deploying operating systems efficiently across numerous machines is crucial. A Pxe Server (Preboot Execution Environment server) is a cornerstone of network-based deployments, allowing you to boot computers directly from the network. This eliminates the need for individual bootable media like USB drives or DVDs, streamlining the process significantly. This guide will walk you through setting up a robust PXE server to load Windows Preinstallation Environment (Windows PE), enabling you to install Windows or perform other system tasks over the network.
Windows PE is a lightweight version of Windows used for deploying PCs, workstations, and servers, or troubleshooting an operating system while it is offline. By configuring a PXE server to serve Windows PE, you can centrally manage and deploy Windows operating systems, perform system recovery, and run diagnostics across your network. This method is particularly valuable for system administrators and IT professionals managing a large number of computers.
Prerequisites for Your PXE Server Setup
Before diving into the configuration, ensure you have the following components in place. These can be on separate machines or consolidated onto fewer servers depending on your network infrastructure and scale:
-
Deployment Computer: This machine needs the Windows Assessment and Deployment Kit (Windows ADK) and the Windows PE add-on for ADK installed. The ADK provides essential tools like DISM and Windows PE environment creation tools necessary for setting up your PXE server. You can download the latest version from the Microsoft website.
-
DHCP Server (or DHCP Proxy): A Dynamic Host Configuration Protocol (DHCP) server is essential on your network to automatically assign IP addresses and network configuration parameters to client computers. For PXE booting, the DHCP server needs to be configured to respond to PXE client requests, providing them with the necessary information to locate and boot from the PXE server. If your PXE server is on a different subnet, you might need a DHCP proxy or IP helpers configured on your network routers to forward PXE requests correctly.
-
PXE Server (TFTP Service): This is the core of our setup. The PXE server itself hosts the Trivial File Transfer Protocol (TFTP) service. TFTP is a simple, lightweight protocol used to transfer the initial boot files to the client computers. The PXE server will store the Windows PE boot files, which client computers will download via TFTP to initiate the network boot process.
-
File Server (Network Share): While not strictly a PXE server component, a file server hosting a network share is often needed to store the full Windows installation files or other resources that Windows PE might need to access after booting. This allows for a centralized location for all deployment assets.
Image showing an example command prompt window after running the copype command, illustrating the deployment process for setting up a PXE server.
These roles can be hosted on a single server for smaller environments or distributed across multiple servers for larger, more complex networks to optimize performance and redundancy.
Preparing Windows PE Source Files
The first step in configuring your PXE server is to prepare the necessary Windows PE files. This involves copying the base Windows PE files from your deployment computer and making them accessible to the PXE server.
Step 2.1: Copying Base Windows PE Files
-
On your deployment computer, open the Deployment and Imaging Tools Environment as an administrator. This environment sets up the necessary paths to use the deployment tools correctly. You can find it by searching for “deployment” in the Start Menu.
-
Use the
copype.cmd
script to copy the base Windows PE files for your target architecture. This script requires two parameters: the architecture (x86
,amd64
, orarm
) and the destination path. For example, to copy the 64-bit (amd64) Windows PE files toC:winpe_amd64
, run the following command:copype.cmd amd64 C:winpe_amd64
This command creates the
C:winpe_amd64
directory and populates it with the essential files for that architecture, including the Windows PE image (winpe.wim
).
Step 2.2: Mounting the Windows PE Image
-
Mount the base Windows PE image (
winpe.wim
) located inC:winpe_amd64mediasourcesboot.wim
to a mount directory (C:winpe_amd64mount
) using the DISM (Deployment Image Servicing and Management) tool. Mounting an image extracts its contents, allowing you to modify it if needed. Run this command:dism.exe /mount-image /imagefile:C:winpe_amd64mediasourcesboot.wim /index:1 /mountdir:C:winpe_amd64mount
-
Verify that the command completes successfully by checking for the “The operation completed successfully” message. You can also use
dism.exe /get-MountedWiminfo
to view all currently mounted images.
Step 2.3: Setting up the TFTP Root Directory
-
Identify the root directory for your TFTP server. This location depends on your chosen TFTP server software. Consult your TFTP server documentation to find this directory. For this example, we’ll assume the TFTP root directory is
C:TFTPRoot
on a server namedPXE-1
and is shared as\PXE-1TFTPRoot
. -
Map a drive letter (e.g.,
Y:
) to this network share on your deployment computer. Then, create aBoot
folder within the TFTP root directory. Use these commands in the command prompt:net.exe use Y: \PXE-1TFTPRoot Y: md Boot
Step 2.4: Copying PXE Boot Files
-
Copy the necessary PXE boot files from the mounted Windows PE image directory (
C:winpe_amd64mountwindowsbootpxe
) to theBoot
folder in your TFTP root directory (Y:Boot
). These files are crucial for initiating the network boot process.copy C:winpe_amd64mountwindowsbootpxe*.* Y:Boot
Step 2.5: Copying boot.sdi
-
Copy the
boot.sdi
file, which is the Windows System Deployment Image file, fromC:winpe_amd64mediaboot
toY:Boot
. This file is loaded by the Windows Boot Manager.copy C:winpe_amd64mediabootboot.sdi Y:Boot
Step 2.6: Copying boot.wim
-
Copy the bootable Windows PE image (
boot.wim
) fromC:winpe_amd64mediasources
toY:Boot
. This is the Windows PE image that will be loaded and run on the client computers.copy C:winpe_amd64mediasourcesboot.wim Y:Boot
Step 2.7: (Optional) Copying TrueType Fonts
-
Optionally, copy TrueType fonts from
C:winpe_amd64mediaBootFonts
toY:BootFonts
. This ensures that Windows PE can display fonts correctly, which can be helpful for user interfaces within WinPE.copy C:winpe_amd64mediaBootFonts Y:BootFonts
Configuring Boot Settings and BCD for PXE Boot
Next, you need to configure the Boot Configuration Data (BCD) store, which tells the boot manager how to load Windows PE. This involves creating a BCD store and defining the boot entries for network booting.
Step 3.1: Creating a BCD Store
-
Create a new BCD store file named
BCD
usingbcdedit.exe
in the root of your C: drive. This BCD store will be configured for PXE booting.bcdedit.exe /createstore C:BCD
Step 3.2: Configuring RAMDISK Settings
-
Configure RAMDISK options in the BCD store. RAMDISK allows Windows PE to boot from a WIM image loaded into memory. These commands define the RAMDISK settings and specify the
boot.sdi
file path.bcdedit.exe /store C:BCD /create {ramdiskoptions} /d "Ramdisk options" bcdedit.exe /store C:BCD /set {ramdiskoptions} ramdisksdidevice boot bcdedit.exe /store C:BCD /set {ramdiskoptions} ramdisksdipath Bootboot.sdi
Step 3.3: Creating a Boot Application Entry for Windows PE
-
Create a boot application entry for the Windows PE image. This entry defines how to load and run Windows PE. The following command creates a new entry and returns a GUID (Globally Unique Identifier). Note down this GUID, as you’ll need it in the subsequent commands.
bcdedit.exe /store C:BCD /create /d "winpe boot image" /application osloader
The command will output a message like: “The entry
{GUID}
was successfully created.” ReplaceGUID1
in the following steps with this actual GUID.
Step 3.4: Configuring BOOTMGR Settings
-
Configure the boot application entry with the correct paths and settings for booting Windows PE from the network. These commands specify the device, path, OS device, system root, HAL detection, and set it as a WinPE boot entry. Replace
{GUID1}
with the GUID obtained in the previous step.bcdedit.exe /store C:BCD /set {GUID1} device ramdisk=[boot]Bootboot.wim,{ramdiskoptions} bcdedit.exe /store C:BCD /set {GUID1} path windowssystem32winload.exe bcdedit.exe /store C:BCD /set {GUID1} osdevice ramdisk=[boot]Bootboot.wim,{ramdiskoptions} bcdedit.exe /store C:BCD /set {GUID1} systemroot windows bcdedit.exe /store C:BCD /set {GUID1} detecthal Yes bcdedit.exe /store C:BCD /set {GUID1} winpe Yes
Step 3.5: Configuring BOOTMGR Settings
-
Configure the BOOTMGR (Windows Boot Manager) settings. This includes creating a BOOTMGR entry, setting a timeout, and specifying the display order to include your Windows PE boot entry. Again, replace
{GUID1}
with your GUID in the third command.bcdedit.exe /store C:BCD /create {bootmgr} /d "boot manager" bcdedit.exe /store C:BCD /set {bootmgr} timeout 30 bcdedit.exe /store C:BCD -displayorder {GUID1} -addlast
Step 3.6: Copying the BCD File to TFTP Server
-
Finally, copy the configured BCD file from
C:BCD
to theBoot
folder on your TFTP server (Y:Boot
). Ensure the BCD file is placed in the correct location so the PXE server can provide it to booting clients.copy C:BCD Y:BootBCD
Example output from bcdedit.exe showing configured BCD settings, useful for verifying the PXE server configuration.
Your PXE server is now configured to boot clients into Windows PE. You can verify your BCD settings using bcdedit.exe /store C:BCD /enum all
.
Troubleshooting Tip: If you encounter the error “The boot configuration data for your PC is missing or contains errors” during the PXE boot process, double-check that the boot
directory and the BCD
file are correctly placed under the TFTP server’s root directory. The root directory name might vary depending on your TFTP server software.
Understanding the PXE Boot Process: A Summary
To better understand how PXE server booting works, here is a summary of the PXE client boot process:
-
Client Discovery: A client computer configured for network boot (PXE boot) starts and broadcasts a DHCP Discover message requesting network configuration and boot server information.
-
DHCP Offer and PXE Server Response: The DHCP server responds with a DHCP Offer, providing an IP address and other network settings. If a PXE server is detected on the network (either on the same subnet or reachable via IP helpers), it also responds, typically offering DHCP options 060, 066, and 067.
- Option 060 (Client Identifier): Identifies the client as a PXE client (“PXEClient”).
- Option 066 (Boot Server Host Name): Specifies the hostname or IP address of the PXE server (TFTP server).
- Option 067 (Boot File Name): Indicates the boot file to be downloaded, typically
PXEboot.n12
(for BIOS) orbootmgfw.efi
(for UEFI).
-
Boot File Download: The client, using the information from the DHCP offer, downloads the initial boot file (e.g.,
PXEboot.n12
) via TFTP from the PXE server. -
Network Boot Program Execution:
PXEboot.n12
(or equivalent) is a small program that initiates the network boot process. -
Boot Manager Download: The client then downloads
bootmgr.exe
(Windows Boot Manager) and theBCD
file from theboot
directory on the PXE server via TFTP. The BCD file provides the boot configuration. -
Windows PE Loading:
Bootmgr.exe
reads the BCD file, identifies the Windows PE boot entry, and downloadsboot.sdi
and the Windows PE image (boot.wim
) from the PXE server. Optionally, it may also download fonts and the hibernation file if present. -
Windows PE Startup:
Bootmgr.exe
starts Windows PE by executingwinload.exe
within the loaded Windows PE image. -
Windows PE Initialization: Windows PE starts, a command prompt appears, and
wpeinit.exe
is automatically executed to initialize the Windows PE environment, setting up network and device drivers. -
Deployment and Tools Access: Within Windows PE, you gain access to powerful deployment tools like
imagex.exe
,diskpart.exe
, andbcdboot.exe
. These tools, along with a Windows 10 image file hosted on your network share, enable you to format disks and install a full Windows 10 operating system onto the target computer.
By following these steps, you’ve successfully configured a PXE server to deploy Windows PE, creating a foundation for efficient network-based operating system deployment and system management.
Related Articles
Windows PE Walkthroughs