PXE-boot server – Build your own PE (Preinstallation Environment) – Part 4/5

What will be in this post:

In previously posts we created VM which provide DHCP & PXE-boot feature for other VMs. Now we will create bootable windows PE media as one target to boot from other hosts/VMs/computers.

Goals to use Windows PE:

 – Universal, bootable windows environment. The most compatible environment if you would like to install windows? operating system.

 – Tons of usable windows test / partitioning / backup / etc… tools.

 – Possibility to repair existing, installed windows where you boot it (from optical-disc, pendrive or network).

 – Connect to network, run automated tasks / scripts from it.

So to enjoy all benefit of it, in this post we will create our first bootable windows PE environment. For it we will use Win10 PE SE, as the easiest way to create / deploy winPE image from source. If you would like to use another windows source, just do it, WinPE SE support it from windows 7 (“WinPE 3.0” | For WinPE versioning, please visit this site.).

Must to be know, that the cleanest, but the hardest way to create WinPE image is described in Microsoft’s official guide for it (I not recommend for beginners, too much time to get sense of achievement)

At this point, I must to write about the legal-side of it: The source for your WinPE image must to be legal & please read EULA’s part which valid four your case!

Win10PE SE:

We will use this tool, as developers of it collect a lot of necessary & useful option which can be added by a click.

Install Win10PE SE:

First, download Win10PE SE, & unzip it. I recommend short path (like d:\win10pe\) & min. 15Gb free space. For first usage I recommend to read a little-bit on win10pese forum. For my setup, please take a look to these screenshots:

All of picture was taken from a working win10pese builder. For me target was to boot via PXE to machine installed with 1GB or more memory & with network support. All of setting’s tested to this case. Tons of option leaved in disabled or in default state because I tried to be under space (& because boot/works form RAM = under RAM-limit)

Create your plugin to inject script / code:

I not find any easiest way to add my modification, so I created a plugin, which (as last step / state before create ISO) overwrite autorun.cmd with my modifications. Please create & put these files to “%YOUR_EXTRACTED_WIN10PESE_FOLDER\Projects\Win10PESE\Finals”:

Title= Map Network | inject script.
Description=Add my prepared autostart.cmd. Frist, check the prepared autostart.cmd on "\Target\Win10PESE\Windows\System32" folder. Than copy the content of it to this autostart.cmd & fill up with your modifications. HINT: copy this plugin folder to Final states, as another plugin could modifiy also (like audio-drivers if you play sound...)


 – Please don’t left that this script overwrites what was generated by project! I recommend that for first, disable this script, make one build & check “%YOUR_EXTRACTED_WIN10PESE_FOLDER\Target\Win10PESE\Windows\System32\autorun.cmd”. After that modify it / append your additional tasks & create your “autorun.cmd” like I do it below. (IMPORTANT! –> copy your built autorun.cmd to the same folder as mapnet.script!–> %YOUR_EXTRACTED_WIN10PESE_FOLDER\Projects\Win10PESE\Finals)

@Echo off
If Exist "%SystemDrive%\Users\Public\Desktop\desktop.ini" del /q /f "%SystemDrive%\Users\Public\Desktop\desktop.ini" & del /q /f /A:R /A:H /A:S /A:A "%SystemDrive%\Users\Public\Desktop\desktop.ini"
If Exist "%SystemDrive%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" Attrib +S +H "%SystemDrive%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
If Exist "%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" Attrib +S +H "%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
drvload.exe %SystemRoot%\inf\battery.inf

Echo Load Audio drivers
drvload.exe %SystemRoot%\inf\hdaudio.inf

Echo Play Startup Sound
Hiderun.exe madplay.exe -q "%SystemRoot%\Media\win95.mp3"

Echo map network-drive
net use t: \\\core
start t:\core.cmd


Add this file to the same path as “mapnet.script”.

If you set up everything, you can start the build with the big blue play button located on right-top corner of window.

Of course, if you have ability & time to play settings, just do it. The tutorial as described above is a working setup, target was to create the most stable setup with some free ram to make availability start portable applications from it.

Set up Media&PXE VM:

Now we have a prepared WinPE image. The next step is to configure our tftp-server’s location to data-disk, create new samba-share for this path & copy WinPE ISO image to our VM & test it.

Create new share for TFTP-server in our “Share” disk (second attached disk):

You can create it by hand (SSH-session & with bash commands), but in this case please take care of permissions for created folder. Now I will show the easiest way via OMV’s web UI:

With this step, we created a folder for tftp-server. In next step we will use this folder also as samba share (this will be visible from booted WinPE-image as shared folder)

