Earlier I made a post on how to create and configure a VHD along with explaining exactly what a VHD was. This is a continuation of that article.
Another great feature of Windows 7 is the ability to actually install Windows 7 to a VHD, virtualization without any of the disadvantages of virtualization (full hardware support and so forth). This guide is about how to use the RTM (should work with the RC) DVD to install Windows 7 to a VHD created during installation (or you can use one created during my earlier guide).
I also mentioned the power of this ability earlier, as I listed a possible scenario:
Windows 7′s VHD support will give users the ability to install any operating system that supports booting from a VHD into a VHD. For example, a user could have Vista installed on a single partition, and then have three files (VHDs) anywhere on that disk (or for that matter, on any partition that is readable by Windows) and be able to boot different versions of Windows 7. Assuming that SP1 and SP2 were released (which they are not yet available), a user could hypothetically have four operating systems on a single partition (the number is only limited by the bootloader, four is actually just a random number selected), like so:
- Vista installed on a primary partition (such as “C:\”).
- Windows 7 RTM installed within a VHD (such as “C:\Windows7.vhd”).
- Windows 7 SP1 installed within another VHD (such as “C:\Windows7SP1.vhd”).
- Windows 7 SP2 installed within yet another VHD (such as “C:\Windows7SP2.vhd”).
Of course, the number of VHDs is virtually unlimited, but it’s quite easy to see the hype associated with VHDs in Windows 7.
Now, how would a user get about to actually performing an install of Windows 7 to a VHD?
Take note that this guide will also work with Windows Server 2008 R2.
- Boot from the Windows 7 DVD.
- Click past the Language Selection screen.
- When you’re on the Install Now screen (with the “Install Now” button), stop. Click “SHIFT+F10″ to launch the Command Prompt (don’t bother going through Repair and all that – this is the right way).
- First, let’s take a look at the drive letters currently mounted. Type in “fsutil fsinfo drives” and hit enter. This will list all drives (you should know what your drive letters are). Take note of all drive letters.
- Now,we need to open “DISKPART.” To do, simply type in “diskpart” and click enter. Pretty easy.
- When “DISKPART> ” appears, DISKPART is loaded.
- If you want to just use an existing VHD (such as one created in the method I wrote about earlier), then use these two commands (of course C can be swapped out with any drive letter, but either way, you will need to specify the exact path):
select vdisk file=C:\path\to\vhd\file.vhd
attach vdiskIf you are using an existing VHD, skip to the next step; otherwise, if you would prefer to simply create a new VHD, then use this format of commands (the max option specifies the file size, here I have roughly 6GB, increase as preferred):
create vdisk file = c:\path\to\vhd\file.vhd max=6000
select vdisk file = c:\path\to\vhd\file.vhd
attach vdisk
exit - Now run “fsutil fsinfo drives” again. A new drive letter should have appeared, this is your new VHD. Take note of the drive letter (this isn’t necessary – just making sure everything went OK).
- Type “exit” again and hit enter. This will close the Command Prompt.
- Click “Install Now” and go through the install as usual, making sure to select the “Custom” option when it appears.
- When you come to the list of partitions and you are asked to choose an install location, ignore any warnings and select the partition that matches the size that you used for your VHD.
- Windows 7 will automatically configure your boot loader for the VHD, but this is easily fixed. Just continue as normal, and when the installation completes and it prepares to reboot, it will show you the bootloader (should have two “Windows 7″ options if you already had a Windows 7 install, this is normal). Select either OS and continue (just make sure that it’s a Windows 7).
- Now, if you are fine with the way the bootloader appears, you can quit now. Otherwise, you can follow this guide and use the bcdedit command-line tool (really easy, only three commands) or download EasyBCD and use that to do this yourself. However, I suggest using bcdedit and making your bootloader a little more clear (Again, you can opt for EasyBCD if you prefer a graphical menu). open the Command Prompt as an Administrator (right click and select “Run As Administrator”).
- Type in “bcdedit /v” and hit enter. This will display a list of entries in the Windows 7 bootloader.
- Determine the VHD install and copy the GUID (listed as identifier) and create a new command like the following (replacing GUID with your identifer (should be a really long set of numbers with hyphens – include all of it)):
Take note that you can edit the description as you wish. This is what will appear in the bootloader.
bcdedit /set {GUID} description “Windows 7 (VHD)”
- If you want your VHD install to appear last (or second) in the bootloader, then execute this (again, replacing GUID):
bcdedit /displayorder {GUID} /addlast
Now, enjoy your new Windows 7 install.
Feel free to leave a comment or ask questions in the comments.


