VHD란?
The Virtual Hard Disk (VHD) format is a publicly-available image format specification that allows encapsulation of the hard disk into an individual file for use by the operating system as a virtual disk in all the same ways physical hard disks are used. These virtual disks are capable of hosting native file systems (NTFS, FAT, exFAT, and UDFS) while supporting standard disk and file operations. VHD API support allows management of the virtual disks. Virtual disks created with the VHD API can function as boot disks.1
VHD를 사용할때 좋은 시나리오
Tools
BCDboot
The BCDboot tool is used for initializing the BCD store and copying boot-environment files to the system partition during image deployment. BCD files describe boot applications and boot application settings. The objects and elements in the store effectively replace the Boot.ini file. When installing a native-boot VHD on designated hardware, you may have to update to a Windows 8 BCD store. For more information about the BCDboot tool, see BCDboot Command-Line Options.
BCDedit
BCDedit is a command-line tool for managing BCD stores. It can be used for a variety of purposes such as creating new stores, modifying existing stores, and adding boot menu parameters. For more information about the BCDedit tool, see this Microsoft Web site.
DiskPart
DiskPart is a command-line tool in Windows that enables you to manage objects such as disks, partitions, or volumes, by using scripts or direct input at a command prompt. In Windows 8, the DiskPart tool can be used to create, partition, and attach VHDs. For more information about the DiskPart tool, see this Microsoft Web site.
Settings
prerequisition
- enough space
- Windows Installation media(DVD, USB, etc)
Let’s begin
1) Create VHD and make if bootable
| diskpart
create vdisk file=C:\win7.vhd maximum=25600 type=fixed
select vdisk file=C:\win7.vhd
attach vdisk
create partition primary
assign letter=v
format quick label=vhd
exit
|
Install Windows 7 on VHD
1) When Windows 7 Installation Windows turn up, press Shift+F10
2) Select vdisk
| select vdisk file=c:\win7.vhd
attach vdisk
assign letter=v
|
3) Install Windows on v drive
4) Make it bootable? (need to check if it’s necessary)
| cd v:\windows\system32
bcdboot v:\windows
bcdedit /copy {default} /d "vhd boot (locate)" //get GUID
bcdedit /set {guid} device vhd=[locate]\windows.vhdx
bcdedit /set {guid} osdevice vhd=[locate]\windows.vhdx
bcdedit /default {guid}
|
Fix boot problem
`Bootrec /rebuildbcd
http://superuser.com/questions/605250/bcdedit-mistake-while-trying-to-set-up-boot-to-vhd-in-windows-7-any-way-to-fix
Reference
- Technet:Understanding Virtual Hard Disks with Native Boot
- Technet:Make a VHD bootable
- Oracle Virtualbox Manual Chapter 5.Virtual Storage
- http://blogs.msdn.com/b/dai/archive/2014/04/10/using-vhd-native-boot-with-uefi-firmware-bcdedit-vs-bcdboot.aspx