Create Windows Server VHD image from WIM file
Whilst deploying Virtual Machine Manager 2012 I needed to create a Server 2008 R2 VHD to use as a OS template. I found converting a WIM file to a VHD nice and easy.
To do this:
- Download the WIM2VHD.WSF file from http://archive.msdn.microsoft.com/wim2vhd/Release/ProjectReleases.aspx?ReleaseId=2603
- Copy the install.wim file from a Windows Server 2008 R2 installation media to a working directory, I used C:\
- Ensure you have the Windows® 7/Server 2008 R2 Automated Installation Kit (AIK) or the Windows® 7/Server 2008 R2 OEM Preinstallation Kit (OPK) installed.
During the process you need to choose which SKU to use, in order to determine the SKU’s available in the wim file run the below from a normal command prompt
C:\>cscript wim2vhd.wsf /wim:c:\install.wim
I want to create a VHD which has Windows 2008 R2 Standard Edition installed, so I will use “SERVERSTANDARD” AS MY SKU.
In order to create the actual VHD run the below command, this command will inspect the WIM file and create a VHD image of the SKU I selected, it will them save this to the root of my E drive. When complete it leaves you with a small log file and the VHD file.
cscript wim2vhd.wsf /wim:c:\install.wim /sku:SERVERSTANDARD /vhd:e:\2008R2Standard.vhd