Friday, April 27, 2012

How to Convert an ISO to a VHD

     Okay, for starters I don’t know if you can actually convert an iso directly to a vhd, however I am going to show you the process to create a vhd and install your iso onto that vhd all at once.  I should also note that this is what I had to do on Windows 7, and I imagine it's a much easier task on Windows Server.

First you will need to download WIM2VHD converter from:
WIM2VHD Converter

Then follow these steps:

1.  Open an elevated command prompt.

2.  Then enter:

cscript wim2vhd.wsf /wim:X:\sources\install.wim /sku:anynameyoulike
/vhd:c:\AnyFolderThatAlreadyExists\AnyNameYouLike.vhd

Note: If you run this and you get an error stating that wim2vhd.wdf cannot be found in such and such a place, you can just move this file to where the command prompt is looking for it.  Of course, you could use the trick in another one of my blog posts that opens a command prompt in the folder where your wim2vhd.wdf file already exists.  Your choice.

3.  You will need to install Virtual Clone Drive (which is free) from here:
Virtual Clone Drive Download Page

4.  Double-click on your iso file which should then show something like this:



ISOMounted

As you can see our iso was mounted on drive E:, so in the command above you will need to replace X: with whatever drive your iso was mounted to.

5.  When you hit enter you should see something like this:


Capture

6.  Once the process is complete, you can attach the VHD to a virtual machine and boot, or you can boot natively if your system has a Windows 7/Server 2008 R2 boot manager.

7.  Have fun!