Have you just assembled a new clean PC without OS installed, or bought an external HDD, and want to quickly migrate your trusted system volume from an old PC with all installed apps to it, or test drive various system setups on it from VHDs delivering OS with all apps in a single compact easy to copy to a new drive or delete file? No problem... Backup the system volume you want to test onto a Base VHD as per Create Native Boot VHDs Tutorial (steps 1 - 7) or prepare your VHD by other mentioned in that Tutorial thread tools, then copy it to the new PC and make it bootable. How?
Boot from Win 7 PE or Installation DVD or ISO saved on a USB Thumb on a new Bare Metal PC. Open by Shift+F10 and Run from its Command Prompt:
1. Partition and Format the new PC's hard drive:
diskpart list disk select disk <disk_number_to_format> clean create partition primary format quick fs=ntfs label="VHD Test Drive" active assign letter=c exitYou can format and make bootable an internal or external HD, or another USB Thumb drive (with Diskpart or special tools like RMPrepUSB or Boot_USB).
2. Copy your sysprepped Win7 Base VHD from the source Thumb or Network drive to the new partition:
net use n: your_servershare_folder md c:VHD copy n:VHDwindows7.vhd c:VHD3. Attach and Mount the VHD on the new PC:
diskpart select vdisk file=C:VHDwindows7.vhd attach vdisk list volume select volume <volume_number_of_attached_VHD> assign letter=v exit4. Copy boot environment and configuration files from the VHD to the new partition:
cd v:windowssystem32 bootsect /nt60 c: /force /mbr bcdboot v:windows /s c: bcdedit /store c:bootbcd /copy {default} /d "Windows7 VHD boot (locate)"Insert below the {new_guid} from the above BCD entry copy:
bcdedit /store c:bootbcd /set {new_guid} device vhd=[locate]windows7.vhd bcdedit /store c:bootbcd /set {new_guid} osdevice vhd=[locate]windows7.vhd bcdedit /store c:bootbcd /default {new_guid} bcdedit /store c:bootbcd /set {new_guid} detecthal onIn most cases its sufficient to run only bootsect and bcdboot commands above, then reboot from the drive.
5. Re-specialize the Base VHD:
To boot a Win7 VHD from an empty USB drive, you might need to enable Windows 7 native USB/VHD boot registry settings by running the unpacked cdob's patch on Registry of the offline system volume saved on the attached VHD:
set_7_usb_boot.cmd v:windows diskpart select vdisk file=C:VHDwindows7.vhd detach vdisk exitThen restart your system, select the drive with your saved VHD as fisrt to boot in BIOS if not yet selected, and reboot to the Bare Metal PC - it will boot straight to your Base VHD and auto install required drivers. Follow Create Native Boot VHDs Tutorial (step 8), if you want to add later Differencing VHDs.
6. Add a Differencing VHD to the new PC (if needed):
You may then add Diff VHDs as per Create Native Boot VHDs Tutorial (steps 9 - 10) on the new PC. Don't forget to delete a Base VHD's entry from the host's Boot Menu after adding its Diff VHDs entries to it. You must Detach the Base VHD disk and make its file Read-only before creating its Diff VHDs, and keep them in the same original folder.
After rebooting from Win7 PE or another Win 7 & Server 2008R2 PC on LAN, you can copy more Base VHDs to the new PC, and add their entries to the host's Boot Menu by copying an existing entry in a VHD's BCD Store to the host's BCD Store and editing it: replacing in bcdedit commands a disk identifier number {current_guid} with {new_guid} generated for the copy, and setting the new VHD as an additional boot device. Of course, only one VHD boot device can be set default.
You just learned, how to natively boot a Win7 VHD from an empty drive without any OS installed, even when its the only drive in your new PC. All code in this and my other VHD Tutorials is given as "example" ONLY, a user might need to modify based on his system config and feedback.