Windows 7 and Windows 2008 R2 have a really useful feature called “VHD Boot”. With that you can boot your entire Windows out of a Virtual Hard Disk file (as those used with Virtual PC or Virtual Server).
This VHD file is mounted as a virtual disk, you can use it as a normal hard disk drive, but all the data is stored in ONE file. The machine is booted physically (unlike with Virtual PC), so you can only run one at a time, but have the full machine’s power.
The advantages are magnificent:
- Simply copy one file (the .VHD file) and you’re entire system is included.
- Create incremental VHD files: One VHD file can be based on another one. So if you have different systems, create a base Win7 VHD and make all others incremental. This will save a lot of disk space!
There’re also some small disadvantages 🙂
- The .VHD booted OS needs to be Windows 7, Windows Server 2008 R2 or later.
- There’s a performance decrease of about 3%.
- Hibernate and some BitLocker scenarios don’t work
(BitLocker CAN be used within the guest VHD though, but not on the disk where the VHD resides). - Windows Experience index won’t work.
So how do you install a VHD-Boot machine?
- Boot the system with a setup DVD or USB stick.
- At the setup screen, don’t choose “Install Now”, but press “Shift-F10” to get into command line mode.
- Enter diskpart to start the partitioning utitlity.
- Create a new VHD file by entering
create vdisk file=”D:\pathToVhd.vhd” type=expandable maximum=maxsizeInMegabyte
For differencing VHDs you need to add an additional parameter parent=”D:\pathtoparent.vhd”.
attach vdisk
At next startup, you’ll see Windows 7 in the boot menu!
Optional: If you want to add a VHD manually to the boot menu, you just need to copy an existing entry and set some parameters:
bcdedit /copy {originalguid} /d “New Windows 7 Installation”
bcdedit /set {newguid} device vhd=[D:]\Image.vhd
bcdedit /set {newguid} osdevice vhd=[D:]\Image.vhd
bcdedit /set {newguid} detecthal on
Source : Microsoft.
For more information.
Microsoft Technet : Understanding virtual harddisks with native boot.
Microsoft Technet : Deploy a virtual hard disk for native boot
Microsoft Technet : Add a native boot virtual hard disk to the boot menu
Microsoft Virtualization Blog : Native VHD Support in Windows 7
Disclaimer.
The information in this article is provided “AS IS” with no warranties, and confers no rights. This article does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.