Velocity Technical Archive
Install Windows 7 in one VHD file
Published 2009-09-30 • Blog, Windows7
Archived Reference: This is a historical technical article preserved from the Velocity Technologies knowledge base. For current Phoenix and East Valley managed IT services, explore our managed IT services or cybersecurity solutions.
This is a pretty straightforward process. \n
DISKPART Process
\n
\n\t- First thing you want to do is right click on command prompt and run as administrator.
\n\t- 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
\n\t- Next thing you want to do is select the vdisk by issuing the following command sel vdisk file=c:VMswindows7.vhd
\n\t- Next attach to the vdisk attach vdisk
\n\t- If you issue the list disk command it will show you your hard drive and the vhd you just created.
\n\t- Next sel disk 3 which will select your vdisk
\n\t- Then create part primary - create the primary partition
\n\t- select part 1 - Select the partition
\n\t- active - This makes the partition active
\n\t- format fs=ntfs quick - This command formats your disk ntfs quick
\n\t- assign - This command assigns the disk
\n\t- You can now exist diskpart
\n
\n
Boot to Windows 7 DVD
\n
\n\t- Now boot to your Windows 7 DVD.
\n\t- Once you're on the install now step push shift+f10 - this will open the command prompt
\n\t- Type the following commands below
\n\t- diskpart
\n\t- select vdisk file=d:virtualwin7.vhd
\n\t- attach vdisk
\n\t- Now do a custom install and select your mounted VHD file
\n
\n
Boot to OS
\n
\n\t- 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
\n\t- bcdedit /v
\n\t- Copy the identifier for the VHD file it is the long string of characters surrounded by the {XXX}
\n\t- Then issue this command to change the description in your boot loader
\n\t- bcdedit /set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} description "Windows 7 - VHD file"
\n\t- The last step if you would rather see the VHD install at the bottom of the boot loader issue this command
\n\t- bcdedit /displayorder {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} /addlast
\n
\n
Finished
\nCongratulations you have just installed Windows 7 to a VHD file.