Categories
Microsoft Windows Installer, Application Compatibility and Deployments

Mount a Wim Image using DISM for Offline Servicing

Deployment Image Servicing and Management (DISM) is a tool which allows you to service your images offline.  It supports both .wim and .vhd formats. In this article, we will look at how do you mount an Wim Image using this tool!

DISM has a very constent syntax. If you are not aware of the syntaxes, then just type the below command in the cmd window. You will get an excellent help document, with examples too.! cmd:> DISM /?

You can read the Introduction to Deployment Image Servicing and Management (DISM) here

For the demo purpose, i have extracted the iso image which comes in the dvd of Server 2008 r2. Once you extract the iso, and goto sources folder, you will see install.wim and boot.wim.  The Wim image (install.wim) has all the editions of the operating system and it’s always using the index number, we figure out which flavour of the OS it represents!

Wim Images

Now lets look at a legacy way of viewing an image information; we all use Imagex to find these details, using the command “Imagex /info <path>image.wim”;  When you run this command “imagex /info “C:\Server2008r2\Sources\install.wim“,  you will see a lot of information ranging from the number of directories, files, Index number,  major version number, minor version number..etc etc.

When you think about documentation, you really dont need to know so much of information. and its really really tough to identify the required information from this kinda output.

Imagex View

Let’s fetch the same information using DISM, using the command dism /get-wiminfo /Wimfile:<path>image.wim. You will get to see clear information about all the editions which is loaded on the particular wim image!

Dism /Get-Wiminfo

If you need more information on a particular edition of the Wim Image, all you need to do is to add the index number at the end of the command /Index:<indexnumber>.

DISM /get-wiminfo /index

Mounting a Wim Image

Mounting an image as easy as calling a wim image with a /Mount-Wim switch and the Index number on a command prompt. You generally will mount an image for offline servicing. Predominantly they are for patch tuesdays, adding the new patches, Adding or removing the drivers,  Enable or disable windows fetaures like Firewall, Games etc..  You can run the below command to mount a Wim Image.

dism /Mount-Wim /WimFile:<Path>image.wim /Index:<indexnumber> /MountDir:<mountDir>

Mount-Wim

The image is mounted to a folder, now you can make all the customizations and modifications to it!

Mounted Wim Image appears in the explorer Window

Displaying all Mounted Wim Images

DISM provides you options to load even multiple Wim images in different folders. For example, if you need to replicate your customized drivers to all the images, you can just copy the drivers from C:\Windows\System32\Drivers from one image to another one which is currently build. You can just mount both these wim’s parallely and copy the drivers using the folder view.

This command will give you an overview on all the images which are mounted-  dism /get-MountedWiminfo

Mounted Wim

You would also be interested in reading this  –

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

DISM – Deployment Image Servicing and Management Guide

Deployment has a new tool in Windows 7: DISM (Deployment Image Servicing and Management). DISM is a command line tool which can be used to service a Windows® image or to prepare a Windows Preinstallation Environment (Windows PE) image. It replaces Package Manager (pkgmgr.exe), PEimg, and Intlcfg that were included in Windows Vista®.

Hence, Now one tool does it all ! ! !

DISM can be used to service Windows Vista® with Service Pack 1 (SP1) and Windows Server® 2008 and provides the same functionality that Package Manager provided. DISM provides additional functionality when used with Windows® 7 and Windows Server® 2008 R2.

In addition to replacing three previously released tools, DISM also supports more features and functionality than the other tools (most notably Package Manager) supported in Windows Vista, including logging, inventory commands with parse-able output, detailed help, offline INF driver package installation, direct application of MS update packages, and integration of international settings.

DISM tool is also part of the Windows Automation Installation Kit(AIK) 2.0, which you can freely download and use!

DISM can be used to..,
1. Add, remove, and enumerate packages.
2. Add, remove, and enumerate drivers.
3. Enable or disable Windows features.
4. Apply changes based on the offline servicing section of an unattend.xml answer file.
5. Configure international settings.
6. Upgrade a Windows image to a different edition.
7. Prepare a Windows PE image.
8. Take advantage of better logging.
9. Service down-level operating systems like Windows Vista with SP1 and Windows Server 2008 (
Supports only Vista SP1 and later images)
10. Service all platforms (32-bit, 64-bit and Itanium).
11. Service a 32-bit image from a 64-bit host and service a 64-bit image from a 32-bit host.
12. Make use of old Package Manager scripts.

Running DISM Tool

Run a Command Window with Elevated ContextDISM is a command line utility. To launch this program, run a Command Window in an elevated context (Run As Administrator) and type dism /? This will give you the help file (without image context – The commands which you can perform without loading or mounting an image)

Windows 7: DISM (Deployment Image Servicing and Management)

Now you type, dism online /? This will give you the help file (with image context – The commands which you can perform an Wim image or a VHD is mounted) – As you see in this below snapshot, you can do a lot of options like, Setting the edition of the image, UI Lang packs, Time Zones, Apps, Drivers etc..

DISM Help file - With Image context

How does DISM Work?

How Deployment Image Servicing & Management (DISM) Works

DISM Providers These providers varies on different Operating Systems.  Windows 7 and Server 2008 R2 has DISM providers. Windows Vista SP1 and Windows Server 2008 RTM does not contain any DISM providers.  When servicing these downlevel OS images, DISM loads and invokes the Vista PkgMgr from inside the image to execute the operations.  Windows 7 and Windows PE 3.0 may contain DISM service providers that are specific to the OS image, e.g. Transmog provider operates against full OS image and can only be found in a Windows 7 image, and PE provider operates against WinPE image, so can only be found in a Windows PE 3.0 image. You can find a list of providers in the folder C:\Windows\System32\DISM in Windows 7 and Server 2008 R2.

Dism Providers - Windows 7

I would recommend you read the other DISM articles too!