VHD boot is a new feature of Windows 7 and can be used in very creative ways. If you have a need for Reimaging a machine (like a testing environment) back to its original configuration then booting from VHD seem to be a very easy way to do it.
In this post I will outline the quickest way to build a machine from scratch with a VHD without installing any native operating System.
- Boot the machine from the USB Drive into WinPE
- Format C: /q -- This is optional, but make sure you delete c:\bootmgr
- Copy Windows 7 VHD file to any location on the hard disk [In this case I copied it to C:\VHD\Win7.vhd]
- Copy Bootmgr from the USB disk – Very important step, only the windows 7 Bootmgr will allow boot from VHD
- Type the following commands in the WinPE command window
- DISKPART>SEL VDISK FILE="C:\VHD\Win7.vhd"
- DISKPART>ATTACH VDISK
- DISKPART>LIST VOL (This lists the drive letters and mappings, assuming F: maps to the VDISK)
- C:\>Bcdboot F:\Windows
Now the system is ready, just Reboot the system and this will take you straight into your VHD.
If you have multiple VHDs, then you can copy all of them to the hard disk and repeat Step 5 for each of the VHD, specifying the path and file name appropriately.