As a follow up to the previous post, this method was blogged well before Microsoft released WIM2VHD and I still use this method to create Windows Server 2008 R2 VHD using either ISO mounted or the actual media.

To be honest, a vhd is being created right now using this method as I blog this! Smile Building a SharePoint farm in Hyper-V.. so you may want to follow the series…

So how do you create an operating system vhd from a media? I will copy the content from Ravikanth’s blog post as is – as I mentioned above about this method having been blogged way before we saw WIM2VHD

  1. Insert Windows Server 2008 R2 OS media in the drive
  2. Open Command-prompt and change to %programfiles%\Windows AIK\Tools\amd64 folder
  3. Run “imagex /info <CDdrive Letter>:\Sources\Install.WIM. Install.WIM contains more than one OS edition and this command displays a list of all available images within install.wim. Note down the image index number for the image you want to capture as a VHD
  4. Run “Diskpart.exe” and continue with the following commands
  5. Create vdisk file=c:\<VHDFILENAME>.VHD maximum=<SIZE in MB> Type=<TYPE of VHD; Fixed or Dynamic>
  6. select vdisk file = C:\<VHDFILENAME>.VHD
  7. Attach vdisk
  8. create partition primary
  9. format quick fs=ntfs
  10. assign letter=S
  11. exit
  12. Now, we need to capture the image we selected in step 3 in to the new VHD we just created
  13. Run “Imagex /apply <CDDRIVE>:\Sources\Install.wim <IMAGE INDEX from Step 3> S:\
  14. Open Diskpart again
  15. Select vdisk file=C:\<VHDFILENAME>.VHD
  16. Detach vdisk

That’s it!

To note: If you are not comfortable using command prompt, then you can create vhd using the disk management mmc [gui based] upto step 11 and then jump into the command prompt and run steps 12-13 and then go back to disk management mmc and detach the disk [don’t delete!]

Using this method is much quicker to get an OS image applied to vhd then the previous method I had blogged. I will label this method 2 as reference to future posts that I am going to write in reference to how I used Ravi’s method to attach this to Hyper-V Smile