The following procedures describe how to add a native-boot virtual hard disk (VHD) to the boot menu. If you are adding the VHD to a computer that already has a Windows® 7 installation, you will need to add a boot entry to the menu. If you are adding the VHD to a computer running an older version of Windows®, for example Windows Server® 2008, you will need to update the system partition using the BCDboot tool and then edit the boot menu using the BCDedit tool.
To update a BIOS-based computer to include a Windows 7 boot menu
If you are deploying the VHD to a BIOS-based computer without a Windows 7 boot menu, for example, a computer using Windows Server 2008 as the running operating system, you will need to update the boot environment using a Windows Preinstallation Environment (Windows PE) disk before you can configure the system for native-boot VHDs.
- Copy the .vhd file to the destination computer. For example, at a command prompt, type:
copy y:\windows7.vhd c:
- Use the DiskPart tool in Windows PE to attach the VHD on the destination computer. You can attach a VHD by using the Attach vdisk command. This activates the VHD so that it appears on the host as a disk drive rather than as a .vhd file. At a command prompt, type:
diskpart select vdisk file=c:\windows7.vhd attach vdisk assign letter=v exit
- Use the BCDboot tool, be located in the \System32 directory of the VHD image to copy the boot environment files and Boot Configuration Data (BCD) configuration from the \Windows directory in the VHD to the system partition. For example, to use BCDboot from the VHD image, at a command prompt, type:
cd v:\windows\system32 bcdboot v:\windows
The computer is now updated to include a Windows 7 boot environment.
To add a native-boot VHD to an existing Windows 7 boot menu
If you are deploying the VHD to a computer with an existing Windows 7 or Windows Server® 2008 R2 installation, you can use the BCDedit tool to make the new VHD bootable and add it to the boot menu.
Note: |
---|
Before you begin, you can back up your BCD store using the BCDedit tool with the /export option. For example, at a command prompt, type: bcdedit /export c:\bcdbackup |
- Copy an existing boot entry for a Windows 7 installation. You will then modify the copy for use as the VHD boot entry. At a command prompt, type:
bcdedit /copy {default} /d "vhd boot (locate)"
- Locate the {GUID} in the command-prompt output for the previous command. Copy the GUID, including the braces, to use in the following steps.
- Set the device and osdevice options for the VHD boot entry. At a command prompt, type:
bcdedit /set {guid} device vhd=[locate]\windows7.vhd bcdedit /set {guid} osdevice vhd=[locate]\windows7.vhd
- Set the boot entry for the VHD as the default boot entry. When the computer restarts, the boot menu will display all of the Windows installations on the computer and boot into the VHD after the operating-system selection countdown completes. At a command prompt, type:
bcdedit /default {guid}
- Some x86-based systems require a boot configuration option for the kernel in order to detect certain hardware information and successfully native-boot from a VHD. At a command prompt, type:
bcdedit /set {guid} detecthal on
관련글: VHD를 Win7 시스템에 연결하기