How to Install and Boot Windows 11 from VHDX

Booting Windows 11 directly from a VHDX (Virtual Hard Disk v2) file enables you to run a fully functional secondary operating system on bare-metal hardware without repartitioning your physical drives. This guide covers how to create a dynamic VHDX, apply a clean Windows 11 installation image using the DISM command-line tool, and configure the Windows Boot Manager to enable dual-booting into the virtual drive.

Prerequisites


Step 1: Create and Mount the VHDX File

  1. Open the Start Menu, search for Command Prompt, right-click it, and select Run as administrator.

  2. Launch the disk partitioning tool:

    diskpart
  3. Create a folder to store the VHDX (e.g., C:\VHD) and execute the following commands to create and mount a dynamically expanding 64 GB virtual disk:

    create vdisk file="C:\VHD\Windows11.vhdx" maximum=65536 type=expandable
    select vdisk file="C:\VHD\Windows11.vhdx"
    attach vdisk
    create partition primary
    format fs=ntfs quick label="Win11_VHDX"
    assign letter=V
    exit

Step 2: Extract and Apply the Windows 11 Image

  1. Double-click your downloaded Windows 11 ISO to mount it. Note the assigned drive letter (for this example, assume drive E:).

  2. Check the available Windows editions inside the image file by running:

    dism /Get-WimInfo /WimFile:E:\sources\install.wim

    (Note: If your ISO uses install.esd, replace install.wim with install.esd.)

  3. Identify the index number corresponding to your desired edition (e.g., Windows 11 Pro is commonly Index 6).

  4. Apply the image directly to your mounted VHDX drive (V:):

    dism /Apply-Image /ImageFile:E:\sources\install.wim /Index:6 /ApplyDir:V:\

    Wait for the progress bar to reach 100%.


Step 3: Add the VHDX to the Windows Boot Menu

  1. Update the Boot Configuration Data (BCD) store to recognize the new Windows installation:

    V:\Windows\System32\bcdboot V:\Windows
  2. Once the command returns Boot files successfully created, detach the VHDX by returning to Diskpart:

    diskpart
    select vdisk file="C:\VHD\Windows11.vhdx"
    detach vdisk
    exit

Step 4: Boot into the Secondary Windows 11 System

  1. Restart your PC.
  2. When the blue boot selection screen appears, choose the newly added Windows 11 entry.
  3. Complete the standard Out-of-Box Experience (OOBE) setup, such as region, keyboard layout, user account creation, and network configuration.

The secondary Windows 11 operating system will now run directly from the VHDX container while accessing your physical CPU, GPU, and system RAM with native performance.