VHD Native Boot is one of the important new functions of Windows 7 and Windows Server 2008 R2. It supports the system to start directly from VHD.
I. Description
Windows 7 Enterprise or Ultimate, not supported in other versions
Windows Server 2008 R2 is supported in other versions except for the Foundation Edition version.
The System must have two partitions. The System partition must have Windows 7 Boot_environmenet Files and BCD storage.
If the VHD file type is dynamic expansion, make sure that the disk has sufficient disk space.
Allows you to MOUNT up to 512 VHD files.
Systems started from VHD do not support system sleep and Over SMB sharing
The Volume that saves the VHD file does not support Bitlock encryption, and the parent partition of the VHD file does not support the Volume Snaphot function.
VHD cannot be configured as a dynamic disk or supports software Raid.
Compared with physical hard disks, VHD does not have a CACHE. Therefore, when writing data, VHD hard disks are slightly different from physical hard disks, but the read performance is basically similar to that of physical hard disks.
Ii. Necessary tools
1. Bcdboot
Bcdboot-Bcd Startup File Creation and repair tools.
The bcdboot.exe command line tool is used to copy key startup files to system partitions and create a new system BCD storage.
Bcdboot <source> [/l <locale>] [/s <volume-letter>] [/v]
[/M [{OS Loader ID}]
Source specifies the location of the windows system root directory.
/L specifies the optional region setting parameters used when initializing BCD storage.
The default value is "simplified Chinese ".
/S specifies an optional volume number parameter, which is used to specify to copy the startup environment file
Target system partition. The default value is the system partition identified by the firmware.
/V enables the verbose mode.
/M if the OS loader GUID is provided, this option can
Objects are combined with system templates to generate boot entries. Otherwise, merge only global
Object.
2. Bcdedit
The Bcdedit.exe command line tool is used to modify STARTUP configuration data storage. The STARTUP configuration data storage contains the startup configuration parameters and controls the Startup Mode of the operating system.
3. diskpart
Disk partition management tool. In this example, it is used to generate VHD files, partitions, and formatting in the command line status.
4. imagex
WIM image management tool, which is included in the Microsoft AIK toolkit. In this example, use it to release the installation image Install. WIM file to the VHD file.
5. Windows Deployment Services
Deployment Service
Iii. Deployment
You can use VHD to start a computer in either of the following two scenarios: deploy VHD on an existing OS computer and deploy bare metal. The biggest difference between the two is the bare metal, because there is no OS on the hard disk, there is no Windows 7 Startup File and MBR, so you must first generate a system partition, use Bcdboot to write the Windows 7 Startup File to this partition. A primary partition must also be generated to store VHD files. For deployment on an existing OS computer, you must generate a VHD file, release the Windows 7 or Windows 2008 R2 image to the VHD hard disk, and use the BCDEDIT tool to add a startup project.
Because VHD files are dynamic and fixed, we recommend that you use fixed-size VHD files to ensure performance.
Deploy on an existing OS computer
Lab environment: use Microsoft Virtual Server 2005 SP1 to generate a Virtual machine Windows 7 and install the Windows 7 7600 operating system and the AIK toolkit. This Virtual machine has two Virtual hard disks, one of which is c :, windows 7 has been installed; another e: used to generate VHD files; the optical drive is D:
Start the computer and perform the following operations (note that the following operations are performed as Administrator BILL. xu)
1. Enter the command prompt status as an administrator and run DISKPART
2. Enter the following commands in sequence:
Create vdisk file = e: \ win2007.vhd maximum = 10000 type = fixed
(A vhd hard drive named win2007.vhd with a size of 10000 MB and a fixed size is generated on the E disk.) Wait for a while.
Select vdisk file = e: \ win2007.vhd
(Select e: \ win2007.vhd disk file)
Attach vdisk
(Connect to the Virtual Disk File)
Create Partition Primary
(Generate primary partition)
Assign Letter R
(Assign drive letter to R)
Format Quick Fs = ntfs
(Disk in the fast format of NTFS file system). At this time, a hard disk with the drive letter R will be added to my computer.
3. Open the virtual server management website, edit the Windows 7 settings of the virtual machine, and load the ISO file of the Windows 7 installation disc in the optical drive.
4. Run Deployment Tools Command Prompt in the AIK Toolkit as an administrator and run the following Command
Imagex/info d: \ sources \ install. wim
(Display the information of the installation image file, mainly to find the image index number of each version in the image file)
Imagex/apply d: \ sources \ install. wim 5 r :\
(Release the image index = 5 image in the installation image to the r: disk, that is, release the image index = 5 to the VHD file.
5. Return to the second step and enter the following command:
Detach vdisk
(Detach a Virtual Disk File)
Exit
(Exit the DISKPART command)
6. Enter the following command at the command prompt:
Bcdedit/copy {current}/d "Starting From VHD"
(Edit the BCD database, copy {current} As a copy, and comment it as Starting From VHD. The GUID of the new project is returned after execution)
The GUID returned in this operation is {91efbc47-7796-11de-8788-b469c8eae731}
Bcdedit/set {91efbc47-7796-11de-8788-b469c8eae731} device vhd = [e:] \ win2007.vhd
(Edit the BCD database and change the value of the device whose guid is {91efbc47-7796-11de-8788-b469c8eae731} to [e:] \ win2007.vhd. note [])
Bcdedit/set {91efbc47-7796-11de-8788-b469c8eae731} osdevice vhd = [e:] \ win2007.vhd
Bcdedit/set {91efbc47-7796-11de-8788-b469c8eae731} detecthal on
(Enable hardware image detection at startup)
After that, back up e: \ win2007.vhd to another location.
7. restart the computer and select "Starting From VHD". The installation interface is displayed. Install the operating system.
Deployment on bare metal
Lab environment: use Microsoft Virtual Server 2005 SP1 to generate a Virtual machine Win7VHD, a hard drive c:, and a drive D :.
1. Open the virtual server management website, edit the Win7VHD settings of the virtual machine, and load the winpe iso file in the optical drive.
The IOS file of the WINPE disc can be found in the AIK folder.
2. Start the computer with a WINPE disc and select a command prompt
3. Enter the following commands in sequence:
Create partition primary size = 200
Format quick fs = ntfs
Assign letter = s
Active
Generate a file with a size of MB. format it with NTFS and specify the drive letter as S to activate the partition.
Create partition primary
Format quick fs = ntfs
Assign letter = c
Exit
Create a primary partition for other spaces, format the partition with NTFS, and assign the drive letter as C.
4. Copy the backup file generated in step 1 of the preceding example to drive C.
5. Use Diskpart in the command prompt to connect to the Virtual Disk File win2007.vhd.
Diskpart
Select vdisk file = c: \ win2007.vhd
Attach vdisk
Exit
6. cd f: \ windows \ system32 (F: The drive letter generated after the virtual disk file is loaded)
Bcdboot f: \ windows/s: copy the system file to the system disk (that is, the system partition generated MB before)
7. Start the computer on the hard disk and complete the installation.
Install Windows 7 on a VHD File
The following operations are successful in the virtual environment of VMware Workstation 6.5.
Installation Method:
1. Start the computer with a Windows 7 or Windows 2008 R2 installation disc
2. "Install now" appears on the screen, and press Shift + F10 to display a command prompt window.
3. Enter the following commands in sequence:
Diskpart
List disk
Select disk 0
Clean
Clear disk content
4. Enter the following commands in sequence:
Create partition primary size = 200
Format fs = ntfs label = "System" quick
Active
Generate a M system partition and stimulate the partition.
5. Enter the following commands in sequence
Create partition primary
Format fs = ntfs label = "Diskc" quick
Assign letter = C
Generate primary partition C
6. Enter the following commands in sequence:
Create vdisk file = c: \ Win2007.vhd maximum = 11000 type = fixed
Select vdisk file = c: \ Win2007.vhd
Attach vdisk
Create partition primary
Format fs = ntfs label = "VHDBoot" quick
A fixed-size VHD file, Win2007.vhd, is generated on drive C and formatted.
7. Enter the EXIT command twice and return to the installation interface. Continue Installation
8. When selecting the installation target, select the VHD disk to continue the installation !!
This article is from the "Jia Xinliang's technical Blog" Blog