Boot from vhd files with Windows 7

SneWs's picture

With Windows 7, you can use the bcdedit tool to boot into vhd files. This is really cool and useful if you, like me work as a Developer or if you are a IT professional responsible for testing new technology.

I usually run with VMware or VirtualBox, but sometimes, you need all the resources you can get from your machine, this is where booting vhd files is really handy, it's just like booting into another OS on the same machine, but without installing anything =)
To enable your machine to boot into vhd files, you need to make sure you are running Windows 7 Ultimate or Enterprise.
Then, you need to run 2 bcdedit commands and you are good to go.

bcdedit
We start with adding a new boot menu item, we simply copy our current entry and give it a new name.

bcdedit /copy {current} /d "Name of boot item"

This will return a {CLSID_Number}, make sure to have that number ready for your next command:

bcdedit /set {CLSID_Number} osdevice vhd=[C:]"\Some folder\MyVHDDisk.vhd"

If everything is executed as it should, you will get a message that confirms that the operation has completed successfully. NOTICE the search path and it's format, it's important that you escape the C: part with []
Of course, make sure to replace C: with the drive of your choice.

You are now able to reboot your machine and select between your main OS and the newly created vhd file.

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
© 2008 - 2017 Marcus Grenängen. Drupal theme by Kiwi Themes.