Creating Boot Media
Boot Media is the bootable USB or ISO the device starts from. It carries a secure token that ties it to a specific customer (tenant).
Build steps
- Left navigation → Boot Media → New.
- Select the customer (tenant) the media is for. This matters, the device pulls that tenant's content and branding.
- Choose USB or ISO.
- Generate, then write it to a USB stick or burn the ISO.
Important
- The media is scoped to the tenant you selected. If you deploy a device from a USB built for the wrong customer, it will pull that customer's content and branding, always build media for the correct customer.
- Keep the boot media up to date when you change the standard image or agent.
- On sites with a Site Server running Network Boot, you can skip the USB entirely - devices boot CloudImage straight over the LAN.
Advanced: building the WinPE boot media
The steps above cover generating a boot-media token in the portal. This section covers actually building the bootable WinPE image as a USB, an ISO, or a WIM you import into WDS for PXE, with the CloudImage agent and your customer's token baked in. Do this once per customer on a Windows build machine.
Prerequisites
- Windows ADK (latest) with the Deployment Tools feature and the Windows PE add-on.
- The CloudImage agent files (
agent/folder: the.ps1scripts,startnet.cmd,cloudimage-agent.json.template). - A Boot Media token for the customer (portal → Boot Media → New).
- (Recommended) the vendor WinPE driver packs (NIC / storage) for the hardware you deploy.
Step 1. Create the WinPE working set
Open Deployment and Imaging Tools Environment as Administrator:
copype amd64 C:\WinPE\amd64Step 2. Mount the boot image
Dism /Mount-Image /ImageFile:"C:\WinPE\amd64\media\sources\boot.wim" /index:1 /MountDir:"C:\WinPE\mount"Step 3. Add the required optional components
The agent needs PowerShell, WMI, .NET, scripting, storage, and DISM cmdlets:
set OC=C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\WinPE-WMI.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\en-us\WinPE-WMI_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\WinPE-NetFx.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\en-us\WinPE-NetFx_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\WinPE-Scripting.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\WinPE-PowerShell.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\en-us\WinPE-PowerShell_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\WinPE-StorageWMI.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\WinPE-DismCmdlets.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"%OC%\en-us\WinPE-DismCmdlets_en-us.cab"Step 4. (Recommended) inject WinPE NIC / storage drivers
Modern laptops often boot WinPE with no network or no visible disk, which stops the deploy before it starts. Inject the vendor WinPE driver pack (boot-critical NIC / storage only, not the full OS driver pack) as extracted .inf folders:
Dism /Image:"C:\WinPE\mount" /Add-Driver /Driver:"C:\Drivers\Dell-WinPE" /RecurseRepeat per vendor. Dell, HP, and Lenovo publish dedicated "WinPE driver packs" for exactly this.
Step 5. Copy in the agent and your customer's token
mkdir "C:\WinPE\mount\Windows\System32\CloudImage"
copy startnet.cmd "C:\WinPE\mount\Windows\System32\startnet.cmd"
copy *.ps1 "C:\WinPE\mount\Windows\System32\CloudImage\"
copy cloudimage-agent.json.template "C:\WinPE\mount\Windows\System32\CloudImage\cloudimage-agent.json"
:: optional, only if you still use legacy EXE driver packs; ZIP/CAB packs don't need it:
copy 7za.exe "C:\WinPE\mount\Windows\System32\CloudImage\"Then edit ...\Windows\System32\CloudImage\cloudimage-agent.json and paste your token:
{
"apiUrl": "https://app.cloudimage.co.uk",
"agentToken": "PASTE_YOUR_BOOT_MEDIA_TOKEN"
}- apiUrl: your CloudImage URL (default shown).
- agentToken: the token from the portal's Boot Media page. This scopes the media to that customer, the device pulls that customer's content and branding. Build separate media per customer.
You rarely rebuild the image. The agent .ps1 scripts self-update from the server on every boot, so agent fixes ship automatically. Only rebuild when the token / customer, the WinPE drivers or components, or 7za.exe change.
Step 6. Unmount and commit
Dism /Unmount-Image /MountDir:"C:\WinPE\mount" /CommitC:\WinPE\amd64\media\sources\boot.wim is now your finished CloudImage WinPE image.
Step 7. Produce the media (choose one)
USB stick (E: is the USB drive):
MakeWinPEMedia /UFD C:\WinPE\amd64 E:ISO (VMs, burning, or remote KVM):
MakeWinPEMedia /ISO C:\WinPE\amd64 C:\WinPE\CloudImage-WinPE.isoWDS / PXE (network boot): you don't need MakeWinPEMedia, import the committed boot.wim directly as a WDS boot image:
- WDS console: your server → Boot Images → Add Boot Image, select
C:\WinPE\amd64\media\sources\boot.wim. - PowerShell:
Import-WdsBootImage -Path "C:\WinPE\amd64\media\sources\boot.wim"
Devices that PXE-boot from WDS then load CloudImage WinPE straight off the network, no USB required.
Quick path: pre-built WinPE
If you don't want to build WinPE yourself, CloudImage can host a pre-built golden master WinPE image. You upload the master boot.wim once, then the portal generates tenant-scoped boot media from it automatically.
This is the fastest path for most customers: no ADK, no copype, no manual DISM steps. See the next section for building the master WIM if you want to customise it (add WinPE drivers, etc.).
- Build the golden master
boot.wimusing the PowerShell script below, or use your existing WinPE image. - In the portal, go to Boot Media → Pre-built WinPE and upload the
boot.wim. - Create boot media as normal. The portal injects the tenant token and produces the USB / ISO for you.
Building & uploading the golden master WIM (PowerShell)
This is the one-time build of the master WIM you upload (Boot Media → Pre-built WinPE). Run it in an elevated PowerShell on a Windows build machine. Differences from a per-customer build: inject the WinPE driver packs, do NOT add any cloudimage-agent.json (the token is injected per-customer at download), and finish by uploading the boot.wim.
Prerequisite gotcha: the WinPE add-on is a separate download from the Windows ADK. Installing the ADK alone gives you copype / DISM but not the ...\Windows Preinstallation Environment\amd64\WinPE_OCs folder with the .cabs. Install "Windows PE add-on for the Windows ADK" (matching your ADK version) or the Dism /Add-Package steps fail with 0x80070003.
PowerShell vs cmd: use $OC / "$OC\...", not %OC% (that's cmd syntax and won't expand in PowerShell — another 0x80070003 cause).
# --- paths (edit to taste) ---
$WS = 'C:\WinPEWIM' # working set (from: copype amd64 $WS)
$mount = "$WS\mount"
$OC = 'C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs'
$agent = 'C:\cloudimage\repo\agent' # where the agent .ps1 + startnet.cmd live
# mount the base image
dism /Mount-Image /ImageFile:"$WS\media\sources\boot.wim" /Index:1 /MountDir:"$mount"
# sanity-check the OC path (must be True; if False, install the WinPE add-on)
Test-Path "$OC\WinPE-WMI.cab"
# optional components (NOTE: $OC, not %OC%)
foreach ($p in 'WinPE-WMI','en-us\WinPE-WMI_en-us','WinPE-NetFx','en-us\WinPE-NetFx_en-us',
'WinPE-Scripting','WinPE-PowerShell','en-us\WinPE-PowerShell_en-us',
'WinPE-StorageWMI','WinPE-DismCmdlets','en-us\WinPE-DismCmdlets_en-us') {
dism /Add-Package /Image:"$mount" /PackagePath:"$OC\$p.cab"
}
# WinPE NIC/storage driver packs (extracted .inf folders) — add each brand you deploy
dism /Image:"$mount" /Add-Driver /Driver:"C:\Drivers\Dell-WinPE" /Recurse
dism /Image:"$mount" /Add-Driver /Driver:"C:\Drivers\HP-WinPE" /Recurse
# dism /Image:"$mount" /Add-Driver /Driver:"C:\Drivers\Lenovo-WinPE" /Recurse
# agent scripts + startnet — NO cloudimage-agent.json in the master
New-Item -ItemType Directory -Force -Path "$mount\Windows\System32\CloudImage" | Out-Null
Copy-Item "$agent\startnet.cmd" "$mount\Windows\System32\startnet.cmd" -Force
Copy-Item "$agent\*.ps1" "$mount\Windows\System32\CloudImage\" -Force
# commit (writes everything back into boot.wim; the mount folder empties — that is NORMAL)
dism /Unmount-Image /MountDir:"$mount" /Commit
dism /Get-MountedImageInfo # should say "No mounted images found"Your finished master is C:\WinPEWIM\media\sources\boot.wim. Upload it via Boot Media → Pre-built WinPE.
- An empty
mountfolder after/Commitis expected — the changes are now inside theboot.wim. Verify the WIM withGet-Item "$WS\media\sources\boot.wim" | Select Name,Length,LastWriteTime(recent timestamp + a size bump from the driver packs = success). - Rebuild only when the WinPE drivers or components change — the agent
.ps1scripts self-update, so code changes never need a rebuild.