Please have in mind that you can only boot from vhd files on the Ultimate and Enterprise editions of Windows 7. The instructions bellow work on all editions but you will be only able to logon if you are running Ultimate or Enterprise due to licensing issues.
- Boot from the Windows 7 dvd and select “repair your computer”.
- Select “use recovery tools”
- Select “command prompt”
x:\sources> diskpart
diskpart> create vdisk file="c:\images\win7.vhd" maximum=64000
diskpart>select vdisk file="c:\images\win7.vhd"
diskpart>attach vdisk
diskpart>exit
x:\sources>setup
Good luck!
also read: http://blogs.msdn.com/knom/archive/2009/04/07/windows-7-vhd-boot-setup-guideline.aspx