how to Boot into a vhdx file


  1. Posts : 109
    Windows 10 pro
       #1

    how to Boot into a vhdx file


    Hi
    I have created a VHDX file attached it and cloned a copy of widows onto it ( which includes the boot sector)?
    What I want to do is add this to my boot menu and see if it works.

    I've read lots of tutorials but they mostly concentrate on making the VHDX file.

    I am a bit confused I just want to know how to add it to the boot menu.
    I rather use a gui editor like BCedit if I can.

    can anyone advise me please?

    Thanks

    Mike
      My Computer


  2. Posts : 43,022
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, there's this, but for vhd files:
    Hyper-V - Native Boot VHD
      My Computers

  3.   My Computer


  4. Posts : 17,661
    Windows 10 Pro
       #4

    dalchina said:
    Hi, there's this, but for vhd files:
    Hyper-V - Native Boot VHD
    Just to clarify: the tutorial explains how to a add a Virtual Hard Disk file (VHD) to dual boot, regardless if it's a .vhd or .vhdx.

    In addition, this video from Ten Forums video thread shows how to do it:



    The easiest possible method to dual boot. No partitioning, no virtualization required. Deploy Windows 10 on a virtual hard disk VHD or VHDX file, add it to boot menu. When done, when you no longer want to dual boot, just delete the VHD file.
    Note   Note
    When creating VHD file to be used in native boot, always use MBR partitioning! To upgrade Windows on native boot VHD, it must be temporarily attached to a virtual machine. An MBR partitioned VHD is easy to attach to VM, it only needs Windows partition to be marked active, whereas a GPT partitioned VHD with only a single partition for Windows requires manually creating system partitions before it can be used on VM.

    If you for any reason want to use a GPT partitioned VHD in native boot (can't think any valid reason!), it is better and recommended that you first create a Generation 2 VM in Hyper-V, installing Windows 10 on it. This takes care of the partitioning, doing it correctly. The VHD can then be used as native boot VHD, or on a VM.

    See this tutorial for more information: Native boot Virtual Hard Disk - How to upgrade Windows

    The DISKPART script and deployment batch from video:

    DISKPART scripts are normal text files with extension .txt. To run a DISKPART script, enter following command:

    diskpart /s DRIVE:\FOLDER\SCRIPT.TXT

    Here's the script used in video:
    Code:
    create vdisk file=F:\W10PRO.vhdx maximum=51200 type=expandable
    attach vdisk
    create part primary
    format quick label="Windows"
    assign letter=W
    exit
    Save script as VHDConfig.txt

    Above script creates a dynamically expanding MBR partitioned 50 GB (51,200 MB) VHDX file (you can use .vhd or .vhdx) named W10PRO.vhdx in root of drive F:, labels it Windows and assigns it a temporary drive letter W:. Edit script to meet your needs, be sure the drive you create VHD has double the free storage than the size of VHD; if you will create a 100 GB VHD file to be used in dual boot, the drive where it will be created needs 200 GB free.

    Also, be sure to assign an unused drive letter! I always use W: which I have reserved for this purpose, never assigning it to anything else. In any case the drive letter will only be needed for deployment, it will be freed when VHD will be unmounted.

    The deployment batch is really simple, too. It just runs DISKPART script to set up VHD, deploys Windows on it with DISM, adds it to host boot menu and finally changes the boot menu entry to something more descriptive:
    Code:
    start /wait diskpart /s E:\Users\Kari\Scripts\VHDConfig.txt
    start /wait dism /apply-image /imagefile:I:\sources\install.wim /index:8 /applydir:W:\
    start /wait bcdboot W:\Windows
    start /wait bcdedit /set {default} description "W10 PRO EN-GB (VHD)"
    cls
    @echo off
    echo. 
    echo Windows deployed to VHD file
    echo and added to host boot menu.
    echo.
    pause
    exit
    Save batch file as VHDBoot.bat

    Again, edit the batch to meet your needs. Be sure path to DISKPART script is correct, and that path to install.wim (or in case of MCT ISO install.esd) is correct in DISM command. Select correct index value. Check that BCDBOOT will add Windows to boot menu from correct disk, the drive letter here must be the same DISKPART script assigned to VHD.

    Kari
      My Computer


  5. Posts : 109
    Windows 10 pro
    Thread Starter
       #5

    Thanks all ! very handy links ..

    Have succeeded in creating and adding VHDX file to boot loader. works well

    Mike
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:18.
Find Us




Windows 10 Forums