Walkthrough 3 - wimboot .vhd

Steps -


1] Devices/paths

Paths used in this section (based on mount points specified when DiskPart was used to prepare the disk - see here and here) -


2] wimboot





3] Apply Windows Image (DISM)

NOTE/WARNING - install.wim can contain multiple images. Adjust image/index number in the steps below to select the required Windows version. As an example, install.wim from a Windows 11 source .iso contains 10 different images, including Enterprise, Education and Professional versions of Windows 11 - image/index 3 is Enterprise. For an overview of the Windows Image (WIM) format, see here.

The Deployment Image Servicing and Management tool (DISM) is backwards compatible, however previous versions of DISM may not support all commands when newer Windows sources are used. To avoid compatibility issues, the DISM version included in the Windows source ISO (\sources\dism.exe) can be used to apply/extract the contents of an image in \sources\install.wim.

For information about the DISM /Apply-Image command syntax, enter the following in a command prompt

Extract the contents of image 1 in S:\win81wimboot.wim to the target drive (T:\ - mounted .vhd file) - adjust paths as required. Note the use of the /WIMBoot flag.

wimlib can be used as an alternative to DISM. Syntax -

If using wimlib, extract the contents of image 1 in S:\win81wimboot.wim to the target drive (T:\ - mounted .vhd file) - adjust paths as required. Note the use of the --wimboot flag. -


4] Create boot files (bcdboot)

"BCDBOOT command line tool is used to copy critical boot files to the system partition and to create a new system BCD store" (https://winteltools.com/bcdboot/).

For more information about the bcdboot command syntax, enter the following in a command prompt (see here for output from Windows 10 version 21H2 bcdboot)

Create BIOS and UEFI boot files on the target drive (R:\), using the templates embedded in the operating system files extracted to drive T:\ in the preceding step - adjust paths as required.


5] SANPolicy

"Storage area network (SAN) functionality enables a computer to mount disks and other storage devices automatically from other computers. By configuring the SAN policy....you can control whether or not disks are automatically mounted and which disks can be mounted. ." (https://docs.microsoft.com/en-us/).

Windows To Go created with the workspace creator (now deprecated) automatically applied SANPolicy 4 (makes internal disks offline - all external disks and the boot disk are online). SANPolicy 3 appears to add more robust protection when running Windows To Go as all disks with the exception of the boot disk will be offline, preventing accidental writes on the host computer.

Mount the offline registry hive T:\Windows\system32\config\system as HKLM\_TEMP (adjust path as required)

Edit the registry hive mounted in the previous step to configure SANPolicy 3 (adjust SANPolicy as required)

Unmount the registry hive mounted as HKLM\_TEMP


6] bootmenupolicy / Edit boot menu entry

The bcdedit tool is used to edit entries in the Boot Configuration Database (the BCD store). Whilst bcdedit is beyond the scope of this guide, a brief overview of bcdedit and BCD paths may be helpful -

Setting the bootmenupolicy to legacy will display a basic boot menu, with improved boot speeds. More detailed information about bootmenupolicy is available here.

Edit bootmenupolicy in the BIOS boot menu (adjust paths as required)

Edit bootmenupolicy in the UEFI boot menu (adjust paths as required)

Edit the BIOS boot menu and change the name (description) of the menu entry (adjust paths/description as required)

Edit the UEFI boot menu and change the name (description) of the menu entry (adjust paths/description as required)

BOOTMENUPOLICY legacy


7] Unmount .vhd

Basic DiskPart usage is covered here.

 select vdisk file=S:\wimboot2go.vhd  - select the mounted virtual hard disk - adjust path as required.

 detach vdisk  - unmount the disk selected in the preceding step.

Contents of DiskPart script to automate the commands listed above -

Save as D:\walkthrough3vhd2.txt and then run the following command from an elevated command prompt (run as Administrator). Adjust path and filename as required -


8] Complete setup

After completing all of the steps listed above, boot from the USB device to complete Windows setup. This is covered in more detail here.

Document date - 6th July 2022