This is a pretty straightforward process. \n

DISKPART Process

\n
    \n\t
  1. First thing you want to do is right click on command prompt and run as administrator.
  2. \n\t
  3. 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
  4. \n\t
  5. Next thing you want to do is select the vdisk by issuing the following command sel vdisk file=c:VMswindows7.vhd
  6. \n\t
  7. Next attach to the vdisk attach vdisk
  8. \n\t
  9. If you issue the list disk command it will show you your hard drive and the vhd you just created.
  10. \n\t
  11. Next sel disk 3 which will select your vdisk
  12. \n\t
  13. Then create part primary  - create the primary partition
  14. \n\t
  15. select part 1 - Select the partition
  16. \n\t
  17. active - This makes the partition active
  18. \n\t
  19. format fs=ntfs quick - This command formats your disk ntfs quick
  20. \n\t
  21. assign - This command assigns the disk
  22. \n\t
  23. You can now exist diskpart
  24. \n
\n

Boot to Windows 7 DVD

\n
    \n\t
  1. Now boot to your Windows 7 DVD.
  2. \n\t
  3. Once you're on the install now step push shift+f10 - this will open the command prompt
  4. \n\t
  5. Type the following commands below
  6. \n\t
  7. diskpart
  8. \n\t
  9. select vdisk file=d:virtualwin7.vhd
  10. \n\t
  11. attach vdisk
  12. \n\t
  13. Now do a custom install and select your mounted VHD file
  14. \n
\n

Boot to OS

\n
    \n\t
  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. \n\t
  3. bcdedit /v
  4. \n\t
  5. Copy the identifier for the VHD file it is the long string of characters surrounded by the {XXX}
  6. \n\t
  7. Then issue this command to change the description in your boot loader
  8. \n\t
  9. bcdedit /set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} description "Windows 7 - VHD file"
  10. \n\t
  11. The last step if you would rather see the VHD install at the bottom of the boot loader issue this command
  12. \n\t
  13. bcdedit /displayorder {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} /addlast
  14. \n
\n

 Finished

\nCongratulations you have just installed Windows 7 to a VHD file.