Create a VHD and add it to the Boot menu using bcdedit command


Let’s list the steps

  1. Create a VHD from Disk Management
  2. Or create a VHD from Command line using diskpart command
  3. Attach the VHD if you already have an existing VHD using Disk Management
  4. Or attach VHD using Command line
  5. Copy a BCD entry and edit it according to the new value
  • Create a VHD from Disk Managment

We can create the VHD from the Disk Management from computer management, see the following link

http://www.sevenforums.com/tutorials/566-virtual-hard-disk-create-attach-vhd.html

  • Or create VHD from Command line using diskpart command

[sourcecode language=”text”]
create vdisk file=”D:pathToVhd.vhd” type=expandable maximum=maxsizeInMegabyte
[/sourcecode]

For more information see the following link

Windows 7 – VHD Boot – Setup Guideline

  • Attach the VHD if you already have an existing VHD using Disk Management

You can see the first link

  • Or attach VHD using Command line

[sourcecode language=”text”]diskpart
select vdisk file=c:windows7.vhd
attach vdisk
list volume
select volume <volume_number_of_attached_VHD>
assign letter=v
exit[/sourcecode]

  • Copy a BCD entry and edit it according to the new value
First we will see the existing entries by command bcdedit, this will list all existing entries, then we will select the entry for the same windows for example I will select the entry of windows 7 and copy it and then change it’s value to the new value, remember that we used the GUID to do this

[sourcecode language=”text”]
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
[/sourcecode]

Fore more information about bcedit command see the following link
http://www.sevenforums.com/tutorials/2676-bcdedit-how-use.html

http://technet.microsoft.com/en-us/library/dd799299(v=ws.10).aspx

DiskPart help


Share This: