Skip to main content
Joe's Blog

Joe's Blog

Go Search
  

Categories
There are no items in this list.
Joe's Blog > Posts > Windows 7.0 Boot to VHD Feature
Windows 7.0 Boot to VHD Feature
With Windows 7.0 there is a new capability to Boot to a Virtual Machine VHD file.  This is not running a virtual machine in Virtual PC or Hyper-V, rather it is running it with full hardware fidelity.  The positives of this approach are running the virtual machine as a multi-boot system without having to separate partitions and install directly on the hardware, while maintaining an Xcopy deployment system.  It works with differing disks, so a system of many differing types of installations off of a common base is possible.  You do lose the Virtual PC Undo or Hyper-V Snapshot capability; however, Xcopy of differing disks versions creates an easy rollback capability.  Another thing to note is that this approach does an automatic install of drivers, since it is natively running on the hardware.  When copying vhds from one system to another, initial startup will always launch a mini-setup.  This is just like a sysprepped image being deployed and you prepare your VHD with SysPrep before booting it.  I’ve limited my VHDs to Windows 7.0 and Windows Server 2008 R2 and haven’t found any issue with this mini setup so far.
 
Once you have the vhd, here are the commands I use to set a “Boot From VHD” scenario.  Run line 1 to get the CLSID and then do find/replace in the other three commands.  I just copy them from notepad into a cmd window (run as administrator).  You, of course, could capture the CLSID into a variable and completely automate it in script with parameters.  Execute these commands and you have a new boot option when restarting.
 
bcdedit /copy {current} /d “Boot_From_WhateverVHD
 
REM Copy the CSLID that is displayed and then run
 
bcdedit /set {CLSID} device vhd=[C:]\vhdname.vhd
bcdedit /set {CLSID} osdevice vhd=[C:]\vhdname.vhd
bcdedit /set {CLSID} detecthal on
 
Supposedly there is a 1-2% overhead running from a vhd as opposed to the native file system.  Whatever this overhead is, it’s imperceptible to me.  Despite the drawbacks of no rollback and driver installs, I find this the best method to run the majority of my new Windows 7/Windows Server 2008 R2 VHDs. 

Comments

There are no comments yet for this post.