Consolidating Your Task Sequence Part 1: How to Combine WIM images into one
If you have multiple images that you deploy but would like to reduce the amount of operation overhead in maintaining task sequences, consolidating your task sequences into one task sequence should be considered. For example if you have a task sequence that deploys an x86 image and a different task sequence to deploy the amd64 version of the image, combining these images into one WIM with multiple indexes and combining your task sequences into one task sequence is something that should be considered.
Why Combine Images
- Combining images will reduce the amount of footprint on your servers by using single instancing.
- Reduce the amount of operation overhead required for a task sequences as an administrator will not have to make edits in multiple task sequences.
How to Combine images
As a rule of thumb images can be combined by using the following steps:
- Capture ImageA
- Capture ImageB
- Rename and change the description for ImageA
- Mount ImageB
- Append the Mounted ImageB to ImageA
If there are additional images you can continue by mounting ImageC etc. and appending them to ImageA.
Capture Our Images
Now that we have gone over the procedure at a high level lets take a look at a specific example and the command needed to combine images. The purpose of this blog is not to talk about how images are captured so lets say that we have captured an image called Win7x86.wim and another image called Win7amd64.wim and we would like to combine these images. As a best practice the x86 image should be the first index in a combined image (perhaps this is just personal choice, but for the remainder of this blog it will be outlined in this way).
Rename and Change the Description for ImageA
To avoid confusion on which image is which lets start out by changing the name and description for the first image (or index) and the name of the actual file before appending additional images. Lets start by renaming the file to Win7Combined.wim. Now lets change the information in the image using the following example:
imagex /info Win7Combined.WIM 1 "Win7(x86)" "Windows 7 x86"
Using this command the first index in the WIM has had its name changed to “Win7(x86)” and its description to "Windows 7 x86".
The change can be verified by using imagex /info Win7Combined.WIM
So now we will need to mount our Win7Amd64.wim and append it to the Win7Combined.wim. This will be done using the /apply switch, which will actually extract all of the files to the directory specified. Keep in mind that whatever directory you apply the image to will need to be empty. Follow this example to mount the image:
imagex /apply "Win7Amd64.wim” 1 C:\Mount
Where 1 is the index of the image and C:\Mount is the location where the image will be applied. Of course the image can be applied to any directory as long as it is empty.
Append the Mounted ImageB to ImageA
Now the image is ready to be appended to the first image that was renamed. Use the following example to append the images:
Imagex /append C:\Mount "Win7Combined.WIM " "Win7(AMD64)" "Windows 7 AMD64"
This will append the mounted image to the x86 image that we modified at the beginning. Additionally we have set the name to "Win7(AMD64)" and the description to "Windows 7 AMD64" of the appended image.
Now that the images have been combined imageX can be used with the /info switch to see that the image count is now 2.
Note: You can also use DISM.exe for this process also