https://www.techtarget.com/searchvirtualdesktop/tip/How-to-build-a-native-boot-VHD-for-Windows-7-in-a-few-simple-steps
This is the third article in a series on virtual hard disks in Windows 7. Part one explores the benefits of the native-boot feature in Windows 7 and Windows Server 2008 R2, and part two provides in-depth steps for booting natively to a VHD.
The process for building a native-boot virtual hard disk for Windows 7 can be broken into the following three steps:
Only the Enterprise and Professional versions of Windows 7 support native VHD boot. You can build a bootable VHD image, boot into the VHD and successfully run setup with the Ultimate and Starter versions. However, when you go to log on, the following error will appear:
License Error
Booting from a vhd is not supported on this system.
As a result, logon will fail, and reinstallation will be required.
Furthermore, although only Windows Server 2008 R2 and Windows 7 are capable of a VHD boot, you can adapt Vista to boot from VHD by replacing the Vista Boot Manager with the Windows 7 one.
There are several ways to create a Windows image on a VHD:
While these methods work, the quickest and easiest way is to use an existing Windows 7 image.
Part 1:
Benefits of native-boot VHDs in Windows 7
Part
2: Unlocking the possibilities of native-boot VHD in Windows 7
The Windows 7 and Windows Server 2008R2 DVDs contain an Install.wim file in the \Sources directory, which is the Windows 7 image used during setup instead of all the files that setup used previously. This is stored on the DVD in \Sources\Install.WIM, and this image can be used to create others.
Of course, this is just the base install. If you want to build custom images with apps, etc., you will need to use something like the WAIK. In addition, Sysprep can be used to build virtual machine images.
Steps to a native-boot VHD
To simplify the method, the following example uses the Install.wim file from the Windows 7
DVD.
Create the VHD. In the disk management options, select Apply, then Create VHD (Figure 1).
Figure 1: Disk management options
Now use Imagex to apply the WIM file (Windows image) to the VHD. We previously copied Imagex.exe to the C:\VHD directory.
Use the command: Imagex /info c:/vhd/install.wim to dump the information (Figure 3). The Index value shows the version of Windows 7 -- the "1" here indicates this is the Enterprise edition.
BCDEdit shows a new entry with the Identifier = {Guid}. Note that this is similar -- but not the same -- as the GUIDs referenced in the other BCD entries (Figure 4).
Figure 4: Modify the boot menu with BCDEdit (click to enlarge)
Select the {GUID} string in the paste buffer with the mouse, then enter:
After the installation is complete, note that the VHD (drive H: during configuration) is now the C: drive, and the former drive C: is now drive D: (Figure 5).
Figure 5: VHD disk after boot (click to enlarge)
This makes sense because the boot drive should be C:. However, while the boot volume is switched to the VHD, the page file remains on the original C: drive (now drive D:). The page file stays on the physical partition.
In this example, my laptop can now to boot to Windows Ultimate (the base OS) and Windows Enterprise (the VHD). Of course, only disk space limits the number of VHDs I could create for multiboot scenarios. And since they are portable, I can move them from machine to machine.
The install.wim file that comes with Windows 7 or Windows 2008 R2 can easily be used to create a native VHD boot configuration. However, building custom WIM files allows multiple VHDs -- each with a different configuration -- to be stored on a single physical machine. As a result, the machine can be booted into different configurations. This provides an advantage over using virtual machines because it uses all the native drivers and allows testing in a physical environment.
ABOUT THE AUTHOR
Gary Olsen is a systems software engineer
at Hewlett-Packard in Global Solutions Engineering. He authored Windows 2000: Active Directory Design and Deployment and co-authored Windows Server 2003
on HP ProLiant Servers. Olsen is a Microsoft MVP for Directory Services and formerly for
Windows File Systems.
28 Jan 2010