Skip to main content

Enable Boot to VHD with BIOS and GPT

Applies to: Windows 10 Technical Preview, Windows 8.1, Windows 8, Windows 7

Scenario

Consider the following scenario: you have a PC running Windows 7 or newer and would like to configure dual boot for a secondary Windows environment, such as an evaluation or preview version of Windows 10. The PC uses BIOS or legacy boot mode, i.e. the compatibility support module (CSM) is enabled. You have a secondary disk from which you would like to boot the secondary Windows environment, but this disk uses the GUID Partition Table (GPT), which is required for partitions larger than 2 terabytes (TB) in size. In this scenario, the secondary Windows environment will not install to a partition on the GPT disk because BIOS or legacy boot systems require the boot volume to be located on a disk partitioned with master boot record (MBR).

Solution

You can use a virtual hard disk (VHD) to provide a boot volume that is based on MBR, but also store the data on the secondary drive that uses GPT. The basic steps are as follows:

  1. Create a MBR-partitioned VHD on the GPT drive.
  2. Apply the installation image for the secondary Windows environment to the VHD.
  3. Set the second Windows environment to boot.

Create an MBR-partitioned VHD

  1. Open Disk Management:
    1. On Windows 7, right click on Computer from the Start Menu or Windows Explorer and select Manage. Then expand the Storage tree and select Disk Management.
    2. On Windows 8.1, right click the Start button and select Disk Management from the menu.
  2. Select Create VHD from the Action menu to launch the Create and Attach Virtual Hard Disk dialog.
    1. Specify the desired location of the VHD folder on the GPT disk.
    2. Specify the desired size of the created VHD.
    3. If using Windows 8 or newer, specify VHD or VHDX.
      note iconNote: VHDX is not compatible with Windows 7 and thus is not available on systems running Windows 7.
    4. Specify Fixed size or Dynamically expanding. Fixed size drives will allocate the entire size of the virtual hard disk at the time of creation, which takes more room, but provides the best performance. Dynamically expanding drives are initially small files, but grow larger as data is added to them up to the size specified for the drive. This uses less storage space, but can result in fragmentation of data, and thus decreased performance.
  3. After creation, the VHD will automatically be attached, the disk icon in Disk Management will appear tinted a blue color to distinguish that the disk is virtual.
  4. Right click the disk and select Initialize Disk to prepare the disk for use.
  5. Specify the MBR partition style for initializing the disk.
  6. Once the disk is initialized, right click in the unallocated space next to the disk and select New Simple Volume to launch the New Simple Volume Wizard.
    1. The volume size can be left at the default, which will occupy the whole disk.
    2. Assign the drive letter V to the volume.
    3. Format the partition as NTFS and label it as desired.
  7. Close Disk Management.

Apply the Windows Image

note iconNote: The process to apply an operating system to the VHD requires access to the Deployment Image Servicing and Management (DISM) tool. For Windows 8 and newer, this tool is included in the operating system. For Windows 7 it can be installed with the Windows Assessment and Deployment Kit (Windows ADK).
  1. Insert or mount the installation media for the secondary environment. The disk image can also be extracted to a folder.
  2. Launch an administrative Command Prompt or PowerShell session.
  3. Enter the following command to apply the install.wim file from the Sources folder of the installation media to the VHD mounted at drive letter V:

    DISM /Apply-Image /ImageFile:D:\Sources\install.wim /Index:1 /ApplyDir:V:\

    note iconNote: If you have rebooted since the creation of the VHD, the VHD (V:) may no longer be attached. In this case, launch Disk Management and select Attach VHD from the Actions menu to attach the VHD before running this command.
  4. Close the Command Prompt or PowerShell session.

Configure Boot Options

  1. Launch an administrative Command Prompt or PowerShell session.
  2. Change the directory to the System32 folder of the secondary Windows environment using the following command:

    CD V:\Windows\System32

  3. Enter the following command to instruct of the secondary Windows environment to add its boot files to the system partition for dual boot:

    BCDBoot V:\Windows

  4. Close the Command Prompt or PowerShell session and reboot the computer.

You should now be presented with a prompt to select between the existing operating system and the secondary Windows environment when the computer boots.