References, Server 2008 R2, Windows
comments 5

Creating OS VHDs from Windows Server 2008 R2 OS media

Before we get started on this, here is a list of things you need,
– Windows Automated Installation Kit (WAIK) for Widows 7. This is required to get tools like imagex, etc to create/capture OS image in to a VHD
– Windows Server 2008 R2 Beta

Once you have these builds, Install Windows Server 2008 R2 Beta & WAIK for Windows 7 on a test machine. WAIK, by default, gets installed at %programfiles%\Windows AIK folder.

Steps to capture OS image as VHD

  • Insert Windows Server 2008 R2 OS media in the drive
  • Open Command-prompt and change to %programfiles%\Windows AIK\Tools\amd64 folder
  • 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
  • Run “Diskpart.exe” and continue with the following commands
  • Create vdisk file=c:\<VHDFILENAME>.VHD maximum=<SIZE in MB> Type=<TYPE of VHD; Fixed or Dynamic>
  • select vdisk file = C:\<VHDFILENAME>.VHD
  • Attach vdisk
  • create partition primary
  • format quick fs=ntfs
  • assign letter=S
  • exit
  • Now, we need to capture the image we selected in step 3 in to the new VHD we just created
  • Run “Imagex /apply <CDDRIVE>:\Sources\Install.wim <IMAGE INDEX from Step 3> S:\
  • Open Diskpart again
  • Select vdisk file=C:\<VHDFILENAME>.VHD
  • Detach vdisk

At this point, you can use this VHD now to deploy OS on a physical server or a virtual machine. More on that later.

Filed under: References, Server 2008 R2, Windows

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.