Sign in with
Sign up | Sign in
Your question

Vhd bootable from USB

Last response: in Business Computing
Share
October 8, 2011 8:48:51 PM

Has anyone created a USB bootable version of windows 7 or XP that can be booted bare metal on multiple machines?

I found this article on VHD very interesting.


Frequently Asked Questions: Virtual...
Frequently Asked Questions: Virtual Hard Disks in Windows 7 and Windows Server 2008 R2
Updated: October 15, 2010
Applies To: Windows 7, Windows Server 2008 R2
This article provides answers to common questions about virtual hard disks (VHDs) in Windows 7 and Windows Server 2008 R2.
• What is a native VHD boot?
• What are the different VHD file types?
• Why are fixed VHDs recommended for production?
• When is it appropriate to use dynamically expanding VHDs?
• What does it mean to create, attach, and detach VHDs?
• Are there any restrictions that I should be aware of when attaching VHDs?
• What are the recommendations for using VHDs for native boot?
• What is not supported for native boot when using VHDs?
What is a native VHD boot?
In Windows 7 and Windows Server 2008 R2 you can configure a VHD for native boot. This means that a VHD can be used as the running operating system on designated hardware without a parent operating system, virtual machine, or hypervisor. Furthermore, if you use native boot, you have full access to all devices and file system volumes on the physical computer, including the volumes inside the VHD. In contrast, when Windows runs in a virtual machine, only one file system volume in the virtual disk (volume C:)  is available to guest machines (unless you share another volume to the virtual machine).
Note the following functionality with native boot:
• Native boot from a VHD is available in Windows 7 Enterprise, Windows 7 Ultimate, and all versions of Windows Server 2008 R2.
• When you perform a native boot, file system partitions that are contained in the VHD are automatically attached and the virtual volumes are visible.
• Native boot supports all three VHD file types: fixed, dynamically expanding, and differencing. When you native boot from a dynamically expanding VHD file, the VHD is automatically expanded to the maximum size. If the physical host volume of the VHD file does not have enough free disk space for the maximum size of the dynamically expanding VHD, the boot process will fail.
• Native boot is supported on computers that have either BIOS-based or UEFI-based firmware.
For instructions about how to configure a computer for native boot from a VHD, see the following resources: .
• Walkthrough: Deploy a Virtual Hard Disk for Native Boot
Walkthrough: Deploy a Virtual Hard Disk for Native Boot
Published: October 22, 2009
Updated: July 8, 2010
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.

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.
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.

• A Windows 7 Windows PE disk. For more information, see Walkthrough: Boot Windows PE from CD-ROM.
• 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.
For more information about using VHDs in an enterprise environment, see Understanding Virtual Hard Disks with Native Boot.
Step 1: Create a VHD
1. On the technician computer, use the Diskpart tool to create, attach, partition, and format a new 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 V: 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. For more information about the DiskPart tool, see this Microsoft Web site.

At a command prompt, type:


2. diskpart
3. create vdisk file=c:\windows7.vhd maximum=25600 type=fixed
4. select vdisk file=c:\windows7.vhd
5. attach vdisk
6. create partition primary
7. assign letter=v
8. format quick label=vhd
9. 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:


2. cd /d "c:\program files\<version>\tools\<architecture>\"
3. imagex /apply <pathtowim> 1 v:\
Where <version> is Windows OPK or Windows AIK and <architecture> is x86, amd64 or ia64.
4. Use the DiskPart tool to detach the virtual disk after applying the image. At a command prompt, type:


5. diskpart
6. select vdisk file=c:\windows7.vhd
7. detach vdisk
8. exit
9. Copy the VHD file to a network share or USB hard drive. For example,


10. net use n: \\server\share\
11. md N:\VHDs
copy c:\windows7.vhd n:\VHDs\
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 for more information.

3. At a command prompt, type:


4. diskpart
5. select disk 0
6. clean
7. Create a system partition. This example uses a 300 megabyte (MB) system partition. At a command prompt, type:


8. create partition primary size=300
9. format quick fs=ntfs
10. assign letter=s
11. active
12. Create a primary partition. In this example the primary partition is given the remaining disk space. At a command prompt, type:


