1. Boot from your retail copy
Windows 7 Ultimate or
Enterprise installation DVD/USB, and do
step 2 or 3 below for what you would like to do.
NOTE: To have Windows 8 on VHD, see instead: How to Create a Windows 8 VHD at Boot to Dual Boot with Windows 7 or Vista
2. When you are at the start of the Windows 7 installation screen, press the
Shift+F10 keys, and go to
step 4 below. (See screenshot below)
3. Boot into the
command prompt from the
Startup Recovery Options screen, and go to
step 4 below. (See screenshot below)
NOTE: You will use OPTION TWO at that link.
4. In the command prompt, type
diskpart and press
Enter. (See screenshot below)
5. In the elevated command prompt, type
list volume and press
Enter. Make note of the
drive letter for the volume that you want to create the VHD file on. (See screenshot below)
NOTE: This will allow you to see what the drive letters are for each volume. They are not always the same at boot as they are in Windows.
6. Do either
step 7 or
8 below for what type of VHD file you would like to create.
7. To Create a Fixed VHD File
NOTE: A fixed VHD file will allocate the entire maximum size (ex: 40GB) that you set below for the VHD file size.
A) In the command prompt, type the command below and press
Enter.
NOTE: Substitute the C drive letter in the command below for what volume (step 5) you would like to create the VHD on.
Code:
create vdisk file=C:\VHD-Windows7.vhd maximum=40960
NOTE: You can substitute the VHD-Windows7 name with any name you would like for the VHD file instead. You can also substitute the maximum size of 40960 MB for the VHD to the maximum size you want instead in MB (1GB = 1024MB).
B) Go to step 9.
8. To Create an Expandable VHD File
NOTE: An expandable VHD file will only be as large as the amount of data that is saved in the VHD file, but still can get as large as the maximium size (ex: 40GB) that you set below. For example, using this option, the VHD file showed only 7GB instead of the full 40GB. Even though the VHD file is expandable, you may need to install Windows Virtual PC to have a program associated with VHD files to actual see only the smaller size instead of the larger size for the VHD file.
A) In the command prompt, type the command below and press
Enter.
NOTE: Substitute the C drive letter in the command below for what volume (step 5) you would like to create the VHD on.
Code:
create vdisk file=C:\VHD-Windows7.vhd maximum=40960 type=expandable
NOTE: You can substitute the VHD-Windows7 name with any name you would like for the VHD file instead. You can also substitute the maximum size of 40960 MB for the VHD to the maximum size you want instead in MB (1GB = 1024MB).
9. In the command prompt, type the command below and press
Enter. (See screenshot below)
NOTE: If you subsituted the VHD-Windows7 name in step 7 or 8, then you will need to use it here as well. Substitute the C drive letter in the command below for what volume (step 5) you would like to create the VHD on.
Code:
select vdisk file=C:\VHD-Windows7.vhd
10. In the command prompt, type
attach vdisk and press
Enter. (See screenshot below)
11. In the command prompt, type
exit and press
Enter. (See screenshot below)
12. Close the command prompt window. (See screenshot above)
A) If you used step 2 above, then click on Next, and go to step 13 below.
B) If you used step 3 above, then continue on to step 14 below.
13. Close the
System Recovery Options window. (See screenshot below)
WARNING: You must close it only. Do not click on the Shut Down or Restart button.
14. Click on the
Install now button. (See screenshot below)
15. Check the
I accept the license terms box and click on
Next. (See screenshot below)
16. Click on the
Custom (advanced) option. (See screenshot below)
17. Select the available option with the unallocated space that is the same maximum VHD size (ex: 40GB = 40960MB) that you specified in step 7 or 8 above, and click on the
Next button. (See screenshot below)
NOTE: If you see the Windows cannot be installed to this disk warning, then you can ignore it. Windows 7 will still install on the VHD file.
18. Finish doing a
clean install of Windows 7.
NOTE: You will pick up at step 10 at that link to finish installing Windows 7 on the VHD file.
19. When you restart or start the computer, you will now have Windows 7 to select from at boot to start natively from the VHD file. (See the first example at top of the tutorial.)