Boot from VHD (Windows 8 Server Developer Preview)
Tuesday, December 27, 2011 at 04:53PM
Rob Sealock

Note: VHD has been previously created and OS installed onto it. (as per MSDN download)
Note: Using en_windows_server_developer_preview_with_hyper-v_virtual_machine_x64_735222 VHD for this but renamed to Windows8.vhd for Lab.

As the system had windows 7 (or 2008 r2) on it the system partition existed.
(dir/a will show the files if you mount the partition bellow.

Boot with Windows 7 DVD
Shift+F10 at welcome screen to open a CMD promt

Attach USB drive with VHD on it

From the CDM Prompt
diskpart
list vol

Make a note of what partitions (Volumes) are what
There should be a minimal of 4
C: (Boot) 100MB
D: (old system) XXXGB
E: DVD\CDROM
F: (USB) YYYGB

Select the previous install system partition (Vol 2 based on the list)

sel vol 2

Format to get rid of the previous install

format fs=ntfs quick
exit

copy vhd to formated vol

copy F:\*.VHD D:\

To update the boot partition (100MB Vol 1 or C: in this case) with the system files of the Windows 8 Server Dev VHD

diskpart
select vdisk file=C:\windows7.vhd
attach vdisk
list volume
select volume <volume_number_of_attached_VHD>
assign letter=v
exit

cd v:\windows\system32
bcdboot v:\windows /s C:

Now add VDH to the boot options

bcdedit /copy {default} /d [D:]\windows8.vhd
bcdedit /set {guid} device vhd=[D:]\windows8.vhd
bcdedit /set {guid} osdevice vhd=[D:]\windows8.vhd
bcdedit /default {guid}

Remove the old OS from the boot options

bcdedit
 copy {guid} of now deleted OS
bcdedit /delete {guid}

REBOOT

Article originally appeared on (Still) Heavy on the Technical (http://robsealock.squarespace.com/).
See website for complete article licensing information.