Adjust TFTP-server’s path:

I recommend to use SSH-client (PuTTY) for this task. So Start SSH-session & check what is the full path:

My full path is “/media/006e261c-b375-4782-8887-f433e73e9071/tftp”. As at the moment “share” disk is identified by UUID, the center part of path (006e…..) can be other in your case. Please follow the commands as in attached picture upper.

Now edit tftp-server’s (tftpd-hpa) configuration:

nano /etc/default/tftpd-hpa



To your path. In my case


After it save your changes with nano (“Ctrl” + “x” to save, then “y” to overwrite file) & don’t left to restart tftpd-hpa service (to apply our modifications – “/etc/init.d/tftpd-hpa restart”).

At this point, if you start your “PXE-test” VM, it couldn’t boot, as we just created folder but we don’t fill it up with content (what we have on previously |/srv/tftp| path.)

Fill up with content (like WinPE) our new tftp-path:

Now we will have two task. One – Copy content of old path to new path. After it, last state of boot-menu & files will be works fine. Two – Copy our prepared WinPE ISO from our Development-windows environment (where we host VMs, where we created WinPE image) to “Media&PXE” VM.

To copy content from old-path to the new, use this command (your new path can be different. Please use what was added fort tftpd-hpa configuration):

cp -arp /srv/tftp/* /media/006e261c-b375-4782-8887-f433e73e9071/tftp/

To copy your prepared WinPE iso to Media&PXE VM, we must to use a new target-tool for it. This tool will be WinSCP. This is a free secure copy tool which support a lot of protocol, like SSH File Trasfer Protocol (SFTP) to copy files. SFTP’s big advantage that no necessary to run any additional process on server-side (in our case, in Media&PXE VM). For base of communication it is use SSH. The interface of it is like Total Commander, I think it will be familiar and friendly for everybody. Please download & Install it (simply next-next-next), run and fill up with your Media&PXE VM’s data like in picture below:

After it in your local-side (for me, left) stand where you store WinPE ISO, in another side stand to new path of tftp-server & copy it:

Create menu-entry for WinPE ISO to make it bootable & visible:

Your WinPE ISO is in the right place, but it is not visible on grub4dos menu, when you booted with PXE-test VM. Please edit your menu.lst file in new tftp-servers’s path & append these lines:

title WIN10PE\nWindows environment,WinPE
pxe keep
root (pd)/Win10PE_devops.ISO
map --mem (pd)/Win10PE_devops.ISO (0xff)
map --hook
root (0xff)
chainloader /BOOTMGR

Don’t left that upper / lower case is important in filename (in extension also) under linux! iSo is not equal with ISO!

Now if you restart your PXE-test VM, WIN10PE is choosable and VM can boot from it, but when it booted up, you will get an error, like this:

The reason of it: Until now, don’t create any samba share with name “core” & we also don’t have any core.cmd on this path. To solve it, read below instructions.

Create samba-share for WinPE ISO’s autostart.cmd:

To see & use network-drive map & autostart, what was injected to WinPE’s ISO, samba-share needed. If you don’t remember, we injected these lines as last step (map network) in autostart.cmd:

net use t: \\\core
start t:\core.cmd

 So our target that we create a samba share which is reachable in “\\\core” path. Let’s create it:

After you saved new configuration, test it (“windows” + “r” button –> run):

If your share opened, configuration is good. Now if you try to boot WinPE again with your PXE-test VM, you will get again an (expected) error like this:

The problem is the missing “core.cmd”. please follow instructions to solve it.

Crete core.cmd:

core.cmd is the server-side of communication. This cmd provides ability to modify anything instead of packed autostart.cmd in WinPE.ISO. You can map another network-drivers, start applications automatically on WinPE-side, start time-sync, so everything, what you would like to do, it is depends on you. On Media&PXE VM stand to the path of tftp-server and create core.cmd (touch core.cmd; nano core.cmd). After it fill up with your commands. Here is one example:

echo Server-side

Restart your PXE-test VM, and enjoy your control 🙂

On last chapter (PXE-boot server ? Summary ? Part 5/5), I will write about security part of this topic, improvements (for example speed), share link with prepared working VM (please don’t skip what was written in prev. post because you will get working VM at the end… You must to walk on the way to be able to create & debug it) and close PXE-server blog-series. I hope that at this point you get what was in your mind when you started to read this blog-series. If you have any problem / question please contact with me (simplest is to leave a comment under related post).

I will post the last PXE-related writing soon…

Leave a Reply