Tuesday, December 7, 2010

Boot from VHD in Windows 7

A Virtual Hard Disk created in a VHD file in the hard disk will acts as a separate hard drive in the computer.
You can attach a VHD file to your computer and use the contents of the VHD as in a separate hard drive partition. And you can use the OS installed on the VHD as dual boot OS and make use of the maximum of your machine without creating a physical partition on the hard disk and installing an OS. Thus enjoying the benefits of the Windows 7 feature – Boot from VHD.
Let’s see how it can be done, it’s pretty simple.
Step 1: Attach a VHD
Open the Computer Management console by either right clicking on the Computer item on the Start Menu or typing compmgmt.msc in the Search box in the Start Menu and Enter.
From the left pane of the Computer Management console, select Disk Management and select the Attach VHD item on the Action menu.
Click the Browse button on the new window opened and select the VHD file.
That’s all; you now attached a VHD.
Step 2: Make the VHD Bootable
Open an Elevated Command prompt by typing cmd in the Start Menu search box area, then right click on cmd, and click on Run as administrator.
In the cmd window, go to the drive letter of the VHD attached and change drives to the \windows\system32 directory.
Type the following command and press Enter:
bcdboot w:\windows
(Note: Assuming that W is the drive letter of the newly created partition while attaching the VHD)
Execute the following command to make your current OS as your default boot OS:
bcdedit /default {current}

Tips:  If you created multiple boot, system like above, then you can see the boot control data (bcd) by executing the following command:
bcdedit /v
Also, if you want to make any of the OS as your default boot OS, which can be done by executing the following command:
bcdedit /default {identifier}
(Note: The identifier can be found by executing bcdedit /v command)
That’s all, now the your boot from VHD setup is ready, restart the system, then you can see the multi-boot menu loaded on the screen, now you have too many OS options to load.
Also, if you want to create a new VHD on your own, Microsoft Virtual PC can help you.

This feature is supported only by Windows 7 Ultimate and Enterprise versions only.

Also, if somebody wants to remove the Boot option created, can be done by executing msconfig utility.

1 comment:

  1. EasyBCD is a tool, ehich can be used to attach/detach a VHD for booting.

    http://neosmart.net/EasyBCD/

    ReplyDelete

Note: Only a member of this blog may post a comment.