Install Windows 7 in one VHD file

This is a pretty straightforward process. 


  1. First thing you want to do is right click on command prompt and run as administrator.
  2. Once the command prompt is open type the following command create vdisk file=c:VMswindows7.vhd type=fixed maximum=25000  Once you type this command you will see a balloon that says Microsoft VHD HBA
  3. Next thing you want to do is select the vdisk by issuing the following command sel vdisk file=c:VMswindows7.vhd
  4. Next attach to the vdisk attach vdisk
  5. If you issue the list disk command it will show you your hard drive and the vhd you just created.
  6. Next sel disk 3 which will select your vdisk
  7. Then create part primary  – create the primary partition
  8. select part 1 – Select the partition
  9. active – This makes the partition active
  10. format fs=ntfs quick – This command formats your disk ntfs quick
  11. assign – This command assigns the disk
  12. You can now exist diskpart

Boot to Windows 7 DVD

  1. Now boot to your Windows 7 DVD.
  2. Once you’re on the install now step push shift+f10 – this will open the command prompt
  3. Type the following commands below
  4. diskpart
  5. select vdisk file=d:virtualwin7.vhd
  6. attach vdisk
  7. Now do a custom install and select your mounted VHD file

Boot to OS

  1. Now when you boot your PC you should see 2 windows7 options in the boot loader you can fix this by booting into either OS
  2. bcdedit /v
  3. Copy the identifier for the VHD file it is the long string of characters surrounded by the {XXX}
  4. Then issue this command to change the description in your boot loader
  5. bcdedit /set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} description “Windows 7 – VHD file”
  6. The last step if you would rather see the VHD install at the bottom of the boot loader issue this command
  7. bcdedit /displayorder {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} /addlast


Congratulations you have just installed Windows 7 to a VHD file.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply