Booting Windows from a compressed image

Dream Start

Creating an Image

To use WIMBoot, you first need a standard installation file of Windows 8.1 Update 1 based on the install.wim file from the sources directory of the installation DVD or an ISO file with Windows 8.1 Update 1. Later, I'll show how to boot a computer with Windows 8.1 Update 1 using WinPE 5.1, how to create a WIM image that supports WIMBoot, and how to assign this image to the computer as the operating system. You can also do all this with a Hyper-V second-generation virtual machine.

In the example, I assume you have saved the install.wim file in the C:\Temp directory; now, to add WIMBoot compatibility to the standard image, enter line 1 in Listing 1. The Dism command-line program is automatically added to the command path during the ADK installation, so you do not have to switch to the ADK installation directory.

Listing 1

Creating the WIMBoot Image

01 Dism /Export-Image /WIMBoot /SourceImageFile:C:\Temp\install.wim \
   /SourceIndex:1 /DestinationImageFile:C:\Temp\install_wimboot.wim
02
03 md C:\mount\Windows
04 Dism /Mount-Image /ImageFile:"C:\Temp\install.wim" /Index:1 \
   /MountDir:C:\mount\Windows
05
06 attrib -s -h C:\mount\Windows\Windows\System32\Recovery\winre.wim
07
08 move C:\mount\Windows\Windows\System32\Recovery\winre.wim C:\Temp\winre.wim
09
10 Dism /Optimize-Image /Image:C:\mount\Windows /WIMBoot
11
12 Dism /Unmount-Image /MountDir:C:\mount\Windows /Commit

Alternatively, instead of converting the default image file of Windows 8.1 Update 1, you can create your own, new WIMBoot image by copying install.wim to a new temporary file and using it.

However you create your image file, you should now create a mount directory and mount the image (lines 3 and 4; Figure 1). Additionally, you make the recovery boot image (winre.wim) visible in line 6 and move winre.wim from the image to save further disk space (line 8). Line 10 then optimizes the rest of the image for WIMBoot. The next step (line 12) dismounts the image; the changes are written to the image and can now be used to boot computers.

Figure 1: Creating a WIM bootable image with Dism from the current Windows ADK.

Customizing Images

After you have configured a satisfactory WIM image, you can distribute it to clients. Because a WIM image is appended in its own partition at the end of the hard drive, you should first adjust the hard disk partition on the computer. You will need a boot device with WinPE 5.1 to deploy.

To create an appropriate volume, from Windows 8.1 Update 1 with an installed Windows ADK environment, right-click the Deployment and Imaging Tools Environment via the context menu and Run as administrator . Create a working directory and directory structure for the WinPE files with

copype amd64 C:\WinPE_amd64

WinPE 5.0 is initially in this folder.

Now update it to version 5.1. To do so, download the MSU files for Windows 8.1 Update [6] and the update for Windows 8.1 [7]. Then, copy the seven MSU files into their own directory (e.g., C:\msu). You will need the files later to integrate them into WinPE 5.0 and to update them on WinPE 5.1. Next, mount the WinPE image with the following:

Dism /Mount-Image \
         /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /index:1 \
         /MountDir:"C:\WinPE_amd64\mount"

In the next step, integrate the downloaded MSU files with the commands shown in Listing 2 [8]. Before doing so, ensure that all the patches are in the directory and complete the integration without error messages.

Listing 2

Updating Windows Images

Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2919442-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log
Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2919355-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log
Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2932046-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log
Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2934018-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log
Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2937592-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log
Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2938439-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log
Dism /Add-Package
     /PackagePath:C:\MSU\Windows8.1-KB2959977-x64.msu
     /Image:C:\WinPE_amd64\mount /LogPath:AddPackage.log

Next, optimize and dismount (Figure 2) the image:

Dism /image:C:\WinPE_amd64\mount /Cleanup-Image \
  /StartComponentCleanup /ResetBase
Dism /Unmount-Image /MountDir:"C:\WinPE_amd64\mount" /commit
Figure 2: You need a WinPE boot disk based on WinPE 5.1 (Windows 8.1 Update 1) to provision WIMBoot.

In Listing 3, the commands shown create the updated WinPE 5.1 medium according to the following line numbers:

Listing 3

Creating the WinPE Medium

01 Dism /Export-Image /SourceImageFile:C:\WinPE_amd64\media\sources\boot.wim
   /SourceIndex:1 /DestinationImageFile:C:\WinPE_amd64\media\sources\boot2.wim
02 del C:\WinPE_amd64\media\sources\boot.wim
03 rename C:\WinPE_amd64\media\sources\boot2.wim boot.wim
04 MakeWinPEMedia /ISO C:\winpe_amd64 C:\winpe_amd64\winpe.iso
05 MakeWinPEMedia /UFD C:\WinPE_amd64 <stick drive letter>:

1. Export the WIM file and customize it for WIMBoot.

2. Delete the old boot file.

3. Use the new boot file.

4. Create an ISO file.

5. Create a bootable USB stick.

If you now boot the computer using the WinPE disk, you can manage WIMBoot and install a WIMBoot image on the computer.

Easier Image Rollout

At this point, you need to boot the computer with Windows 8.1 Update 1 using this USB stick or create a virtual machine by copying the ISO file from the VM onto the host computer and then setting it as a bootable disk. You also need to adjust the boot sequence in the settings of the VM "Firmware" for generation 2 VMs (Figure 3).

Figure 3: Change the boot order in the settings of second-generation VMs in Hyper-V 2012 R2 and incorporate WinPE 5.1.

You can also create a WIM image of the current installation in this disk's command prompt. The WIM file can also be used as a boot medium. However, you need to make sure that this operating system has Windows 8.1 Update 1. To create an image, use the following command:

dism /capture-image /imagefile:"<dev>:<\path\new>.wim" \
  /capturedir:C: /name: "<name>"

During this process, save an image of the current operating system with all data and settings on an external hard drive and assign it later. The advantage is that you can install the necessary programs in a template image beforehand and integrate the necessary drivers and settings.

You can prepare this image with the previously mentioned steps to customize existing images for WIMBoot and then assign them to your computer. You can even optimize WIMBoot while creating it using the option /wimboot. However, this option is only available with WinPE 5.1, not WinPE 5.0.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Redo Backup
    Redo Backup backs up complete hard drives locally or over a network. The focus is on simple operation and high reliability in a variety of deployment scenarios.
  • Creating a non-certified Windows To Go USB drive
    You don't have to buy Windows 8 Enterprise Edition to create a Windows To Go USB drive, nor do you have to buy an expensive, certified USB disk to make it work.
  • Putting Windows 8 on a USB Drive

    You don’t have to buy Windows 8 Enterprise Edition to create a Windows To Go USB drive, nor do you have to buy an expensive, certified USB disk to make it work.

  • Top PowerShell Cmdlets

    Windows is no longer the system for mouse pushers. In the latest server version, the default installation installs without a GUI, and management via PowerShell is a part of everyday life for Windows administrators.

  • The best cmdlets for PowerShell
    Windows is no longer the system for mouse pushers. In the latest server version, the default installation installs without a GUI, and management via PowerShell is a part of everyday life for Windows administrators.
comments powered by Disqus