13. create partition primary
14. format quick fs=ntfs
15. 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 N:\VHDs\Windows7.vhd c:
2. Use the DiskPart tool to attach the VHD on the destination computer. At a command prompt, type:


3. diskpart
4. select vdisk file=c:\windows7.vhd
5. attach vdisk
6. 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:


7. list volume
8. select volume <volume_number_of_attached_VHD>
9. assign letter=v
exit
10. 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.

For example, at a command prompt, type:


11. cd v:\windows\system32
bcdboot v:\windows /s s:
12. Use the DiskPart tool to detach the virtual disk. At a command prompt, type:


13. diskpart
14. select vdisk file=c:\windows7.vhd
15. detach vdisk
exit
16. 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.
See Also
Concepts
Understanding Virtual Hard Disks with Native Boot
Add a Native-Boot Virtual Hard Disk to the Boot Menu
Tags : Add a tag

Community Content
Add new content
Annotations
small possible errata Florin8856 ... Rochester1104 | Edit | Show History

I think that at step 4.1 the drive letter is still w: and not c: as the system has not been restarted and the code should be:

copy N:\VHDs\Windows7.vhd w:

Correct me if I am wrong.
Florin Nicolescu
florin@learningsolution.ro

This seems to have been corrected by changing the drive letter to c: from w: in line 3.1
so line 4.1:

copy N:\VHDs\Windows7.vhd c:

is now correct.
Tags : Add a tag
Flag as ContentBug
Documentation Error Pronichkin | Edit | Show History

> This virtual disk will appear as the R: drive at the end of this procedure.
> assign letter=v

One of the above lines is definitely wrong.
Tags : contentbug (x) Add a tag

• Add a Native-Boot Virtual Hard Disk to the Boot Menu
Add a Native-Boot Virtual Hard Disk to the Boot Menu
Published: October 22, 2009
Updated: October 22, 2009
Applies To: Windows 7, Windows Server 2008 R2
The following procedures describe how to add a native-boot virtual hard disk (VHD) to the boot menu using the BCDedit tool. 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.
1. Copy the .vhd file to the destination computer. For example, at a command prompt, type:


copy N:\VHDs\windows7.vhd C:
2. 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:


3. diskpart
4. select vdisk file=c:\windows7.vhd
5. attach vdisk
6. list volume
7. select volume <volume_number_of_attached_VHD>
8. assign letter=v
exit
9. Use the BCDboot tool, located in the \System32 directory of the VHD image or in Windows PE to copy the boot environment files and Boot Configuration Data (BCD) configuration from the \Windows directory in the VHD to the system partition. On a computer with BIOS firmware, the system partition is the active partition of the first hard disk. For example, to use BCDboot from the VHD image, at a command prompt, type:


10. cd v:\windows\system32
bcdboot v:\windows
The BCDboot tool automatically imports information from the existing installation when updating the BCD. The computer is now updated to include a Windows 7 boot environment. You can now follow the steps in the section "To add a native-boot VHD to an existing Windows 7 boot menu" later in this topic.
To update a UEFI-based computer to include a Windows 7 boot menu
If you are deploying the VHD to a UEFI-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 PE disk before you can configure the system for use with native-boot VHDs.
1. Copy the .vhd file to the destination computer. For example, at a command prompt, type:


copy N:\VHDs\windows7.vhd C:
2. 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:


3. diskpart
4. select vdisk file=C:\windows7.vhd
5. attach vdisk
6. list volume
7. select volume <volume_number_of_attached_VHD>
8. assign letter=v
9. exit
10. On a UEFI-based computer, the system partition is hidden by default and must be assigned a drive letter before running the BCDboot tool. Use the DiskPart tool to locate the EFI system partition and assign it a drive letter. At a command prompt, type:


11. diskpart
12. select disk 0
13. list partition
14. select partition <x>
15. assign letter=s
16. exit
Where <x> is the 100 megabyte (MB) EFI system partition formatted with FAT.
17. Use the BCDboot tool, located in the \System32 directory of the VHD image or in Windows PE to copy the boot environment files and 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:


