Windows 10: Hyper-V - Native Boot VHD

Discus and support Hyper-V - Native Boot VHD in Windows 10 Tutorials to solve the problem; How to: Hyper-V - Native Boot VHD [img] Information First a quote from Microsoft Developer Network's (MSDN) support article: Native Boot... Discussion in 'Windows 10 Tutorials' started by Brink, Jun 16, 2016.

  1. Brink
    Brink New Member

    Hyper-V - Native Boot VHD


    How to: Hyper-V - Native Boot VHD

    Hyper-V - Native Boot VHD [​IMG]
    Information First a quote from Microsoft Developer Network's (MSDN) support article:

    As you most probably already use Hyper-V and have a version or two of Windows installed on its virtual machines (judging by the fact that you found here), we can use a shortcut simplifying the process and use already existing VHD files of your Windows virtual machines.

    There's nothing wrong in running your Windows virtual machines as intended in Hyper-V. However, sometimes you might want unrestricted access to physical hardware on your host machine. Native boot gives you exactly that: when a VHD with Windows installed on it is used for native boot in a dual / multiple boot scenario, it will no longer use Hyper-V emulated, virtualized hardware devices but is instead as any operating system installed directly to physical hardware.

    In this tutorial we will add a Windows 10 Pro virtual machine's virtual hard disk file to my Windows 10 boot menu, to be able to choose which of the two Windows systems will be started when the machine will be booted.

    The tutorial might look a bit complicated but I assure you, this is really easy and fast. You set up your virtual machine's VHD for native boot in a minute Hyper-V - Native Boot VHD :).


    Hyper-V - Native Boot VHD [​IMG]
    Note Notice that you can use the method told in this tutorial on both BIOS (MBR) and UEFI (GPT) systems, mounting both MBR partitioned Generation 1 VHD files and GPT partitioned Generation 2 VHD files regardless if the host is MBR or GPT partitioned.

    A VHD from Generation 2 UEFI vm can boot natively on a BIOS (MBR) host, and a VHD from Generation 1 BIOS vm boots without an issue on UEFI (GPT) host.

    This method can be used to natively boot VHD files from Hyper-V virtual machines running Windows 8.1, Windows 10, Windows Server 2012 R2 or Windows Server 2016.


    Contents
    Use links below to jump to any part of this tutorial, back button of your browser to return to this list.

    [table][tr][td]Part One:[/td] [td]Preparations[/td] [/tr] [tr][td]Part Two:[/td] [td]Add VHD to boot menu[/td] [/tr] [tr][td]Part Three:[/td] [td]Remove VHD from boot menu[/td] [/tr] [tr][td]Part Four:[/td] [td]Troubleshooting, reset boot menu[/td] [/tr] [/table]


    Hyper-V - Native Boot VHD [​IMG]
    Note Click or tap screenshots in this tutorial to pop them out, click / tap again to enlarge.




    Part One [/i] Preparations

    Some theory first. It's important but don't panic, I will keep it short!


    Hyper-V - Native Boot VHD [​IMG]
    Information A Hyper-V virtual machine when created and before any checkpoints have been made consists of one VHD or VHDX file, a Virtual Hard Disk file. Later on when you for security or other purposes make checkpoints, Hyper-V adds a so called child VHD to the vm. As geeks love difficult words, we say this vm is from now on using differencing disk. It means that we have a base disk (also called parent disk), in Hyper-V usually a .vhdx file, and for that base a child disk with extension .avhdx, letter A coming from word automatic meaning it is managed automatically by Hyper-V without user interaction. In other words, keep your hands away, don't move, rename or delete them manually, only use Hyper-V Manager for any changes.

    Here's a screenshot of a typical Hyper-V vm (#1) and its checkpoints (#2), I have also pasted an extract from my virtual hard disk folder into this screenshot (#3):
    Hyper-V - Native Boot VHD [​IMG]


    I created the vm and installed Windows in a .vhdx file (yellow highlight). When I made first checkpoint, the differencing data was stored in first .avhdx file (blue highlight), next checkpoint created again a differencing .avhdx to store changes since first checkpoint and so on.

    To get our vm to boot natively outside Hyper-V, we need to merge existing checkpoints (child disks) to base disk (parent). Native boot with a VHD or VHDX file is only possible if it has no child disks. Unfortunately this also means that when you remove the VHD or VHDX from native boot menu and continue using it in Hyper-V, you no longer have any checkpoints and can't restore the vm to earlier state.

    Think how important your checkpoints are, you wont get them back once deleted and merged to parent!

    1.1) If the vm you want to use in native boot has any checkpoints, select the first checkpoint, right click and select Delete Checkpoint Subtree to remove all checkpoints. Hyper-V merges the data they contain to base disk and finally removes the child disks:

    Hyper-V - Native Boot VHD [​IMG]


    1.2) You can leave the .vhd or .vhdx file in its current location, or copy it to another drive. You can even copy the virtual hard disk to another computer and use it on that computer for native boot. If your intention is to continue using it also in Hyper-V in addition to native boot, leave it where it is

    1.3) Download and install the free Macrium Reflect. Although mostly known of its disk imaging and cloning capabilities, Macrium also offers the easiest way to fix Windows boot records. We will use it later in Part Four to reset Windows boot records and boot menu

    Macrium Reflect Free download: Macrium Reflect Free




    Part Two [/i] Add VHD to boot menu

    2.1) Open your virtual hard disks folder, default location if you have not changed it in Hyper-V settings is C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks

    2.2) Double click the VHD file you want to boot natively and add to boot menu. This mounts the VHD on your host system. In this example I have copied the virtual hard disk to another computer and double click it to mount it to the host system:
    Hyper-V - Native Boot VHD [​IMG]


    2.4) Windows now mounts all partitions of this disk to host. Because the Hyper-V vm on this disk was setup as Generation 1 (BIOS / MBR partitioning), my host now shows two new drives, drive G: which is the system reserved partition of Windows 10 installation on that virtual hard disk, and drive H: which is the Windows partition of that installation:
    Hyper-V - Native Boot VHD [​IMG]


    Notice that the VHD will be automatically unmounted when we restart in step 2.9; it only needs to be mounted now to be added to boot menu, later on there's no need to mount it.

    2.5)
    Old school geek as I am, I always need to check. I open drive H: to see it really contains the virtual Windows 10 installation I want to use in native boot:
    Hyper-V - Native Boot VHD [​IMG]


    2.6) Open an elevated (admin) Command Prompt, type bcdboot H:\Windows and press Enter (replace drive letter H with actual drive letter for the mounted virtual hard disk containing Windows):
    Hyper-V - Native Boot VHD [​IMG]


    2.7) To prepare for the unexpected, to easily restore the default boot records let's not continue before we have added Macrium Rescue WinPE system to the boot menu. Start Macrium Reflect, open Other tasks menu, select Add Recovery Boot Menu Option:
    Hyper-V - Native Boot VHD [​IMG]


    2.8) Select Windows PE 10.0 menu and click OK, accept all possible prompts:
    Hyper-V - Native Boot VHD [​IMG]


    2.9) Restart Windows. You will be shown the Windows 10 boot menu
    Hyper-V - Native Boot VHD [​IMG]


    Optional:

    Hyper-V - Native Boot VHD [​IMG]


    Hyper-V - Native Boot VHD [​IMG]


    2.10) The physical PC, a laptop in this case has now been booted with a virtual hard disk from a Hyper-V virtual machine. It now uses the physical hardware and can access all host machine resources. Our virtual Windows is now physical (blue highlighted disk), with access to original host Windows hard disks (yellow):
    Hyper-V - Native Boot VHD [​IMG]


    2.11) If we check Disk Management we will see that the VHD was added as last hard disk, in this case Disk 3. Checking its properties we can clearly see that we are dealing with a virtual disk:
    Hyper-V - Native Boot VHD [​IMG]


    OK, let's boot back to host, the original Windows installation by restarting and selecting it from boot menu

    2.12) For your own comfort it might be a good idea to rename boot menu operating systems, the boot menu showing two identical "Windows 10" entries can be confusing. To do that open an elevated (admin) Command Prompt, type bcdedit and hit Enter.

    Boot records will be shown. Scrolling down the list you will find an entry titled Windows Boot Loader for each of our three operating systems. We are interested in three details on each entry: Identifier (yellow highlight in below screenshot), Device (blue) and Description (green):
    Hyper-V - Native Boot VHD [​IMG]


    2.13) As we have two identical "Windows 10" entries, lets change the VHD entry's name to something more descriptive. Checking the Device type in all three entries we can see that our VHD's Identifier is {default}.

    The command syntax to change the boot menu description is bcdedit /set {Identifier} description "AnyName". In this example I changed its name to My VHD with command bcdedit /set {default} description "My VHD":
    Hyper-V - Native Boot VHD [​IMG]


    Looking better, easier to understand which entry starts what OS:
    Hyper-V - Native Boot VHD [​IMG]


    Hyper-V - Native Boot VHD [​IMG]
    Tip Interested in testing latest Insider Build?

    If you are not a Windows Insider but would like to test the latest Windows Insider build to help you decide if opting in to Insider builds would be something for you, you can do it even if you have never had or used Hyper-V or would not even like to set it up.

    You can download free 90 day trial Hyper-V Windows 10 virtual machines from Microsoft, both the latest official release (build 10586 when writing this) and latest Insider build (14366).
    Hyper-V - Native Boot VHD [​IMG]


    See this thread for download instructions: Windows 10 virtual machines now available on Microsoft Edge Dev - Windows 10 Forums

    You don't have to setup any virtualization software, nor do you need install anything, instead when you have downloaded the vm, mount the VHD it contains as told above and you can dualboot to your chosen Windows 10 build for 90 days, for free Hyper-V - Native Boot VHD :)





    Part Three [/i] Remove VHD from boot menu
    3.1) I played with another VHD, this time Windows 8.1 but would like to remove it now from boot menu:
    Hyper-V - Native Boot VHD [​IMG]


    3.2) Open elevated (admin) Command Prompt, type bcdedit and hit Enter, browse to Windows Boot Loader entry you want to remove, note the identifier (Windows 8.1 VHD identifier highlighted):
    Hyper-V - Native Boot VHD [​IMG]


    3.3) Type bcdedit /delete {Identifier}, hit Enter to remove the VHD from boot menu:
    Hyper-V - Native Boot VHD [​IMG]



    Hyper-V - Native Boot VHD [​IMG]
    Note There are three different identifiers: The chosen default OS has identifier {default}, the current OS you are signed in at the moment is {current}. All other entries have a long hexadecimal identifier, as in this example the Windows 8.1 VHD identifier above.

    Typing these long hexadecimal strings is both boring and also might easily be typed wrong. In Command Prompt you can just select the string with mouse and hit Enter to copy it to Clipboard, then paste it to your command.




    Part Four [/i] Troubleshooting, reset boot menu

    4.1) Anything can happen. A restart can suddenly show this when you select an OS from boot menu (in screenshots current Windows 10 recovery prompt and old style legacy prompt which can be shown depending on if you have manually changed to legacy boot menu, or added Windows 7 or older OS on multi boot system):
    Hyper-V - Native Boot VHD [​IMG]



    Hyper-V - Native Boot VHD [​IMG]


    This does not happen often but when it happens you might be unable to boot to any of the installed operating systems except Macrium WinPE rescue system which we added to boot menu in steps 2.7 and 2.8​.

    In modern prompt, press F9 to open boot menu. In old style prompt press Enter. You can now select another operating system from menu, or use Macrium to fix boot records as told below (if you did not add Macrium to Windows Boot Menu, restart your PC now booting from Macrium boot disk / USB and continue from 4.3).

    4.2) Select Macrium Reflect System Recovery and hit Enter:
    Hyper-V - Native Boot VHD [​IMG]



    Hyper-V - Native Boot VHD [​IMG]


    4.3) When Macrium has started, select Fix Windows boot problems top left:
    Hyper-V - Native Boot VHD [​IMG]

    (Screenshot from a BIOS system, process exactly the same in UEFI.)

    4.4) Click Next:
    Hyper-V - Native Boot VHD [​IMG]


    4.5) Click Next:
    Hyper-V - Native Boot VHD [​IMG]


    4.6) Click Finish:
    Hyper-V - Native Boot VHD [​IMG]


    4.7) Click Yes:
    Hyper-V - Native Boot VHD [​IMG]


    4.8) Windows boot records have been reset, your original physical Windows 10 installation will start, no boot menu is shown.

    To continue playing with native boot you have to add your VHD files again as well as the Macrium rescue boot option as told in Part Two.


    Hyper-V - Native Boot VHD [​IMG]
    Note When boot records have been reset with Macrium as told in Part Four above, your Hyper-V virtual machines might not start telling you that one of the Hyper-V components is not running:
    Hyper-V - Native Boot VHD [​IMG]


    By reseting boot records Macrium has caused the hypervisor not to work properly. Luckily this is not an issue, we can fix it easily. Simply give this command in an elevated Command Prompt and restart your Hyper-V host PC:

    Code:
    Hyper-V virtual machines will again run without issues.


    Hyper-V - Native Boot VHD [​IMG]
    Information You can naturally also reset your boot records whenever you want to, when you no longer want to boot to your VHD files.

    Notice that you can update Windows on the natively booted VHD normally, install software, do everything else but you cannot upgrade it to next builds:
    Hyper-V - Native Boot VHD [​IMG]


    When / if you want to upgrade, boot to your original host OS, run the VM in Hyper-V and upgrade. When done you can again boot to it using the method told in this tutorial.


    Hyper-V - Native Boot VHD [​IMG]
    Note One third joking, two thirds seriously:

    If something happens when you are playing with native boot and you come back posting "Help! I can't boot to Windows anymore!", my only advice will be to boot to Macrium rescue system as told in the tutorial and reset boot records. It works every time being a life saver when PC can't boot to any operating system.

    In case you will then reply with "It's not there, I forgot to add Macrium to boot menu!", I don't even bother to respond!


    That's it geeks! Happy computing Hyper-V - Native Boot VHD :)

    Kari


    Related Tutorials

    :)
     
    Brink, Jun 16, 2016
    #1
  2. MardAZ Win User

    Windows 10 VHD Native Boot Installation--Officially Supported?

    Randy, thank you for the reply. However Client Hyper-V is not the same as VHD Native Boot. I have not seen any Microsoft statement that Windows 10 officially supports VHD Native Boot. If you find any indication that it does, I would like to hear about
    it.
     
    MardAZ, Jun 16, 2016
    #2
  3. Windows 10 product key erroneously blocked

    The Hyper-V virtual machine and the Native boot VHD on your physical computer are considered to be two separate devices per the Microsoft Software Licensing Terms, therefore you'll have to obtain another license for the copy of Windows 10 installed on
    the Native boot VHD file, and then reactivate said copy.
     
    Dan1986ist, Jun 16, 2016
    #3
  4. Hyper-V - Native Boot VHD

    Nice way to native boot if you have existing VMs.

    One typo though
    2.4) Windows now mounts all partitions of this disk to host. Because the Hyper-V vm on this disk was setup as Generation 1 (BIOS / MBR partitioning), my host now shows two new drives,
    drive H: which is the system reserved partition of Windows 10 installation on that virtual hard disk, and
    drive H: which is the Windows partition of that installation:
    G: System Reserved
    H: Windows partition
     
    Slartybart, Jun 16, 2016
    #4
  5. simrick Win User
    Nice Kari. Maybe this is a way to get round my NIC problems in Hyper-V. *Smile
     
    simrick, Jun 16, 2016
    #5
  6. Kari Win User
    Booting natively to your vm's VHD, it uses the real physical hardware of your PC, in other words it uses the NIC directly without a virtual switch.
     
  7. lx07 Win User
    Good job Kari, a couple of points about native booting VHD which keep coming up - you can't upgrade them while booted natively - this must be done through Hyper-V (or whatever). Secondly you must have enough disk space to allow the VHD to expand to its maximum size (this could be an issue if you kept Hyper-V's default 127GB disk size).
     
  8. Mystere Win User

    Hyper-V - Native Boot VHD

    Actually, I've been doing this with Windows 7 for about a week. Problem is, performance has been excruciatingly slow. The disk is just being hammered constantly. This is on an i7 with 32GB of memory. I even disabled the page file to see if that was causing the problem, and while it helped performance a bit, it is still very very slow (takes 10 minutes to boot, 15 minutes to open Outlook, etc...

    All the benchmarks I've seen show that VHD's only have a small (single digit) percentage performance loss over native disk access, but my experience has been far worse.
     
    Mystere, Jun 17, 2016
    #8
  9. Kari Win User
    I have to comment that before possible readers of this thread get a wrong idea:

    Mystere is talking in his above quoted post about a Windows 7 host machine natively booting to a guest OS on a VHD, I assume by creating a VHD file at boot and installing OS on it as told in this tutorial on our sister site: Virtual Hard Drive VHD File - Create and Start with at Boot - Windows 7 Help Forums

    This tutorial however is about Windows 10 and Hyper-V, creating first a vm in Hyper-V then adding the VHD of it to host boot menu in dual boot, to boot VHD on physical hardware. The performance difference compared to a "real" OS is so insignificant you will most probably not even notice it.
     
  10. Mystere Win User
    Maybe i'm misunderstanding. Your tutorial seems to be doing exactly that. Or is the key difference that you're installing the OS in Hyper-V and then natively booting afterwards, rather than installing the OS to VHD?

    Regardless the OS is no longer a "guest". It's the native OS, running on a VHD, and is exactly the same scenario regardless of how it got installed.
     
    Mystere, Jun 17, 2016
    #10
  11. Kari Win User
    It seems that you didn't bother to read the tut.

    In my opinion the tutorial, starting from it's name very clearly tells we are not talking about creating a VHD at boot and then installing OS on it:
    Hyper-V - Native Boot VHD [​IMG]


    I am not a teacher nor a professional writer, with my limited capacity and especially as I am using a foreign language (English) I am not able to make the purpose of the tutorial any clearer. If you have ideas how to explain the purpose of this tut more clearly, please let me know.



    Not only do I think you did not even read the tutorial but I also think you have not tested the method told in the tutorial in Windows 10. There's a huge difference compared to native boot in Windows 7.

    I hope that possible readers of this will not take your comments too seriously.

    A very sincere
     
  12. Cliff S New Member
    @Kari, I decided to ask here instead of on Skype, incase someone else had the same question in the future(or at least thought about it).

    Do you know about the wubi installer for Ubuntu?WubiGuide - Ubuntu Wiki
    I believe it has been depreciated now(in any case it doesn't work on Windows 8 and higher), but there used to be two ways to install Ubuntu.
    One- install it as either a dual boot or alone.
    Two- use wubi and install it inside of Windows, and it would add a boot option INSIDE of Windows bootloader/boot menu, instead of using GRUB.

    Now the question, is this how wubi worked/"installed" Ubuntu?
    Or at least the same principal?


    Hyper-V - Native Boot VHD [​IMG]



    Hyper-V - Native Boot VHD [​IMG]
     
    Cliff S, Jun 17, 2016
    #12
  13. Cliff S New Member

    Hyper-V - Native Boot VHD

    Note to above,
    Interestingly you could uninstall Ubuntu in Programs and Features.
    If it created a virtual disk, then the uninstaller probably just deleted the virtual disks, and ran bcdedit.
     
    Cliff S, Jun 17, 2016
    #13
  14. lx07 Win User
    I've done both (installing direct to VHD with DISM as in the link at the top of the tutorial and creating VHD through Hyper-V or VirtualBox). It makes no difference as you end up with same thing unless there is some difference in the internal structure of the VHD (it is only a container). In any case I've noticed no perceptible drop in performance booting VHD (I have 10 installed) compared to normal boot whatever method is used to create it.

    As far as I know disk I/O is the only hardware that is abstracted when booting from VHD. What you could try therefore is to update the files in your system partition to 10 (using PE or something) - this is what contains the BCD store and the drivers to allow identification/utilisation of the VHD/VHDX format. That is the only thing that could make a difference between 7 and 10 as it is only stuff in this partition that is required except from the VHD file itself.
     
  15. Kari Win User
    Honestly, I have not a faintest clue. Never used wubi, only installed Ubuntu once to get screenshots for a virtualization tutorial, removing it as soon as it was installed on a vm.


    I have similar experiences than Mystere. Windows 7 system, VHD created at boot and another OS installed on it having significant worse disk I/O speeds.

    As I moved from Windows 7 to 8 as soon as first preview version of 8 was released thereafter only running 7 on virtual machines, and again migrating from 8.1 to 10 as soon as first 10 TP was released, I admit now reading your explanation that my experience might be because due this "rapid" migration to new Windows versions not yet published to general public. Never updated Windows 7 system partition and BCD store.

    Anyway, your explanation makes sense.
     
Thema:

Hyper-V - Native Boot VHD

Loading...
  1. Hyper-V - Native Boot VHD - Similar Threads - Hyper Native Boot

  2. Problems uploading VHD to hyper V server

    in Windows 10 Customization
    Problems uploading VHD to hyper V server: Hello,I have installed a fresh bare metal Hyper V server . It has not joined a domainI have configured its management according to this https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/I am able to access it from a Windows...
  3. Problems uploading VHD to hyper V server

    in Windows 10 Gaming
    Problems uploading VHD to hyper V server: Hello,I have installed a fresh bare metal Hyper V server . It has not joined a domainI have configured its management according to this https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/I am able to access it from a Windows...
  4. Problems uploading VHD to hyper V server

    in Windows 10 Software and Apps
    Problems uploading VHD to hyper V server: Hello,I have installed a fresh bare metal Hyper V server . It has not joined a domainI have configured its management according to this https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/I am able to access it from a Windows...
  5. Reusing vhdx (native boot) in Hyper-V

    in Windows 10 Virtualization
    Reusing vhdx (native boot) in Hyper-V: Hey all, I created a .vhdx in disk management, initialised, new volume and formatted. Deployed Win 10 Insider 17754 to it using dism /apply-image etc. Updated the bcd store on main OS, booted to .vhdx natively no issues. Now since MSoft doesn't allow the upgrade to newer...
  6. How to convert VHD to VHDX using Hyper-V Manager

    in Windows 10 News
    How to convert VHD to VHDX using Hyper-V Manager: [ATTACH]If you have a VHD file and you want to convert it to VHDX format, you can use Hyper-V Manager to get it done. This […] This post How to convert VHD to VHDX using Hyper-V Manager is from TheWindowsClub.com. read more...
  7. Reusing vhdx (native boot) in Hyper-V

    in Windows 10 Installation and Upgrade
    Reusing vhdx (native boot) in Hyper-V: Hey all, I created a .vhdx in disk management, initialised, new volume and formatted. Deployed Win 10 Insider 17754 to it using dism /apply-image etc. Updated the bcd store on main OS, booted to .vhdx natively no issues. Now since MSoft doesn't allow the upgrade to newer...
  8. Compact a Hyper-V VHD

    in Windows 10 Virtualization
    Compact a Hyper-V VHD: I have Hyper-V VM with the Windows 10 Pro Technical Preview Build 9926 as the guest, and Windows 8.1 Pro as the host OS. I've been running it for 3 months now, with at least 2 build updates. But I can't compact the VHD. The used drive space on the VM guest is 16.8 GB, while...
  9. Can't native boot Hyper-V generation 2 vhdx

    in Windows 10 Virtualization
    Can't native boot Hyper-V generation 2 vhdx: If I create a generation 1 VM I can native boot the vhdx by adding bcd entry. If I make a generation 2 VM it fails with "a required device isn't connected...0xc0000225". Pressing f8 for "Startup Settings" gives "The application or operating system couldn't be loaded because a...
  10. Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD

    in Windows 10 Tutorials
    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD: How to: Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD How to Create VHD of Windows 10 Installation and Use in Hyper-V [img] Note The tutorial has been updated today (20-MAR-2017). Please post all your questions about this process in this thread. Please...
Tags: