NATIVE BOOT A
DIFFERENCING VHD
FROM USB
INFORMATION
What is this?
This morning I got HyperVR2 native booting off a 8gig USB key but access was slow but it is fully working.
So I used a USB harddrive and decided to hack away at Windows 7 and see if I could get it working. Speed seems much more acceptable but I am still having issues.
Goal
Boot from a USB disk
Base Windows 7 install in a VHD
VHD Differencing disk for Windows 7 hal setup and customizations
Quick Howto
Format a USB portable hardrive inside an exisitng Windows 7 command prompt
Make a virtual harddrive for the standard Windows 7 install files on the usb drive
Make a virtual harddrive for all the changes Windows 7 does in a differencing disk on the usb drive
Make the harddive bootable in Windows 7
Set the default boot menu to the differencing disk
Setup an extra boot menu for the initial fixed vhd
Todo
I would like to set it up so that you can just add more differencing disks
for each diffrent computer that you want to boot from
and extra fixed vhd for other oses like x32 and 2k8r2 and hypervr2
I would also like to set it up so that it each os uses the root usb drive for the swap
Would like to make the base vhd to be read only.
VARIABLES
disk 9 substitute your usb drive number or internal hard disk by using command "list disk" WARNING:
The drive WILL be erased! {0952a4c0-c373-11de-9427-001638bf2439} Whatever guid it automatically makes for your 2nd boot entry,
The drive letters, mine were
N: and
O:
The vhd file names "
Windows 7-0.vhd" could be "source.vhd"
and "
Windows 7-1.vhd" could be "diff1.vhd" or whatever you want
and the imagex image # ...I am using
1 since I have enterprise ed
COMMANDS
Code:
C:\Windows\system32>diskpart
DISKPART>list disk
DISKPART>select disk 9
DISKPART>clean
DISKPART>create partition primary
DISKPART>select partition 1
DISKPART>active
DISKPART>format fs=NTFS quick label="ROOT DISK"
DISKPART>assign *** note the drive letter n: ***
DISKPART>exit
C:\Windows\system32>xcopy /e c:\support n: *** my support folder contains imagex folders used below ***
DISKPART>create vdisk file="n:\Windows 7-0.vhd" type=fixed maximum=5000
DISKPART>select vdisk file=n:\Windows 7-0.vhd
DISKPART>attach vdisk
DISKPART>clean
DISKPART>create partition primary
DISKPART>active
DISKPART>format quick label=Windows7
DISKPART>assign *** note the drive letter o: ***
DISKPART>exit
C:\Windows\system32>n:\support\ImageX_x64\imagex.exe /apply e:\sources\install.wim 1 o:
C:\Windows\system32>diskpart
DISKPART>select vdisk file=n:\Windows 7-0.vhd
DISKPART>detach vdisk
DISKPART>create vdisk file="c:\Windows 7-1.vhd" parent="n:\Windows 7-0.vhd"
DISKPART>attach vdisk
DISKPART>exit
C:\Windows\system32>bootsect /NT60 n:\ /FORCE /MBR ??? OUTDATED ???
C:\Windows\system32>bcdboot o:\windows /s n:\
DISKPART>select vdisk file=n:\Windows 7-1.vhd
DISKPART>detach vdisk
DISKPART>exit
C:\Windows\system32>bcdedit /store n:\boot\bcd /set {default} description "Windows 7 - differencing vhd"
C:\Windows\system32>bcdedit /store n:\boot\bcd /copy {default} /d "Windows 7 - source vhd"
C:\Windows\system32>bcdedit /store n:\boot\bcd /set {0952a4c0-c373-11de-9427-001638bf2439} device vhd=[N:]\Windows 7-0.vhd
C:\Windows\system32>bcdedit /store n:\boot\bcd /set {0952a4c0-c373-11de-9427-001638bf2439} osdevice vhd=[N:]\Windows 7-0.vhd
C:\Windows\system32>bcdedit /store n:\boot\bcd /enum YOU SHOULD SEE SOMETHING LIKE THIS
If you followed everything correctly
Quote:
Windows Boot Manager
--------------------
identifier {bootmgr}
device partition=N:
description Windows Boot Manager
locale en-us
inherit {globalsettings}
default {default}
resumeobject {739890c0-c372-11de-9427-001638bf2439}
displayorder {default}
{0952a4c0-c373-11de-9427-001638bf2439}
toolsdisplayorder {memdiag}
timeout 30
Windows Boot Loader
-------------------
identifier {default}
device vhd=[N:]\Windows 7-1.vhd
path \windows\system32\winload.exe
description Windows 7 - differencing vhd
locale en-us
inherit {bootloadersettings}
osdevice vhd=[N:]\Windows 7-1.vhd
systemroot \windows
resumeobject {739890c0-c372-11de-9427-001638bf2439}
nx OptIn
detecthal Yes
Windows Boot Loader
-------------------
identifier {0952a4c0-c373-11de-9427-001638bf2439}
device vhd=[N:]\Windows 7-0.vhd
path \windows\system32\winload.exe
description Windows 7 - source vhd
locale en-us
inherit {bootloadersettings}
osdevice vhd=[N:]\Windows 7-0.vhd
systemroot \windows
resumeobject {739890c0-c372-11de-9427-001638bf2439}
nx OptIn
detecthal Yes
Problems
Right now windows 7 blue screen reboots... anyone know why? is it the differencing disk? is it the swap file?
Also there is a 64bit /32bit problem... I am using 64bit but if I want to make 1 USB disk for both can I just use a 32bit Bootloader and menu to choose from either 32bit or 64bit vhds?
I will revise this post when I get it fully working but I am virtually there (HAHA pun intended)