I have now done this multiple times and was recently requested to write a quick how to on my blog so here it is. Windows 7 and Windows Server 2008 R2 both support being booted and installed as a VHD (Virtual Hard Disk). Rather than being installed physically on the disk – the operating system is simply is stored as a VHD file on your hard drive.
**Please note you will need an existing normal installation of Windows 7 or Windows Server 2008 R2 on your computer for this to work!**
Follow the steps below to get up and running:
- Boot from the Windows 7 or Windows Server 2008 R2 DVD
- When the first installation dialog appears press SHIFT + F10 to open the command prompt
- Type ‘diskpart’ and hit ENTER
- When the diskpart prompt appears enter the following command – create vdisk file=c:\vdiskname.vhd type=fixed maximum=20000 (this will create a VHD that is 20 GB in size on your C: drive). Make sure you change ‘vdisknamne’ to whatever you want to the VHD to be called. You can also use type ‘expandable’ instead of fixed if you wish so that the VHD expands automatically.
- Next type select vdisk file=c:\vdiskname.vhd – where ‘vdiskname’ is the name of your VHD
- Finally type attach vdisk
- Exit from diskpart and the command prompt
- Continue with the installation – when it comes to selecting the partition on which to install the operating system select the newly created VHD partition. Ignore any warnings like ‘you cannot boot from this partition’ as it will boot fine.
- Success – once the installation is finished and you reboot your PC you will see a new option in your boot menu to boot from your new VHD.
Hope this helps :-)!