Convert VHD or VHDx to WIM

Use Case

If you are creating a Windows image for deployment with MDT, SCCM, or another deployment solution, you may want to use a custom WIM file instead installing the standard Windows image and running customizations as part of the deployment task sequence.

Although the functionality exists to build and capture an image within MDT or SCCM, this requires access to a server, or the installation of MDT in order to build an image. You can quickly build a WIM image for deployment simply using tools built into Windows.

HyperV has been a built in feature of Windows since Windows 8. You can very rapidly enable HyperV, install Windows on a HyperV VM, sysprep the VM, and convert the VHD/VHDx to a WIM image using PowerShell.

Create a HyperV VM, convert the VHD/VHDx to a .WIM file for use with MDT/SCCM


  • Create a HyperV VM and install Windows
  • Customize Windows as needed
  • Run Sysprep with the following options (C:\Windows\System32\Sysprep\sysprep.exe) on the VM.
  • On the HyperV host computer, browse to the location of the HyperV VM’s VHD/VHDx file. Mount the VHD/VHDx by double clicking, or right-clicking and clicking “Mount”
  • Open PowerShell and enter the following command:
New-WindowsImage -CapturePath <Drive_Letter_Where_sysprepped_VHD_is_Mounted> -Name <Name_You_Want_To_Call_the_Image> -ImagePath <Path_Where_You_Want_To_Put_The_Image_Including_WIM_File_Name>.wim -Verify

Advantages of using a custom WIM:

  • Fast deploiyment speed as deployment is just a file copy
  • Complex customizations may work more reliably as they’re built in
  • Can build an image without special tools or server access

Disadvantages of using a custom WIM:

  • Changes require manual tracking
  • Changes to the image may sometimes require complete recreation of the image
  • Custom images can be large

Advantages of using the default Windows image, and customizing with task sequence:

  • Changes to install “Image” are all tracked in task sequence
  • Easy to change out base Windows version with the latest version
  • Easy to make changes as needed to fix issues or update applications

Disadvantages of using the default Windows image

  • Slower deployment speed, as apps are installed one by one, potentially with reboots in between
  • Installing applications requires packaging them before hand, introducing possible failure points

Additional Notes

  • Some applications set a unique identifier upon installation, such as antivirus programs. These applications should not be included in a custom captured WIM image, and should be installed at deployment time via a task sequence.

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *