The VHD file

A short but nice tip: VHD files are virtual harddrives used most commonly in hyper-v, but you can mount them natively in Win7 and later and you can also boot from them. This provides a very easy to implement a dual-boot configuration for testing purposes.

1. Boot up your Windows 7 media
2. After you’ve chosen your language/keyboard settings, press shift+F10 which opens a command prompt
3. Locate your internal harddrive (D: in this example)
4. Type diskpart and press Enter
5. Type create vdisk file=”d:\vhd\win7.vhd” type=fixed maximum=40960 and press enter. This will create a fixed size vhd file of 40GB located on the d:\vhd folder (which you must create beforehard). If you want to, you can use a dynamically expandable file by replacing “fixed” with “expandable”.
6. Type select vdisk file=”d:\vhd\win7.vhd” and press Enter
7. Type attach vdisk and press Enter
8. Type exit and press Enter to exit diskpart and once again to exit the commandprompt. Continue the Windows installation.
9. When you come to the select partition screen you should see a disk drive representing the vhd file, and you can choose that as the installation target. The warning message can be ignored.
10. Windows will automatically create the boot-menu entries with the new installation as the default choice.

Unlike running this in a virtual machine, installing windows in a vhd and booting from it gives it direct control of the hardware. So a Windows Server 2008 R2 installed like this is able to run Hyper-V just fine. You do however lose other abilities like bitlocker encryption and hibernate.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s