Unlocking the possibilities of native-boot VHD in Windows 7

Windows 2008 R2 and Windows 7 include native support for virtual hard disks, making it easier for administrators to use VHDs. Learn how to configure a native boot from those OSes.

This is part one of two on virtual hard disks in Windows 7.

One of the bright features of Windows 7that has a lot of potential is the functionality around virtual hard disks. These disks are not new to those who have worked with virtualization software and the format is supported in Microsoft's Virtual PC, Citrix's XenServer hypervisor, Sun Microsystems' xVM products and now Microsoft's Hyper-V hypervisor. VMware's ESX sever also supports VHD in addition to its own VMDK format.

A virtual hard disk (VHD) is made by software and has hard disk features. It has size and must be mounted and formatted; files can be copied to it, and operating systems can be installed on them and booted. VHDs can be expanded in size and mostly act like real disks. Applications such as Microsoft's System Center Virtual Machine Manager (SCVMM) can make a physical to virtual (P2V) disk --conversion. This makes it easy to reduce the footprint of physical machines in a data center. In addition, Windows Backup and Data Protection Manager (DPM) store data in VHDs.

In virtualization scenarios, VHDs contain client or server images with OS components, files, etc. in a single file (the VHD) that resides in the file structure on a host machine running the virtualization software. Many organizations simply back up the VHD file of a VM instead of creating an online backup. VHDs are portable and can be moved from machine to machine. Therefore, if a host system fails or needs to be shut down for maintenance, the VMs can be put on another host running the virtualization software, and the VMs can run from another host.

However, watch for Windows licensing issues if you do this. I'm not trying to give a sermon on virtualization: I just want to emphasize the versatility of VHDs.

Until recently, to create a VHD, specialized virtualization software had to be used. For instance, in Windows Server 2008, to store a machine in a VHD you needed to do the following:

  1. Have a Hyper-V-capable server with an AMD or Intel processor that supports virtualization.

  2. Install the Hyper-V role.

  3. Use Hyper-V manager to create a VHD.

  4. Install Windows in the VHD.

In addition, these applications needed to be used to open and perform operations on the contents of the VHD. You can still use your favorite image-creation software, Sysprep the image, and copy and deploy it for VM applications, but I see a greater benefit to native boot for physical machines from VHDs.

Window 7 and Windows 2008 R2 make the VHD more versatile by adding native support for VHDs. Now, administrators can create, open and modify a VHD, as well as install the OS to the VHD and boot from it. All of this is built into these versions of Windows.

Since VHDs are stored as single files on the physical disk, it is possible to create multiple boot scenarios. Multiboot configurations have been possible since Windows NT, but they required separate disk partitions. Although some VHD boot scenarios still require a separate partition, it is possible to store a number of boot partitions on a single disk, each with a different OS or configuration scenario, and be able to boot to the one you need. Note that Windows 2008 R2 and Windows 7 have a new boot-loader feature that enables booting from a VHD. Only these two OSes support VHD booting, but a couple of blogs have described how Vista was configured to do this by swapping the Windows 7 boot loader. In theory, other boot loaders like GRUB could work.

Native VHD booting consists of several steps.

  1. On a Windows 7 or Windows 2008 R2 computer, create a VHD of the proper size.

  2. Create and apply the Windows image to the VHD.

  3. Add VHD boot entry in the boot menu with BCDEdit.

  4. Choose the "Boot from VHD" option during machine boot.

Of course, the native-boot VHD can be used to create a sort of instant backup for physical servers, but it can also be used in conjunction with Windows Deployment Services (WDS) to deploy VHDs as VMs, just as you would with any virtualization software.

Native support for VHD and VHD boot has a lot of potential, especially for developers and testers, because it allows a single machine to boot to many different customized environments and actually use physical -- not virtual -- hardware components. It could have a big impact on change management and make testing easier than when it is done on both virtual and physical machines. In addition, it should provide a lot of new options to client upgrades and deployment and image recovery -- again being recognized as a native operating system component rather than needing an application to be used.

Now, all you need to do is migrate all your clients to Windows 7

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.

Dig Deeper on Virtual and remote desktop strategies

Enterprise Desktop
Cloud Computing