Boot Windows 7 from VHD without installing a native OS

I’d already started to install Windows 7 as a “host OS” on an old machine simply to be able to use boot from VHD to fire up an existing (VHD based) Windows 7 installation when I stopped myself with the thought “surely you don’t need to install a whole OS just to be able to use boot from VHD”.

I was right. And let me tell you it’s not often that happens.

There’s a bit of work involved – there’s a bit of command-line stuff in there to get the boot medium sorted out – but essentially it’s pretty straightforward.

  • You need a bootable Windows PE Media – for me, creating this was the fiddly bit
  • You need a “native boot” Windows 7 VHD file (I already had one but see below)
  • You need to follow some instructions

Step 1 - Create a bootable Windows PE CD / DVD

To create the bootable Windows PE Media you can follow the instructions here. I already had the Windows Automated Installation Kit (Windows AIK) from creating my earlier Windows 7 native-boot VHD. You can download the Windows® AIK for Windows® 7 from the Microsoft Download Center.

Using various tools from the AIK, the instructions help you create a bootable CD/DVD with the Windows Preinstallation Environment (WinPE) installed. This is a lightweight version of the OS that will allow you to set up the boot environment and configuration to boot from your VHD file.

Step 2 – Create a “native boot” Windows 7 VHD file (if necessary)

If you don’t have a native-boot VHD file, you can start at Step 1 in the Walkthrough: Deploy a Virtual Hard Disk for Native Boot. Steps 1 and 2 help you create the VHD - this requires a Windows 7 image (.wim) file. Alternatively, check out my previous posts here and here for other, simpler options. I had a SysPrep’d image created from the techniques outlined in the first of those links.

Step 3 – Deploy the VHD and enable for boot

Follow from Step 3 onwards in Walkthrough: Deploy a Virtual Hard Disk for Native Boot to prepare the target machine, deploy the VHD and enable for boot. This essentially consists of cleaning the target machine and partitioning the disk, copying the VHD (I copied mine from an external USB drive and was pleasantly surprised this was detected without issue) and using BCDboot to create the necessary configuration.

You’re done.

One nice option this gives me is to create multiple differencing disks based off the same parent and enable each of them for boot. Or perhaps have a single parent with a differencing disk for native boot and another for Virtual PC. In my case, it was just an easy way to boot an existing Windows 7 VHD on a different machine. And the reason I wanted to do that? I don’t have an external monitor at the moment but sometimes really need that capability. Running a 2nd machine is a temporary solution. All I have to do now is buy a monitor and I can retire it again…

Technorati Tags: windows 7,virtualisation,virtualization,vhd,boot