18. cd v:\windows\system32
bcdboot v:\windows /s s:
The BCDboot tool automatically imports information from the existing installation when updating the BCD. The computer is now updated with a Windows 7 boot environment. You can now follow the steps to add a native-boot VHD to an existing Windows 7 boot menu.
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. For more information about using the BCDedit tool, see this Microsoft Web site.
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
1. 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)"
When the BCDedit command completes successfully, it returns a {GUID} as output in the Command Prompt window.
2. Locate the {GUID} in the command-prompt output for the previous command. Copy the GUID, including the braces, to use in the following steps.
3. Set the device and osdevice options for the VHD boot entry. At a command prompt, type:


4. bcdedit /set {guid} device vhd=[locate]\windows7.vhd
bcdedit /set {guid} osdevice vhd=[locate]\windows7.vhd
5. 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}
6. 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
See Also
Concepts
BCDboot Command-Line Options
Walkthrough: Deploy a Virtual Hard Disk for Native Boot
Understanding Virtual Hard Disks with Native Boot
Tags : Add a tag

Community Content
Add new content
Annotations
The [locate] confusion Prototyped | Edit | Show History

[locate] the literal string is actually valid (and in fact necessary for BCD's on removable media). What I'm not sure of is whether it can be used generally, or whether it's only valid for Windows PE on removable media.
Tags : Add a tag
Flag as ContentBug
Edit the original document or replace it. Scott Schindler | Edit | Show History

The information contained above regarding {locate} is imperative to following a step by step process. People do not read the whole document before follwoing the step by step process. It was obvious that locate would imply the loctaion of the file, however it should be edited directly to prevent frustration and failure for the tech following this process. Having this information as additional content is now enough, but appreciated.
Tags : Add a tag
Flag as ContentBug
[locate] should be defined somewhere within this article. vroxx | Edit | Show History

Step 3 under "To add a native-boot VHD to an existing Windows 7 boot menu" needs to better define [locate].

bcdedit /set {guid} device vhd=[locate]\windows7.vhd
bcdedit /set {guid} osdevice vhd=[locate]\windows7.vhd


[locate] should be the drive where the VHD exists. If this was on the C drive for Instance, the commands would look like the following:

bcdedit /set {guid} device vhd=[C:]\windows7.vhd
bcdedit /set {guid} osdevice vhd=[C:]\windows7.vhd

Trying to determine what [locate] was lead me to numerious syntax errors for bcdedit, I needed to look elsewhere to get the proper syntax.

Kind regards.

• Creating Bootable Virtual Hard Disks
Creating Bootable Virtual Hard Disks
Updated: October 15, 2010
Applies To: Windows 7, Windows Server 2008 R2
In addition to attaching VHDs (see Creating Virtual Hard Disks), you can create VHDs that are bootable. Bootable VHDs are VHDs that contain a Windows image. You can create bootable VHDs by using either of the following methods:
• Using the Disk Management Tools
• Using Hyper-V
Using the Disk Management Tools
This section describes how to create a bootable VHD by using the Disk Management tools. You create a VHD and then apply a Windows image from a .wim file to a partition in the VHD. After you complete the steps in this section, you can configure the VHD for native boot or configure it to boot in a virtual machine by following the instructions in Preparing Virtual Hard Disks for Boot.
Before you continue, ensure that you have the following prerequisites:
• A computer that is running Windows 7 or Windows Server 2008 R2
• Access to media that contains the Windows 7 or Windows Server 2008 R2 installation files
Note
You can use the Windows Image to Virtual Hard Disk (WIM2VHD) command-line tool to automate many of the steps in this section such as creating .vhd files and applying a .wim file to the .vhd. To download WIM2VHD, see the MSDN Code Gallery (http://go.microsoft.com/fwlink/?LinkId=155155). To use WIM2VHD, your computer must be running Windows 7, Windows Server 2008 R2, or Windows Server 2008 with Hyper-V enabled. WIM2VHD also requires that you have installed the Windows AIK to use ImageX.
• Step 1: Create and attach a VHD
• Step 2: Locate the install.wim image to apply to the VHD
• Step 3: Apply a Windows image to the VHD
Step 1: Create and attach a VHD
If you do not already have a VHD that you want to use, use the following procedure to create a VHD.
Note
If you prefer, you can use the Disk Management MMC snap-in to perform these steps. For instructions, see Creating Virtual Hard Disks.

To create and attach a VHD
1. To start the DiskPart command interpreter, open an elevated Command Prompt window (click Start, right-click Command Prompt, and click Run as administrator), and then type:
Diskpart
2. Create and attach a VHD by using Diskpart. The following example creates a dynamically expanding VHD that has 25 GB maximum size and saves the VHD file in the folder, C:\vhd.
3. create vdisk file=C:\VHD\test.vhd maximum=25000 type=expandable
4. select vdisk file=C:\VHD\test.vhd
5. attach vdisk
6. create partition primary
7. assign letter=v
8. format quick FS=NTFS label=VHD
exit
Step 2: Locate the install.wim image to apply to the VHD
The next step is to locate an image of the Windows 7 or Windows Server 2008 R2 operating system (.wim) to apply to the volume in the VHD. You can find a .wim image at the following locations:
• The product DVD. The installation image is located at \sources\install.wim.
• A Windows installation that you have captured to a .wim by using ImageX.exe or the Image Capture Wizard for Windows Deployment Services.
• An .iso image. An .iso image combines all the installation files into a single uncompressed file. These images are available to MSDN and TechNet subscribers, and they are also available from the Windows Products Home page (http://go.microsoft.com/fwlink/?LinkId=155370). You must mount .iso images or burn them to physical media to access the .wim files within the .iso file.
Note
The Windows Preinstallation Environment (Windows PE) image in Boot.wim does not support native VHD boot.
The Install.wim (on the Windows product DVD) contains multiple images for different versions of the operating system, and each image has an index. The following table shows the index values for the supported editions of Windows.

Index Operating System Edition
1 Windows 7 Enterprise
4 Windows 7 Ultimate
1 Windows Server 2008 R2 Standard (Full Installation)
2 Windows Server 2008 R2 Standard (Server Core Installation)
3 Windows Server 2008 R2 Enterprise (Full Installation)
4 Windows Server 2008 R2 Enterprise (Server Core Installation)
5 Windows Server 2008 R2 Datacenter (Full Installation)
6 Windows Server 2008 R2 Datacenter (Server Core Installation)
7 Windows Web Server 2008 R2 (Full Installation)
8 Windows Web Server 2008 R2 (Server Core Installation)
Step 3: Apply a Windows image to the VHD
There are two ways that you can apply a Windows image to a VHD.
• Use the ImageX command-line tool. If you have the Windows AIK installed on your computer, you can use ImageX to apply a .wim to a VHD. If you do not have the Windows AIK, you can download it at Windows Automated Installation Kit for Windows 7. The Windows AIK download is an .iso image that you burn to a DVD and then install on your computer. After installing the Windows AIK, ImageX is located in the Windows AIK\PE Tools directory. Use the following procedure titled “To apply a Windows image to a VHD by using ImageX”.
• Use the Install-WindowsImage.ps1 Windows PowerShell script. Windows PowerShell is included in Windows 7 and Windows Server 2008 R2. The Install-WindowsImage.ps1 script has fewer options than ImageX, and it does not require you to download the Windows AIK. However, using this method will require you to learn how to use Windows PowerShell if you are not currently familiar with it. If you have never used Windows PowerShell, see Getting Started With Windows PowerShell (http://go.microsoft.com/fwlink/?LinkID=204238).

This script can perform two tasks: display a list of images in a .wim and apply a .wim to a partition in a VHD. To use this method, first download this script at Install-WindowsImage PowerShell Script (http://go.microsoft.com/fwlink/?LinkId=204240). Then use the following procedure titled “To apply a Windows image to a VHD by using the Install-WindowsImage.ps1 script”.
To apply a Windows image to a VHD by using ImageX
1. Click Start, click Microsoft Windows AIK, right-click Deployment Tools Command Prompt, and click Run as administrator.
2. To view information about the versions of Windows in the .wim image, type the following command:
imagex /info <path to .wim>
The output lists the metadata for all the images in the .wim file. View the <DESCRIPTION> element for each of the images in the output, and note the index of the image that you want to apply to the VHD.
3. Use the following syntax to apply the Windows image from the install.wim to the VHD volume, using the applicable index.
imagex /apply <path to .wim> <image_index> <path to VHD>
For example, the following command applies the Datacenter version of Windows (index number 5) from the install.wim (from DVD media in drive F) to the VHD partition (drive V).
imagex /apply F:\sources\install.wim 5 V:\
Note
It takes approximately 10-15 minutes to apply the image. If you are applying a .wim from a network file share instead of from local media, use a wired network connection for a faster network connection speed.
Now that you have created a VHD file and applied a Windows image to it, you can configure it for native boot or configure it to boot in a virtual machine by following the instructions in Preparing Virtual Hard Disks for Boot.
To apply a Windows image to a VHD by using the Install-WindowsImage.ps1 script
1. Click Start, and type PowerShell in the Start text box.
2. In the results pane, right-click Windows PowerShell, and then click Run as Administrator.
3. To list the images and index numbers in a .wim, use the following syntax:
C:\Vhd\Install-WindowsImage.ps1 -WIM <path to .wim>
4. To view the Help for this script, type:
help .\Install-WindowsImage.ps1 –detailed
5. To apply an image from a .wim to a VHD, use the following syntax:
C:\Vhd\Install-WindowsImage.ps1 –WIM <String> -Apply –Index <Int32> -Destination <Drive>
Note
The first time you run Windows PowerShell, an error message may appear that tells you that unsigned scripts cannot be loaded because scripts are disabled on the computer. If you receive this error message, you need to set the Windows PowerShell execution policy to allow unsigned local scripts, but still require signed scripts from remote locations. To configure this, run set-ExecutionPolicy RemoteSigned at the Windows PowerShell command prompt.
In the following example, drive D is the DVD drive with the Windows product DVD, and drive V is the VHD that you created in Step 1:


PS C:\vhd> .\Install-WindowsImage.ps1 -WIM D:\sources\install.wim


Index Image Name
[1] Windows Server 2008 R2 Standard (Full Installation)
[2] Windows Server 2008 R2 Standard (Server Core Installation)
[3] Windows Server 2008 R2 Enterprise (Full Installation)
[4] Windows Server 2008 R2 Enterprise (Server Core Installation)
[5] Windows Server 2008 R2 Datacenter (Full Installation)
[6] Windows Server 2008 R2 Datacenter (Server Core Installation)
[7] Windows Web Server 2008 R2 (Full Installation)
[8] Windows Web Server 2008 R2 (Server Core Installation)


Done.

PS C:\vhd> .\Install-WindowsImage.ps1 -WIM D:\sources\install.wim -Apply -Index 5 -Destination V:

Applying "Windows Server 2008 R2 Datacenter" to V:...
WARNING: This may take up to 15 minutes...

Elapsed Time: 00:10:57.6302827
Done.
Using Hyper-V
You can use Hyper-V Manager to create bootable VHDs. You may prefer this method because there is a user interface that leads you through the process. VHDs that you create by using Hyper-V Manager are configured for virtual machine boot by default. To configure the VHD for native boot, follow the instructions in the “Prepare a VHD image for native boot” section of Preparing Virtual Hard Disks for Boot.
To create a bootable VHD by using Hyper-V Manager
1. Start Hyper-V Manager (click Start, click Administrator Tools, and click Hyper-V Manager).
2. Click Action, click New, and then click Virtual Machine.
3. Specify a Name and Location for the new virtual machine, and then click Next.
4. Specify the amount of memory to allocate.
5. Click Next on the Configure Networking screen.
6. Select Create a virtual hard disk, specify the storage location and maximum size for the VHD, and then click Next.

7. Select Install an operating system from a boot CD/DVD-ROM, and then select the physical CD/DVD drive or the .iso file.

8. Click Next, and then click Finish. A new virtual machine will be created in the Off state.
Use the following procedure to start the new virtual machine and install the operating system.
To start the virtual machine
1. Right-click the new virtual machine.
2. To add a DVD or a virtual DVD to a virtual machine, click Settings.
3. Under IDE Controller, select DVD Drive.
4. Specify one of the following, and then click Apply:
1. If installing from a physical DVD, select Physical CD\DVD drive, and then specify the drive letter.
2. If installing from a bootable .iso file, browse to the path under Specify the media to use with your virtual CD\DVD drive, click Image file.
5. Select the virtual machine from the Virtual Machines pane, and then in the Actions pane, click Connect.
6. Click Actions, and then click Start.
7. When you are prompted to Press any key to boot from CD\DVD, press a key and proceed with the installation.
Now that you have created a VHD, you can configure it for native boot by following the instructions in Preparing Virtual Hard Disks for Boot.

What are the different VHD file types?
There are three types of VHDs: fixed, dynamically expanding, and differencing. You can create these files by using the Hyper-V™ Manager or the Windows disk-management tools. For instructions about how to create and configure VHDs, see Creating Virtual Hard Disks.

Type Explanation
Fixed A fixed VHD has an allocated size that does not change. For example, if you create a fixed VHD that is 24 gigabytes (GB), the file will be approximately 24 GB (with some space used for the internal VHD structure) regardless of the data that is written to it.
Dynamically expanding The size of a dynamically expanding VHD is as large as the data that is written to it. As more data is written to a dynamically expanding VHD, the file increases to a maximum size. For example, a 24 GB dynamically expanding VHD is initially around 80 megabytes (MB) on the host file system. As data is written to the VHD, the file grows, but it has a maximum size of 24 GB.
Differencing A differencing VHD is similar to a dynamically expanding VHD, but it contains only the modified disk blocks of the associated parent VHD. The parent VHD is read-only, so you must modify the differencing VHD. A differencing VHD is sometimes referred to as a “child” VHD. The parent VHD can be any of the three VHD file types, including another differencing VHD. Multiple differencing VHDs create a differencing chain. Note the following requirements for differencing VHDs:
• You should not modify the parent of a differencing VHD. If the parent VHD is changed or replaced by a different VHD (even if it has the same file name), the block structure between the parent and differencing VHD will no longer match and the differencing VHD will be corrupted.
• You must keep both files (the parent VHD and the differencing VHD) in the same directory on a local volume for native-boot scenarios. For native-boot VHDs, the parent VHD and the differencing disk cannot reside on different volumes, even if they reside on the same local disk. However, when you attach a differencing VHD that is not used for native boot (for example, if you plan to use it for image management), the parent VHD can be in different directories, and on a different volume or even on a remote share.
Why are fixed VHDs recommended for production?
Fixed VHDs are recommended for production instead of dynamically expanding or differencing VHDs for the following reasons:
• The I/O performance is highest for fixed VHDs because the file is not dynamically expanded.
• When a dynamically expanding disk is expanded, the host volume could run out of space and cause the write operations to fail. Using fixed VHDs ensures this does not happen.
• The file data will not become inconsistent due to lack of storage space or power loss. Dynamically expanding and differencing VHDs depend on multiple write operations to expand the file. The internal block allocation information can become inconsistent if all I/O operations to the VHD file and the host volume are not complete and persisted on the physical disk. This can happen if the computer suddenly loses power.
When is it appropriate to use dynamically expanding VHDs?
Dynamically expanding VHDs are useful in nonproduction environments where flexible storage requirements and frequently changing the VHD image is more of an advantage than the reliability of the data within the VHD. In addition, dynamically expanding VHDs are best for testing environments because there is less impact if you have to rebuild the VHD. For example, a test environment can use multiple dynamically expanding VHDs, each with a different Windows image and set of applications to test. If the VHD files are modified during testing or accidentally become corrupt, you can replace the VHDs from a safe copy and restart testing.
Using dynamically expanding VHDs in a test environment provides the following benefits:
• Flexible use of disk space. You can use free space for the VHD to expand during native VHD boot. This space would have been unavailable if the volume hosted multiple VHDs in a fixed format.
• Faster transfer time when copying VHDs between locations. The file size for a dynamically expanding VHD that is not using its maximum capacity, will transfer in less time between a network share and a local disk than a fixed VHD of equivalent maximum size.
Although rare, you may consider using dynamically expanding VHDs in production environments if 1) all of the content of the dynamically expanding VHD can be regenerated from other sources and 2) critical data is stored on volumes outside the dynamically expanding VHD.
What does it mean to create, attach, and detach VHDs?
The disk management tools (the DiskPart command-line tool and the Disk Management console) allow you to create, attach, and detach VHDs.
• Create. You can create a new VHD with a type and size that you specify. When you first create a VHD, it is similar to an uninitialized hard disk drive. You can create one or more partitions in the VHD and format the partition(s) by using FAT, ExFAT, or NTFS.
• Attach. Attaching a VHD activates the VHD so that it appears on the host computer as a local hard disk drive. This is sometimes called “surfacing a VHD” because the VHD is now visible to users. If the VHD already has a disk partition and file system volume when you attach it, the volume inside the VHD is assigned a drive letter. The assigned drive letter is then available for use, similar to when you insert a USB flash drive into a USB connector. All users (not just the current user) can use the attached VHD in the same way they use other volumes on local physical hard disk drives (depending on security permissions). Furthermore, because you can attach a VHD that is located on a remote server message block (SMB), you can manage your images remotely.
• Detach. Detaching a VHD stops the VHD from appearing on the host computer. When a VHD is detached, you can copy it to other locations.
Are there any restrictions that I should be aware of when attaching VHDs?
Note the following restrictions for attaching VHDs:
• You must have volume management privileges (which is granted by default only to administrators) to attach a VHD because attaching a VHD is equivalent to bringing a hard disk drive or volume online.
• You can only attach a VHD that is located on an NTFS volume. However, if you already have a VHD file, you can place the file on any FAT, ExFAT, NTFS, or UDFS volume for storage or transfer.
• You cannot attach a VHD that has been compressed by NTFS or encrypted using Encrypting File System on the host volume. However, you can compress or encrypt the volumes inside the VHD if compression and encryption are otherwise supported.
• You cannot configure two attached VHDs to be a dynamically expanding VHD. A dynamically expanding VHD is a physical disk that you have initialized for dynamic storage. It contains dynamic volumes such as simple, spanned, striped, or mirrored volumes or RAID-5 volumes.
• You cannot attach a VHD located on a network file system (NFS) or File Transfer Protocol (FTP) server. However, as mentioned previously, you can attach a VHD that is located on a Server Message Block (SMB) share.
• You cannot use client-side caching on the remote SMB share to attach a VHD. If you use a network file share to store VHD files that you want to attach remotely, change the caching properties of the share to disable automatic caching.
• You can only attach two nested VHDs. When you create a VHD within another VHD, it is referred to as a nested VHD. The limit for nested VHDs is two. That is, you can attach a VHD within another attached VHD, but you cannot attach a third.

For example, you have a fixed VHD on a computer at C:\vhd\ExampleFixed.vhd. Inside the ExampleFixed.vhd, you create a partition, initialize an NTFS file system volume, and assign the drive letter M to the volume. You then create another VHD at M:\vhd\NestedFixed.vhd. The NestedFixed.vhd file is called a nested VHD because it is created on the file system volume inside the first VHD. If you attach both VHDs (C:\vhd\ExampleFixed.vhd and M:\vhd\NestedFixed.vhd), then both N: and M: drives would be available on the computer for users to use.
• When an operating system restarts, VHDs that were attached before reboot are not automatically attached. If you native boot to a VHD, only the file system partitions contained in the VHD are automatically attached. If there are other VHDs on the physical volume that were attached during a previous boot, they are not automatically attached.
What are the recommendations for using VHDs for native boot?
You should use the following best practice when using VHDs for native boot.
• Store all critical data outside the native-boot VHDs. When you store critical data outside the VHD that contains the Windows boot image, it is easier to recover the data if the VHD becomes unusable.
• Use fixed VHDs for production environments. You can use all three VHD file types (fixed, dynamically expanding, and differencing) to native boot, but we recommend using fixed VHDs for production and using dynamically expanding or differencing VHDs for development and test environments.
• Create VHD files with a maximum size that is larger than the minimum disk requirements for the operating system. When you create a VHD that is used for native boot, the maximum size of the VHD must be larger than the minimum disk space requirements for the operating system that you intend to deploy. The minimum disk space requirements are 16 GB for Windows 7 and 10 GB (but 40 GB is recommended) for Windows Server 2008 R2. The VHD contains additional information about the virtual disk, so you need to add approximately 100 MB when determining the maximum size of the VHD.
• Ensure that there is sufficient space on the host volume for paging files (Pagefile.sys). During native boot, a dynamically expanding VHD is automatically expanded to the maximum size on the host volume, and the paging file is created on the host volume outside the virtual volume. The paging files must be located on a physical volume outside the VHD for system performance. If the host volume does not have enough free space for a paging file, Windows attempts to find free space on another volume. The paging file size depends on how much physical RAM is available on the system (you should estimate approximately 5 GB of available space in addition to the maximum size of the VHD file).
Note
When Windows is running on a virtual machine, a paging file is created inside the VHD because the system volume in the virtual disk can be used for paging.
• Run Sysprep to generalize the image before using a VHD for native boot on a different computer. Sysprep generalize prepares a Windows image that is installed on a physical partition or on a native boot VHD that is to be used on another computer. After you run Sysprep, you can copy the VHD to multiple physical computers or virtual machines for native boot. During the first boot from the VHD, Windows completes the specialize configuration pass to detect the hardware devices and initializes Windows to run on the new computer.
What is not supported for native boot when using VHDs?
Native boot VHDs do not support all of the features that are available when Windows is installed or deployed to a physical disk. You may need to consider the limitations of booting Windows from a VHD when you are planning how to deploy Windows for your environment. The following scenarios are not supported for native boot using VHDs:
• Using VHDs to native boot with previous versions of Windows. Windows Vista® and Windows Server 2008 (and previous versions of Windows) do not support native boot. Native boot VHD requires significant changes to the operating system and these changes are new in Windows 7.
• Hibernating to conserve power. An operating system that is booted from a VHD image does not support hibernation. Native boot is primarily targeted to Windows Server or managed desktops, and development and test computers where hibernation is not a critical feature.
• Using compressed or encrypted VHDs for native boot. VHDs that have been compressed by NTFS or encrypted using Encrypting File System on the host volume are not supported for native boot.
• Configuring native VHD boot if the host volume is protected by BitLocker. You can save a VHD file on a file system that is protected by BitLocker™, but you cannot use the VHD for native boot or enable Bitlocker on the volume(s) that are contained inside a VHD.
• Booting to a VHD that is located on a remote share or a USB flash drive. Windows does not support booting to a remote share or a USB flash drive, whether installed on a physical volume or from a VHD. You can boot the Windows Preinstallation Environment (Windows PE) from a USB flash drive, which is supported for Windows deployment. Windows PE typically boots from either a Boot.wim or an installed image, but booting Windows PE from a VHD is not supported.
• Upgrading the operating system booted from a VHD. If you boot from a VHD, you cannot upgrade the Windows version in the VHD to a newer version.
Tags : Add a tag

Community Content
Add new content
Annotations
Creating VHD in a Folder That Inherits NTFS Compression Attribute Exotic Hadron | Edit | Show History

If your drive has NTFS compression applied and you are trying to create a new VHD drive like
DISKPART>create vdisk file=c:\vhdfolder\folder\my.vhd type=expandable maximum=60000
you'll end up with a warning message that says creating failed because you are using a non-NTFS partition or creating a compressed VHD. Try using
compact /U /S /A x:\vhdfolder\
before creating the VHD
Tags : compression; (x) create (x) failure; (x) ntfs (x) vhd (x) Add a tag
Flag as ContentBug
Conflicting statements Madhur Ahuja | Edit | Show History

This article says something different. What's our take ?

http://technet.microsoft.com/en-us/library/dd799282(WS.10).aspx

Bitlocker cannot be used to encrypt the host volume containing VHD files used for native VHD boot, and bitlocker cannot be used on volumes contained inside a VHD.
Tags : contentbug (x) Add a tag
© 2011 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement


More about : vhd bootable usb

October 10, 2011 2:39:12 PM

Uh, what's your question?
October 10, 2011 3:04:45 PM

maybe next time just a link to the article would be nice
October 10, 2011 3:27:15 PM

i could not find the link

its not like a newspaper

there is not a cost per inch
!