B2VHD Assistant

Warning
This blog post is included for archival purposes and may contain outdated information. While it provides historical insights, we strongly recommend that you double-check the details before relying on any of the information outlined here.

Motivation

With Windows 7 Ultimate and Windows Server 2008 R2 comes a new feature called “Boot to VHD” (I have referred to this feature as Boot2VHD in the past). As the name implies, this feature allows your computer to use a VHD as if it was a another boot partition. If you want to know more about this feature, I’d recommend reading this post by Scott Hanselman.

In order to enable booting from a VHD, you need to use BCDedit to create a boot entry and point to the VHD file. This process is trivial, but there’s always room for human error. That’s why we created a utility that acts as a wrapper around BCDEdit.

The “B2VHD Assistant” allows you:

  • Create a VHD entry from an existing VHD
  • Create a differencing disk from an existing VHD and create a boot entry from the differencing disk (great for labs that cannot be virtualized)

We tried to keep the interface simple and easy to use:

Boot2VHD Assistant

The Main Inteface of the Boot2VHD Assitant

Sample Usage Scenario:

  1. Enter a name for the boot partition under Entry Name
  2. Click on the ellipsis on VHD Path and select a VHD to boot from
  3. A suggested name will be displayed (greyed out) under Diff Disk Path. At this point, a differencing disk will not be created unless you…
  4. Click the Create Differencing Disk checkbox.
  5. Select the options you need from the Boot Options pane (default will most likely work for everyone)
  6. Click the Create Entry button.

At that point the differencing disk will be created on the same path where the parent VHD is located. The application will then open msconfig.exe so you can verify the boot entry.

The application has NOT been thoroughly tested. It was created for a project I worked on and thought someone might find it useful. That being said, if you decided to use it, it’s at your own risk. The source code will be available on CodePlex once I clean it up a bit.

Some random pointers:
  • The booted VHD will expand to it’s maximum size. This means that if you use a VHD whose max size is 127 GB, you will need that amount of free hard drive space or the machine will blue screen when the VHD is booting up.
  • The differencing disk needs to always be in the same folder as the parent.
Version History
  • 1.091129
    • Initial Release
  • 1.091210
    • Fixed issue with differencing disk automatic naming feature
    • Fixed bug preventing differencing disks to be created
    • Correct version shows up in “Programs and Features”
    • Correct name shows up in “Programs and Features”
Download Link:

About Author

Christian Saborio

Christian is a seasoned computer engineer with a rich career spanning collaborations with industry leaders such as Artinsoft (now Mobilize.net), Microsoft, HP, and Intel. As a technical evangelist and trainer, Christian honed his expertise in Costa Rica and Seattle, delivering impactful solutions and sharing his knowledge.

Now based in Sydney, Australia, Christian channels his passion into web development, leading a talented team to tackle diverse projects with innovation and precision. His commitment to crafting exceptional digital experiences reflects his deep-rooted enthusiasm for technology and problem-solving.

Comments

  1. How to Boot from a VHD in Windows Server 2012 / Windows 8 | ScorpioTek's Blog says:

    […] Hyper-V to boot physical machines.  We tried using the utility we authored back on the day, the B2VHD Assistant, but after rebooting the machine it would go into what seemed to be a repair […]

  2. Mike says:

    I made a win 7 vhd in hyper v. i am trying to boot. When i see the windows logo i get a quick BSOD flash and then it goes into a bootloop. My HD isn’t excessively large so thats not it. And the vhd boots fine in hyper v. any suggestions?

    • csaborio says:

      Hi Mike,

      Did you sysprep the WIn7 VHD in Hyper-V? If you did not, it’s going to blue screen on you since it’s different hardware, even if it’s virtual. Hope this helps!

  3. Winning the “Boot from VHD” battle on Windows 7 + some useful utilities | Pozitive.NeT says:

    […] indeed they have. ScorpioTek Solutions have created B2VHD Assistant which negates the need to worry about bcdedit and diskpart and instead simply fill in a GUI […]

  4. Winning the “Boot from VHD” battle on Windows 7 + some useful utilities - IUpdateable from Eric Nelson - Site Home - MSDN Blogs says:

    […] indeed they have. ScorpioTek Solutions have created B2VHD Assistant which negates the need to worry about bcdedit and diskpart and instead simply fill in a GUI […]

  5. Expanding a Dynamic VHD for use with Boot From VHD | ScorpioTek's Blog says:

    […] lab administrators configure the machines to Boot from the VHD, which can be very trivial using B2VHD Utility we wrote a while […]

  6. Nicolò Carandini says:

    Why “The booted VHD will expand to it’s maximum size” ?
    I’ve never used this feature yet, so maybe I’m wrong, but it seems to me that if the VHD is created as expandable, using BCDEdit manually as showed on Scott Hanselman’s post doesn’t expand it to his maximum size:

    […]Below I’d just attached a 7 GIG VHD file that thinks it’s a 40 gig hard drive[…]

    So why B2VHD Assistant produce such ecffect?

    • csaborio says:

      Hi Nicolò:

      Thanks for the comment. B2VHD assistant is simply a wrapper around BCDEdit. That being said, the default behavior for the VHD when booting off from it is to expand to its max size. What Scott mentions in that quoted text is what happens when you mount a VHD using Disk Management, not when you boot from it.

      The following document contains info on the registry hack you can carry out so that the disk will not expand at once when booted (BTW, I found this info from the Thrive Live event, highly recommended)

      http://blogs.technet.com/michw/attachment/3270048.ashx

      Be warned that this is not recommended at all and you may end up killing the VHD if it runs out of space when dynamically expanding.

      Hope this helps!

  7. Corrado Cavalli says:

    That’s great!, what about an option to enumerate and delete existing VHD entries?

    • csaborio says:

      Thanks Corrado! The VHD listing enumeration idea sounds pretty good, I’ll see if I can create it during the holidays – will keep you posted!

Comments are closed

Thank you for your interest. Please fill out this form to provide us with your contact information. We'll get back to you as soon as possible.