Painless setup of Windows 8 (or possibly other OS) on a bootable VHD

Disclaimer: Below I am simply outlining how I installed Windows 8 on a VHD and made the VHD bootable. If you want to try these instructions do so at your own risk. Messing with your boot loader and with preview software can cause serious damage to your PC. There is no warranty here.

I have recently installed the Windows 8 Developer Preview on my laptop using a VHD (Virtual Hard Disk). The most prominent guide to doing this is Scott Hanselman’s Guide to Installing and Booting Windows 8 Developer Preview off a VHD  but it is rather long and complex process and also requires that you have a external USB key with at least 10 GB of space which I didn’t have. Thinking that there must be an easier way I searched and found several alternatives but none are as easy as the one I ended up with.

The main difference between what other guides instruct you to do and what I ended up doing is that I installed Windows 8 on a virtual machine before using it as a native boot target. This means that you don’t have to have a USB key and you don’t have to make a bootable medium. You can also install Windows 8 in the background and keep working until it is ready.

Here is what you need:

1. Windows 8 ISO file

2. VirtualBox
VirtualBox is a great virtualization application like VMWare or Virtual PC. It is free and has a ton of features. If you already have VirtualBox make sure you have a version that supports VHD. I had to update mine.

Here is how you install Windows 8 on a bootable VHD.

1. Create a new virtual machine with VirtualBox using a VHD as the hard disk and install Windows 8.
I assume you know how to install a virtual machine using Virtual Box. It is all quite self explanatory. Put the VHD file on a local hard disk – external hard disks apparently don’t work as bootable VHD’s since they are initialized way later in the boot process. Also, you might have to turn off BitLocker encryption on your hard disk for it to work but since I don’t use BitLocker (I only have Windows 7 Home Premium on my laptop) I can’t verify this.
2. Close Virtual Box and save the machine state.
3. Attach the VHD file as a hard disk using the ‘Disk Management Utility’.
Go to Control Panel.
Search for Administrative Tools.
In the Administrative Tools start Computer Management.
Go to Storage\Disk Management.
Use the Attach VHD command in the Action menu.

Your VHD file should now be listed as a hard disk and should have a drive letter.

4. Add the Windows installation on the VHD to the boot menu.
I didn’t know how to do this but after a few false tries I stumbled upon this page and it turns out to be very easy:

Open a command prompt with elevated rights and navigate to the Windows\System32 folder of your existing Windows 7 installation (not the one of the mounted VHD!). Then use the following command:

bcdboot.exe H:\Windows

Where ‘H’ is the drive letter for your VHD.

The next time you restart you should see a new Windows 8 boot menu.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>