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.