Home » Preparing VHD file using Windows 7 or Windows Server 7 Media or existing VHD running in Hyper-V

Preparing VHD file using Windows 7 or Windows Server 7 Media or existing VHD running in Hyper-V

Preparing VHD file using Windows 7 or Windows Server 7 Media or existing VHD running in Hyper-V

From my previous post create a new VHD and attach it using Disk Management. Now, you will have newly attached X: created with label ‘Windows7′, which is of size 20 GB.

Applying a WIM Image directly to the VHD file using ImageX utility. The ImageX utility can be used to extract the required operating system edition directly to the attached VHD file in Windows 7

The ImageX utility is part of WAIK. i.e. Windows Automated Installation Kit. You can download the WAIK for Windows 7 from here

Now, you will require the ‘install.wim’ file from the Windows 7 Media or Windows Server 7 Media. Along with that we will require ImageX utility.

In order to extract image to the X: we will use the following syntax.

image

d:\imagex>imagex /apply d:\install.wim 1 x:\

In the above syntax we can see we have used ‘d:\install.wim’ followed by ‘1′ and ‘X:\’ (this is the attached VHD.)  Now this 1 denotes Image Index i.e. edition of the Operating System.

As you can see I have used the ‘install.wim’ file from the Media of Windows Server 7 Beta and 1 denotes Enterprise Edition.

In order to check the Image Index we will use the following command

d:\imagex>imagex /info “d:\Download\Windows Server 7 R2\install.wim” (i.e. the location of the install.wim file)

image

Once finished the extracting the OS using ImageX it will look like this

image

Once the image is applied to particular drive in our case X:\. Detach the X: Drive from the Disk Management. Now your VHD file is ready to boot.