How would I do a VHD install of Windows 8 from Windows 7

I've managed to do this with the help of this great technet article by Harold Wong. I should note that parts of the the process is probably substantially similar to r.tanner.f's answer, but there's some differences to either end of the process, and how we actually did it.

Prerequisites:

  • Windows 8 install disk I went with the enterprise evaluation disk
  • imagex (from WAIK - also contains bcdboot)
  • easybcd ,bcdboot (its in system32), visualbcd or some other bcd editor
  • current windows 7 install on the system, older boot managers don't do VHD boots

Preparing a VHD

You can create a vhd from disk manager - hit start, and search for disk management. Select Create and format hard disk partitions (or go to control panel -> computer management -> disk management) enter image description here

Creating a VHD is very simple, select action, and Create VHD

enter image description here

Set up VHD to taste, I've selected a large dynamic disk on the partition I usually store VM images on.

enter image description here

This should result in a new 'disk' you can use like any other disk. Rightclick on the disk name, and select initialise, then rightclick on the partition on the right side to format. Take note of the new drive latter - here its H:

enter image description here


Installation process

At this point, we pretty much can treat the VHD the very same way we'd treat a regular hard drive. You'll want to extract WAIK and the install ISOs to separate folders, or mount them. Take note of the path of install.wim on the windows 8 install cd - this is usually in \install\sources\ relative to the root of the windows 8 files

Copy imagex and (if you're using it bcdboot) to a convenient location. Start up a command prompt with admin privileges

enter image description here

Run imagex from where you saved it - imagex /apply /path/to/install.wim 1 h:\ where h: is the vhd's drive letter. This took me around 10 minutes

enter image description here

There's two options to make the image bootable, firstly, to run bcdboot from waik. I went with easybcd instead, since I didn't have bcdboot on hand. Select add new entry, and set things as follows in the windows not the vhd tab. We're treating the VHD like a normal disk.

enter image description here

Now reboot, and select windows 8 from the windows boot manager, and you should be set. You can just simply delete the VHD and the boot entry to undo the install.


Remus Rigo’s Blog has several posts about installing and booting from a VHD.

Edited:

  1. Prepeare the VHD file:
    • open run and enter start compmgmt.msc
    • go to Action -> Create VHD
    • choose between the fixed size (canot change size) and Dynamically expanded (file will grow as needed)
    • select browse and save the VHD file
  2. boot from Windows 8 media (dvd, usb)
  3. at the setup screen press Shift+F10 to bring the Command Prompt
  4. mount the vhd file

    diskpart
    > select vdisk file=x:\PathToFile\VhdFile.vhd
    > attach vdisk
    
  5. install Windows 8 to the vhd file/partition