Multi Boot into Windows 8 from VHD on Windows 7


Windows 8 is upon us, well at the time of writing Windows Developer Preview is available as a pre beta download.

I have written before on multi booting into VHD images in Windows 7 and so I wanted to see whether it is possible to multiboot into a Windows 8 VHD image from my Windows 7 desktop.

The short answer is no it doesn’t work, or at least not in the way I approached it. I need to read around a bit more, but I suspect I may need to be using the Windows 8 Boot Loader. It all seems to go well, except when I reboot and select the new Windows 8 multi boot menu item – when I do this it flips back into my default Windows 7 and runs the repair dialog. No harm is done, but the underlying error appears to be a failure to locate a boot loader.

Anyway, so as not to have wasted my time, below is what I tried to do :-(…all the below stuff works great for Windows 7 VHDs by the way 😉

For the purposes of this article, let’s first create a working folder at the root of C drive, called VHD.

Step 1: Download one of the Windows 8 ISO images

I chose to download Windows Developer Preview English, 64-bit (x64).

Step 2: Create an Empty VHD File

Before we can generate a VHD image of our chosen Windows 8 version we must first create an empty VHD file into which we can generate it.

To do this, open file explorer and right click on Computer and select Manage, which will open the computer management window.

On the left hand side, select in the treeview node called Disk Management (Computer Management (Local), Storage, Disk Management) and then right click on it and select Create VHD (see screenshot below):

screenshot 1 create vhd
This will open a dialog similar to the one below. In this case we are creating a VHD file called Win8x64.vhd in our working folder, C:\VHD\win8x64.vhd, to expand dynamically upto a maximum size of 50GB.
scheenshot 2 Create VHD

This will create a new disk within Disk Management that looks similar to the screenshot below:

screenshot VHD DIsk

First we must initialise the new Disk. To do this, right click on the caption area and select Initialize Disk.

screenshot 1 Initialize VHD
Now select the MBR (Master Boot Record) option and click OK.
screenshot 2 Initialize VHD

Next we create a simple volume within the initialsed disk. To do this, right click on the disk area to the right of the caption and select New Simple Volume (screenshot below):

screenshot 1 New Simple Volume

This will open a wizard for which you generally just click next until finished, however ensure you select a drive letter to mount the disk. I chose to mount the disk as drive V (V:\). Screenshots of the wizard are shown below:

screenshot 2 New Simple Volume

screenshot 3 New Simple Volume

screenshot 4 New Simple Volume

screenshot 5 New Simple Volume

screenshot 6 New Simple Volume

Step 3: Create a Windows 8 VHD Image

Now we can generate the a VHD image of our chosen version of Windows 8 into the VHD.

To do this you will need two files:

  • imagex.exe
  • install.wim

imagex.exe

This file (imagex.exe) is part of the Windows® Automated Installation Kit (AIK) for Windows® 7, or WAIK for short.

This is a very large download (about 1.7GB) and we literally only want the one file out of it. Once installed search for this file (imagex.exe) and copy it to our working folder, C:\VHD\imagex.exe

install.wim

This file is within the ISO of the Windows 8 installation disk we downloaded in step 1. Mount the ISO image (or cut it to a DVD), search for this file (install.wim) which is under \\sources folder and copy it to our working folder, C:\VHD\install.wim.

Now open a command window (ensure it is run as Administrator), change directory to our working folder, C:\VHD and run the follow command:

imagex /info install.wim

This should produce an output similar to the following:

Available Image Choices:
————————
<WIM>
<TOTALBYTES>3272285556</TOTALBYTES>
<IMAGE INDEX=”1″>
<DIRCOUNT>15078</DIRCOUNT>
<FILECOUNT>71371</FILECOUNT>
<TOTALBYTES>12756775435</TOTALBYTES>
<HARDLINKBYTES>4870029526</HARDLINKBYTES>
<CREATIONTIME>
<HIGHPART>0x01CC6772</HIGHPART>
<LOWPART>0x7E5E349C</LOWPART>
</CREATIONTIME>
<LASTMODIFICATIONTIME>
<HIGHPART>0x01CC6847</HIGHPART>
<LOWPART>0x7D8CCFEE</LOWPART>
</LASTMODIFICATIONTIME>
<WINDOWS>
<ARCH>9</ARCH>
<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
<EDITIONID>Prerelease</EDITIONID>
<INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
<SERVICINGDATA>
<PKEYCONFIGVERSION>6.2.8102.0;2011-08-23T22:28:58Z</PKEYCONFIGVERSION>
</SERVICINGDATA>
<HAL>acpiapic</HAL>
<PRODUCTTYPE>WinNT</PRODUCTTYPE>
<PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
<LANGUAGES>
<LANGUAGE>en-US</LANGUAGE>
<DEFAULT>en-US</DEFAULT>
</LANGUAGES>
<VERSION>
<MAJOR>6</MAJOR>
<MINOR>2</MINOR>
<BUILD>8102</BUILD>
<SPBUILD>0</SPBUILD>
<SPLEVEL>0</SPLEVEL>
</VERSION>
<SYSTEMROOT>WINDOWS</SYSTEMROOT>
</WINDOWS>
<NAME>Windows DEVELOPERPREVIEW</NAME>
<DESCRIPTION>Windows DEVELOPERPREVIEW</DESCRIPTION>
<FLAGS>PreRelease</FLAGS>
<DISPLAYNAME>Windows Developer Preview</DISPLAYNAME>
<DISPLAYDESCRIPTION>Windows Developer Preview</DISPLAYDESCRIPTION>
</IMAGE>
</WIM>

We want to know the index of the OS version we are trying to create a VHD of. In the above example we want to create a VHD of Windows DEVELOPERPREVIEW, which is index 1.

Now run the following command:

imagex /apply install.wim 1 V:\

where in the example above, 1 is the index of the chosen Windows 8 version and V:\ is the previously mounted VHD Disk.

This operation will take some time. On my machine this was about 6 minutes, but once finished we now have a bootable VHD image of Windows 8. You will see an output similar to below:

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

[ 100% ] Applying progress

Successfully applied image.

Total elapsed time: 5 min 49 sec

Step 4: Create Multi Boot Option for Windows 8 VHD Image

Firstly run the following command:

bcdedit /copy {current} /d “Windows 8 Developer Preview”

The part above called “Windows 8 Developer Preview” can be anything you want. This is the text that will appear in your multi boot menu when you boot up your PC.

This will give an output similar to the one below:

The entry was successfully copied to {281d3e08-e237-11e0-a65a-69bf4724019b}.

This has just cloned the details of the OS you are currently running into the multi boot loader. Now we must edit the pertinent parts to make it use and be relevent to the new Windows 8 VHD.

Next run a command similar to this (edited appropriately for your environment):

bcdedit /set {CLSID_Number} device vhd=[C:]\VHD\disk1.vhd

The CLSID_Number is the one we were given in response to the previous command and the disk1.vhd will be the VHD file we created earlier. Take care to include all the characters, including curly braces and square brackets. On my machine I would have entered the following:

bcdedit /set {281d3e08-e237-11e0-a65a-69bf4724019b} device vhd=[C:]\VHD\win8x64.vhd

Next run another command similar to this (edited appropriately for you environment):

bcdedit /set {CLSID_Number} osdevice vhd=[C:]\VHD\disk1.vhd

Again, replacing the CLSID_Number and disk1.vhd parts. On my machine this would have been:

bcdedit /set {281d3e08-e237-11e0-a65a-69bf4724019b} osdevice vhd=[C:]\VHD\win8x64.vhd

Step 5: ReBoot Into Windows 8 VHD Image

You have now completed all the necessary steps to create a multi boot Windows 8 VHD.

All you need to do now is reboot your PC and select the new entry from the multiboot menu on startup.

When you first select the multi boot entry you will go through the usual Windows setup process. Once you have done this once you can simply copy the VHD file, and rename it and attach it along side the other one using step 4 above to avoid having to do the setup stage again and again.

As a tip I create one VHD, get it set up for my machine, then put a copy of it to one side to revert back to when I want a clean, new version again.

Optional Step

If you wish to get rid of the entry in the multi boot then simply run the following command:

bcdedit /delete {CLSID_Number}

Don’t forget to replace the CLSID_NUmber part, and if you cannot remember what it is then run this command first to find out what all the multi boot entries are:

bcdedit

Summary

I hope you find this useful. I find booting from VHDs a great experience and I hope you do too.

Advertisements

One Response to Multi Boot into Windows 8 from VHD on Windows 7

  1. Good article. I’m experiencing some of these issues as well..

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: