Sunteți pe pagina 1din 4

Walkthrough: Deploy a Virtual Hard Disk for Native Boot Page 1 of 4

Walkthrough: Deploy a Virtual Hard Disk for Native Boot


Applies To: Windows 7,Windows Server 2008 R2

This walkthrough describes how to create and configure a virtual hard disk (VHD) running Windows® 7
for native boot. A native-boot VHD is a virtual hard disk that can be used as the running operating
system on designated hardware without any other parent operating system. This is in contrast to a
scenario where a VHD is connected to a virtual machine on a computer with a parent operating system.

In this release, VHDs can be applied to computers that have no other installations of Windows, for
usage as a native-boot VHD, without a virtual machine or hypervisor. (A hypervisor is a layer of
software below the operating system that runs virtual computers.) This allows for greater flexibility in
workload distribution in that a single set of tools can be used to manage images for virtual machines
and designated hardware.

Note
This walkthrough describes how to deploy the VHD to a computer with no other installations of
Windows. For more information about deploying multiple VHDs with native-boot on a single
computer, or deploying VHDs on computers with a parent operating system, see Add a Native-
Boot Virtual Hard Disk to the Boot Menu [ http://technet.microsoft.com/en-us/library/dd799299
(WS.10).aspx ] .

Prerequisites

To complete this walkthrough, you need the following:

 A technician computer running Windows 7. A technician computer is any computer with the
Windows OEM Preinstallation Kit (Windows OPK) or Windows Automated Installation Kit
(Windows AIK) tools installed on it.

 A Windows 7 image (.wim) file. For more information, see Capture and Apply Windows Images
[ http://technet.microsoft.com/en-us/library/dd744389(WS.10).aspx ] .

Note
Use a generalized Windows 7 image. A specialized image is customized to a specific
computer, while a generalized image can be deployed across many computers. For more
information about the specialize and generalize configuration passes, see Windows Setup
Configuration Passes [ http://technet.microsoft.com/en-us/library/dd744580
(WS.10).aspx ] .

 A Windows 7 Windows PE disk. For more information, see Walkthrough: Boot Windows PE from
CD-ROM [ http://technet.microsoft.com/en-us/library/dd744537(WS.10).aspx ] .

 A destination computer on which to install the VHD. This computer requires 30 gigabytes (GB) or
more of free disk space. You can install the VHD to a computer already running other operating
system installations, or as the only operating system on a computer.

Step 1: Create a VHD

1. On the technician computer, use the Diskpart tool to create, attach, partition, and format a new

http://technet.microsoft.com/en-us/library/dd744338(printer).aspx 6/23/2009
Walkthrough: Deploy a Virtual Hard Disk for Native Boot Page 2 of 4

virtual hard disk. You can attach a VHD by using the Attach vdisk command which adds
the .vhd file as a disk to the storage controller on the host. This virtual disk will appear as the R:
drive at the end of this procedure. The Detach command will stop this virtual disk from
appearing on the host.

In this example, you create a 25 GB fixed-type VHD. For more information about VHD image
types, see Understanding Virtual Hard Disks with Native Boot [ http://technet.microsoft.com/en-
us/library/dd799282(WS.10).aspx ] . For more information about the DiskPart tool, see this
Microsoft Web site [ http://go.microsoft.com/fwlink/?LinkId=128458 ] .

At a command prompt, type:

Copy Code

diskpart
create vdisk file=c:\windows7.vhd maximum=25600 type=fixed
select vdisk file=c:\windows7.vhd
attach vdisk
create partition primary
assign letter=r
format quick label=vhd
exit

Step 2: Apply a Windows 7 image


1. Use ImageX to apply the .wim file to the primary partition of the VHD. At a command prompt,
type:

Copy Code

cd /d "c:\program files\<version>\tools\<architecture>\"
imagex /apply <pathtowim> 1 r:\

Where <version> is Windows OPK or Windows AIK and <architecture> is x86, amd64 or ia64.

2. Use the DiskPart tool to detach the virtual disk after applying the image. At a command prompt,
type:

Copy Code

diskpart
select vdisk file=c:\windows7.vhd
detach vdisk
exit

3. Copy the VHD file to a network share or USB hard drive. For example,

Copy Code

net use y: \\network_share\


copy c:\windows7.vhd y:\network_share\vhd\

Step 3: Clean and partition the destination


computer
1. Boot the destination computer with your bootable Windows PE media.

2. Clean the hard disk using the DiskPart tool.

Caution
Running this command will erase all information on the computer. If you are deploying a
VHD and want to maintain an existing native-boot VHD deployment or running operating
system on the destination computer, do not run this command. See Add a Native-Boot
Virtual Hard Disk to the Boot Menu [ http://technet.microsoft.com/en-us/library/dd799299

http://technet.microsoft.com/en-us/library/dd744338(printer).aspx 6/23/2009
Walkthrough: Deploy a Virtual Hard Disk for Native Boot Page 3 of 4

(WS.10).aspx ] for more information.

At a command prompt, type:

Copy Code

diskpart
sel disk 0
clean

3. Create a system partition. This example uses a 200 megabyte (MB) system partition. At a
command prompt, type:

Copy Code

create partition primary size=200


format quick fs=ntfs
assign letter=s
active

4. Create a primary partition. In this example the primary partition is given the remaining disk
space. At a command prompt, type:

Copy Code

create partition primary


format quick fs=ntfs
assign letter=c
exit

Step 4: Deploy the VHD with native-boot


capabilities
1. Copy the VHD file to the destination computer. At a command prompt, type:

Copy Code

copy y:\Windows7.vhd c:

2. Use the DiskPart tool to attach the VHD on the destination computer. At a command prompt,
type:

Copy Code

diskpart
select vdisk file=c:\windows7.vhd
attach vdisk

3. The VHD is assigned a volume letter when it is attached. Find the letter associated with the VHD
in the volume list and then exit the DiskPart tool. At a command prompt, type:

Copy Code

list volume
exit

4. Use the BCDboot tool, located in the \System32 directory of the Windows 7 VHD or in a
Windows® 7 Windows PE media, to copy the boot-environment files from the \Windows
directory in the VHD to the system partition. The BCDboot tool will create the BCD configuration
to boot from the VHD. For more information about the BCDboot tool, see BCDboot Command-
Line Options [ http://technet.microsoft.com/en-us/library/dd744347(WS.10).aspx ] .

For example, at a command prompt, type:

Copy Code

cd v:\windows\system32
bcdboot v:\windows /s s:
Walkthrough: Deploy a Virtual Hard Disk for Native Boot Page 4 of 4

Where v is the volume letter of the attached VHD.

5. Use the DiskPart tool to detach the virtual disk. At a command prompt, type:

Copy Code

diskpart
select vdisk file=c:\windows7.vhd
detach vdisk
exit

6. Restart the destination computer.

The Windows 7 Boot Manager will boot the Windows 7 operating system image contained in
the .vhd file.

Next Steps

To deploy a second VHD with native-boot capabilities to the same computer, you can copy the file and
add it to the existing BCDboot menu using the BCDedit tool. For more information, see Add a Native-
Boot Virtual Hard Disk to the Boot Menu [ http://technet.microsoft.com/en-us/library/dd799299
(WS.10).aspx ] .

See Also
Concepts
Understanding Virtual Hard Disks with Native Boot [ http://technet.microsoft.com/en-
us/library/dd799282(WS.10).aspx ]
Add a Native-Boot Virtual Hard Disk to the Boot Menu [ http://technet.microsoft.com/en-
us/library/dd799299(WS.10).aspx ]

S-ar putea să vă placă și