The world of Marc O'Polo – Blog

About Windows Server, Terminal Server, Virtualization and more
  • rss
  • Home
  • Links
  • Tools
  • Archive
  • About

Booting from a VHD disk

M.Pol | October 12, 2009

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?

  1. Boot the system with a setup DVD or USB stick.
  2. At the setup screen, don’t choose “Install Now”, but press “Shift-F10” to get into command line mode.
    2 
  3. Enter diskpart to start the partitioning utitlity.
    image
  4. 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”.
image

  • Now select the new VHD and attach it as a physical disk.select vdisk file=”D:\pathToVhd.vhd”
    attach vdisk

    image
  • After that switch back to the setup window (e.g. using ALT+TAB) and start the setup.
    2
  • Proceed the normal setup, but make sure you install to the correct disk (normally the last one), ignore the “Windows cannot install to this disk” warning!!
  • 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

    Related articles:

    • Customize the Start Menu Options in Windows 7
    • Creating Bootable Vista / Windows 7 USB Flash Drive
    • Configure a User Account to Log On Automatically on 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.

    Categories
    Windows 2008 R2, Windows 7
    Tags
    Boot, VHD, Windows 2008 R2, Windows 7
    Comments rss
    Comments rss
    Trackback
    Trackback

    Keynotes Technet Live online »

    Leave a Reply

    Click here to cancel reply.

    Recent Posts

    • Upgrade paths for ESX/ESXi hosts
    • HP MSA2324SA Firmware update loop
    • Exchange 2010 SP1 FAQ and Known Issues
    • Microsoft Exchange 2010 Service Pack 1 released
    • VMware vSphere 4.1 Released

    Categories

    Tags

    Boot ESX ESXi Exchange 2010 Firmware HP Hyper-V IPv6 Juniper Microsoft MMS2010 MSA Sharepoint Technet USB vCenter VCP VHD VMware vSphere Windows 7 Windows 2003 SBS Windows 2008 Windows 2008 R2 Windows 2008 SBS Windows Vista XBox

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

    Twitter Updates

    Marco Pol
    • I want this.. vCenter Client for the iPad http://bit.ly/bZM4sn 10:20:48 PM September 01, 2010 from TweetDeck
    • Dynamic Desktop Wallpapers from RSS Feeds.. http://bit.ly/aUuOpR Cool... 06:00:01 PM August 31, 2010 from TweetDeck
    • http://twitpic.com/2irsik - Goede band op voorstaat #visserijdagen wel een beetje regen. Sfeer goed! 11:27:12 PM August 27, 2010 from Gravity
    • In harlingen #visserijdagen hopen dat het droog blijft 06:55:41 PM August 27, 2010 from Gravity
    • http://twitpic.com/2il9nj - Just recieved in my mailbox. Thanks @trainsignal ! 10:17:58 AM August 27, 2010 from Gravity

    Disclaimer

    The information in this weblog is provided “AS IS” with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
    Copyright 2009 - 2010 M.Pol