Blog Archives

How To Create a WDS Boot and Discover Image for Windows 10 / WinPE 10

Creating new Boot Images is something I do very rarely for our WDS Server (Server 2012 R2) and always run into issues with.  All the guides you’ll find are for Server 2008, SCCM, Custom WinPE Images and are often dated or not quite what we need for a straight up WDS environment…  So I’ve spent two days investigating this and will write it up below in code type format with comments. Commands here as well – https://pastebin.com/3MnVF37c

Start of by Installing the Windows ADK for your OS, i.e. 1703 ADK for Win10 1703.

Once installed open the Deployment and Imaging Tools Environment Command Line via the Start menu and typing Deploy… right-click, Run As Admin and type:

copype amd64 C:\WinPE_amd64\

Some guides don’t use copype, they just skip to mounting the WIM file we are using copype as it lays down the folder structure necessary for this to be a Boot Image in WDS and also a ISO / USB Flash Drive style image.  Now mount the wim file via:

dism.exe /mount-wim /wimfile:C:\WinPE_amd64\media\sources\boot.wim /index:1 /mountdir:C:\WinPE_amd64\mount

Add the necessary features to make it work with WDS, this part is confusing as the MS TechNet articles and other documentation are as clear as mud on Optional PE Components…  This is what I consider will cover all your bases.  Do you need the en-US of each, I don’t know most guides suggest so but I’m not 100% on it, I just add them…

Common issues I know of are:

  • auto-reboots during the final load states of a PXE boot, just after blue screen appears, you haven’t included “WinPE-Setup-Server.cab”
  • iastorB.sys error on boot.  Is not a driver problem,  again you haven’t included “WinPE-Setup-Server.cab” go back and re-add it.
  • errors about language packs, add “lp.cab”
  • errors about no default language being set add the lang.ini file as mentioned below

Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-wmi.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-scripting.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-wds-tools.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureStartup.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Setup.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Setup-Server.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Setup-Server_en-us.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Setup_en-us.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab”
Dism /Add-Package /Image:”C:\WinPE_amd64\mount” /packagepath:”C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\lp.cab”

Set the Language to en-US

Dism /image:C:\WinPE_amd64\mount /Set-AllIntl:en-US

Now we need to a manually copy a lang.ini file into the C:\WinPE_amd64\mount\sources or you’ll get this error:

Windows could not determine the language to use for setup. Error code: 0x80004005.

Using NotePad create a new file called lang.ini with the following in it:

[Available UI Languages]
en-US = 3

[Fallback Languages]
en-US = en-us

Add your base drivers, in my example we’re using the DELL WinPE CAB from here

dism.exe /image:C:\WinPE_amd64\mount /add-driver /driver:”C:\forbootimage\WINPE10.0-DRIVERS-A04-942XJ\winpe” /recurse

Add any extra special drivers at this point as well. You only need “network” and “storage” drivers unless you’re having input problems then you might need to add a special USB3 driver as well.  I assume WinPE 10 1703 has some standard USB3 drivers in it by now…

The typical you don’t have a compatible Network Driver error is:

WdsClient: An error occurred while obtaining an IP address from the DHCP server.

wdsdhcperror_thumb

The Typical you don’t have the right Storage controller driver loaded is the inability to see any disks in the pick a disk to install Windows on window.

Once all done Commit the changes you’ve made to this wim file.

unmount and commit the changes to the WIM file (close any open explorer windows to avoid errors…):
dism.exe /unmount-wim /MountDir:C:\WinPE_amd64\mount /commit

Copy the newly saved C:\WinPE_amd64\mount\sources\boot.wim over to the WDS Server into a local temp folder and “Add Image” it to the Boot Images section. Name it and test.

To also create an ISO at this point or USB Drive you can either go back to WDS and use the “Create Capture Image” option and a bunch of other steps… but we’ve already done all the hard work so lets just tell this Custom WinPE Boot Image about our WDS Server manually:

Opening the Deployment and Imaging Tools Environment Command Line via Start menu and typing Deploy… Run As Admin

Re-mount the wim file again via:

dism.exe /mount-wim /wimfile:C:\WinPE_amd64\media\sources\boot.wim /index:1 /mountdir:C:\WinPE_amd64\mount

Manually create a winpeshl.ini file via NotePad add in:

[LaunchApps]
%SYSTEMDRIVE%\sources\setup.exe, /wds /wdsdiscover /WdsServer:fqdn

i.e. wds-prod01.somecollege.edu

move this file into C:\WinPE_amd64\mount\Windows\System32

Once all done Commit the changes you’ve made to this wim file again.

unmount and commit the changes to the WIM file (close any open explorer windows to avoid errors…):
dism.exe /unmount-wim /MountDir:C:\WinPE_amd64\mount /commit

As we used copype originally we can now just do the following to make an ISO or USB bootable drive:

Opening the Deployment and Imaging Tools Environment Command Line via Start menu and typing Deploy… Run As Admin

MakeWinPEMedia /ISO C:\WinPE_amd64 C:\WinPE-WDS-1703.iso (call it whatever you want)

MakeWinPEMedia /UDF /F G: (whatever drive letter your Flash Drive appears as)

Using this method, you can easily make USB Bootable drives over and over for that new weird Tablet or Laptop that you need to image, add some drivers in as above and then commit the changes and follow the steps above, still doesn’t work?  mount the WIM again, add more drivers, commit it again and create a new ISO / Flash Drive until you get the result you want.

Sources:
https://www.sit.auckland.ac.nz/Create_a_custom_boot_image
https://technet.microsoft.com/it-it/library/dd637996(v=ws.10).aspx
https://technet.microsoft.com/en-us/library/hh824926.aspx
https://technet.microsoft.com/en-us/library/dn387582.aspx

Advertisements