Install win7 to SD card or USB device
#USB format ntfs by install win7
diskpart
list disk
select disk 2 (your USB drive)
clean
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS UNIT=4096 quick
assign
exit
#create VHD in USB
diskpart
list volume
create vdisk file=F:VHD-Windows7.vhd maximum=40960
select vdisk file=F:VHD-Windows7.vhd
attach vdisk
exit
if it can not install win7, please go to BIO set boot harddisk, it will install boot loader in first harddisk. you can copy or rebuild boot loader in USB device.
Go to install win7
#after install win7, you can see win7 booting icon but it can not goto system.
recovery mode or boot install win7 CD -> open command promt
REG LOAD HKLMTEMP R:WINDOWSSYSTEM32CONFIGSYSTEM
REG ADD HKLMTEMPControlSet001servicesFsDependsParameters /v VirtualDiskExpandOnMount /t REG_DWORD /d 4 /f
REG ADD HKLMTEMPControlSet001Control /v BootDriverFlags /t REG_DWORD /d 4 /f
REG ADD HKLMTEMPControlSet001ControlPnP /v PollBootPartitionTimeout /t REG_DWORD /d 30000 /f
REG UNLOAD HKLMTEMP
Reference:
http://www.sevenforums.com/tutorials/2953-virtual-hard-drive-vhd-file-create-start-boot.html
http://yongyu2000.blog.51cto.com/962342/224377