How to Install Windows 7 to VHD

Windows 7 can be installed onto a virtual hard disk (VHD) file to boot physical hardware. It's a new ability for OS.

Solution

Please try following steps:

  1. Boot from Windows 7.
  2. Select the language option, then click Next.
  3. Press Shift and F10 simultaneously to open a command prompt window at the "Install Now" screen, Here  you partition the disks and create your VHD file in this window.
  4. Use following commands to select the disk and wipe all of its existing content:

    diskpart
    list disk
    select disk 0
    clean

  5. Use following commands to create a 200 MB system partition. Normally the Windows 7 installation procedures create this partition automatically.

    create part primary size=200
    format fs=ntfs label="System" quick
    active
  6.  Use the rest of the space on the disk to create a partition. This partition will hold the VHD files.

    create part primary
    format fs=ntfs label="Boot" quick
    assign letter=C

  7. Create a VHD file on the C drive. Here create a 32 GB file that is an expandable disk for example. Also you can use "type=fixed" instead of "type=expandable" to create a fixed-size VHD. A fixed-size VHD will use space on the physical disk equal to its full size as soon as the VHD is created but will give better performance, so I recommend fixed-size disks for uses other than testing.

    create vdisk file=c:\win7ult.vhd maximum=32000 type=expandable
    select vdisk file=c:\win7ult.vhd
    attach vdisk
    create partition primary
    format fs=ntfs label="Win7Boot" quick


    set virtual disk
  8. Use following command to list your volumes.


    list vol


  9. Enter the "exit" twice to exit Diskpart and close the command prompt window.
  10. Proceed with the installation. Choose the VHD partition you just created when asked to select the installation target. A warning shows that you cannot install it on the partition will occur, simply ignore it.

    select the installation target
  11. Installation normally run now. When the installation is finished, you can see the VHD partition is now the C drive while the partition containing the VHD files is demoted down to the D drive. If  check the drives contents, you'll see D contains the VHD file and C, the content of the VHD, looks like a standard drive with a Windows installation. The 200 MB partition doesn't have a drive letter and is invisible to the OS.

    Install Windows 7 to VHD

Tips

See also

How to Create VHD (Virtual Hard Disk) in Windows 7

Windows 7 is a new-released OS. However, sometimes we don't want the new OS to make a lot of changes on the physical drive. And we also want to maintain and make a backup easily. During last ten years, we couldn't realize it. But now, we can do it with a VHD file.
Windows 7 includes the function of creating, mounting and booting from VHD images but there is only a few people seem to know how to use this functionality to boot VHDs at boot time.
My operating system is Windows XP and I use Microsoft Virtual PC as my virtual machine. I want to load the VHD (virtual disk image) file to my host system, how to Mount VHD to Windows XP?

Authors

Tagged Add my tag

Recent Searches