Deployment of Windows Server 2008 R2 on a VHD using AIK

Every time, when I tried to install Windows Server 2008 R2 on a VM running either on Virtual PC or VMware Player on my laptop, I normally receive the following error message:
VMError Although the error message states that the processor is not compatible with 64-bit mode; my laptop is running a x64 version of Windows 7 on it.
CPUNotSupporting I spent some times searching how to fix this issue over the internet; however I didn’t find a solution for it. Incase, you find a solution, kindly post the same in the comment. Since I was unable to install Windows Server 2008 R2, I tried to install it on a VHD. I read about how to do it, and thought of writing this post, while installing the same on the VHD.

Creating a VHD

Both Windows Server 2008 R2 and Windows 7 support booting from VHD. In this part, we are going to create a VHD on Windows 7. Now we can do this using diskpart utility; however, we are going to use Computer Management to create the VHD.

To begin with, Right-click on the icon Computer and select Manage. Make sure, you select it to run as administrator, when prompted. You will get the following screen Compmgmt Expand Computer Management, select Storage and select Disk Management. Select Action and Choose Create VHD from the given menu.
CreateVHD_1Specify the location where you want to create the VHD. Along with this, you also need to specify the size and type of VHD, as shown in the below screenshot:
CreateVHDOnce you create the VHD, you need to initialize the disk. To initialize the disk, right-click on the VHD and select Initialize Disk from the available menu. 2.InitializeDisk Select the newly created VHD and click on OK to continue.
3.InitializeDisk_2 Now that our VHD is initialized, we are going to format it as NTFS partition. I have assigned the drive letter Z and given a volume label for it.
4.FormatDiskwithNTFSOnce the VHD is formatted, right-click on the disk, and select Mark Partition as Active. With this, the VHD is configured, now we are going to install the operating system on this disk.

Installation of Windows Server 2008 R2 

We are going to deploy Windows Server 2008 R2 on the VHD using Microsoft’s Deployment Toolkit. This is the first time I am going to use it, so thought of documenting the same in this post. To start with, I have already downloaded and installed the Windows Automated Installation Kit, you can download the same here. Along with this, I have also copied the install.wim file from the Windows Server 2008 R2 DVD, which is required for the operating system installation.
6.SelectWIMFileNow lets check the different editions of the operating systems available in this file. We are going to use Windows AIK tool for this, which we have already installed. Right Click on Deployment Tool Command Prompt (Start Menu –> All Programs –> Microsoft Windows AIK ), and run as Administrator.

We are going to use a tool, called Imagex to install operating system on our VHD. To begin with, lets find out the various edition of OS available in our Wim file. The command to list all the available editions of OS in the install.wim file is : imagex /info <path of wim file> as shown below8.CmdtoListAvailableOS Once I execute the above command, I get information about the Image Index, Product Name, OS Edition, etc. As part of our OS deployment scenario, I am going to use the image with index id 3.
8.ImagetoInstallIts time to execute the command to deploy OS into our VHD. The syntax of the command is:
imagex /apply <pathtoWimfile> <image index> <vhd drive name>. For example, the exact syntax, which I have used to load the image is:
imagex /apply c:\testdeploy\install.wim 3 z:\
9.OSDeployCmdOnce the Operating system is completely deployed, we will get the following screen:

With this, the installation of the Operating System is completed. In the next step, we are going to add this to the boot menu.

Adding VHD to Boot Menu

Since the deployment of the Operating System is completed on the VHD, its time to add it to the boot menu. I am going to add it to my boot menu; however, the default bootable OS will be Windows 7. Before adding the VHD to the boot menu, I am going to take a backup of my existing boot configuration. To do that, open a command prompt as an Administrator, and type the following command: bcdedit /export c:\bcdback1

Once the backup is completed, then we are going to copy the existing boot configuration and modify it to point to the VHD file.

Copy the GUID generated as shown in the above pic. You are going to use the same for the next two commands, which will map your VHD with the boot configuration as shown below:

With this, the VHD is added to the boot sequence. I am going to restart my laptop, to log on using Windows Server 2008 R2.


About Sudeepta Ganguly

A SQL Server User... Still Learning
This entry was posted in Deployment, Desktop Virtualization, How To and tagged , , . Bookmark the permalink.

One Response to Deployment of Windows Server 2008 R2 on a VHD using AIK

  1. First time here. Nice blog and super post. Well done.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s