You can install Windows 7 and above on hard disk or on virtual hard disk (VHD). In the last case you need to create a VHD file on hard disk and install Windows inside that VHD file. The boot loader is placed outside the VHD automatically during the installation process.
During Windows installation you will see a prompt to select a type of installation: upgrade or custom.
Press Shift + F10. The Command Prompt will appear. Type the following commands:
1 2 3 4 |
diskpart create vdisk file=C:\win7.vhd maximum=102400 type=fixed select vdisk file=C:\win7.vhd attach vdisk |
The size of the VHD will be 100Gb.
After that select the Custom option to make a clean installation of Windows.
Important! The type of VHD must be fixed because I’ve encountered problems to install Windows from DVD or USB flash on expandable disk. But when you install Windows inside Hyper-V virtual machine, you won’t have any problem with expandable VHD.