Fun trying to convert an existing install to a vhd!

Page 2 of 2 FirstFirst 12

  1. Posts : 15,443
    Windows10
    Thread Starter
       #11

    lx07 said:
    I migrated a Windows 8 install from virtualbox to hyper-v and it worked fine simply by attaching the vhd to a new hyper-v vm. I had to re-activate it obviously. Not sure if you use Linux at all but Hyper-V drivers have been built into the kernel for the last few years also so it is similarly easy to move from virtual to actual hardware.

    Don't know about going the other way (i.e to VBox or VMware). I bet it would work - maybe I'll try it out when I have a bit of time.
    Cheers.
      My Computer


  2. Posts : 17,661
    Windows 10 Pro
       #12

    lx07 said:
    Do you have UEFI or BIOS? With UEFI you use bcdboot, with bios you use bcdedit...
    I have no issues in mounting a Hyper-V virtual machine's VHD file and then using bcdboot X:\Windows add it to boot menu, regardless what type of disk my host and the added VHD have.

    It works perfectly well with BIOS / MBR formatted disk on host and UEFI / GPT on native boot VHD, and with UEFI / GPT formatted host and BIOS / MBR formatted native boot VHD.

    Extract from the beginning of my tutorial Hyper-V - Native Boot VHD - Windows 10 Forums:

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

    The method used in tutorial is BCDBOOT.
      My Computer


  3. Posts : 17,661
    Windows 10 Pro
       #13

    @cereberus, about your issues: the Disk2VHD tutorial, it's Part Three shows you what to do if you used Disk2VHD to create a VHD of a GPT partitioned system. Unfortunately Disk2VHD does not include all UEFI partitions in VHD, therefore a free third party tool is needed after you have created the VHD to convert it to MBR. The conversion process is easy and fast. It can then be mounted and added to boot menu with a simple bcdboot X:\Windows command.

    See Part Three in this tutorial: Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD - Windows 10 Forums

    I have never had issues in native boot adding a VHD made from GPT disk with Disk2VHD which is converted to MBR before adding it.
      My Computer


  4. Posts : 15,443
    Windows10
    Thread Starter
       #14

    Kari said:
    @cereberus, about your issues: the Disk2VHD tutorial, it's Part Three shows you what to do if you used Disk2VHD to create a VHD of a GPT partitioned system. Unfortunately Disk2VHD does not include all UEFI partitions in VHD, therefore a free third party tool is needed after you have created the VHD to convert it to MBR. The conversion process is easy and fast. It can then be mounted and added to boot menu with a simple bcdboot X:\Windows command.

    See Part Three in this tutorial: Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD - Windows 10 Forums

    I have never had issues in native boot adding a VHD made from GPT disk with Disk2VHD which is converted to MBR before adding it.
    Surely I need to use a GPT vhd surely as I am UEFI based?

    I was not trying to run it in Hyper-V but have it as native boot

    My issue is more likely due to a glitch somewhere. I have added VHDs many times using bcdboot as a dual boot option. For some reason I cannot fathom out, it does not like one reduced in size as I described earlier. AS LX07 says it should work fine, and I agree it should.

    As I said. I have solved my problem - I was just curious more than anything as to why I was having problems. In the end, if a method works, then it is not a big deal even if I took the scenic route to get to the answer.

    Thanks very much for the valuable information as always.
      My Computer


  5. Posts : 17,661
    Windows 10 Pro
       #15

    cereberus said:
    Surely I need to use a GPT vhd surely as I am UEFI based?

    I was not trying to run it in Hyper-V but have it as native boot
    First, it's irrelevant, totally irrelevant what partitioning system your host and a VHD used in native boot are using. A GPT host can add and use a MBR VHD in native boot, and an MBR host can add and use a GPT VHD.

    Second, the Part Three in tutorial I linked shows how to convert a GPT VHD made with Disk2VHD to MBR. It's the easiest, simplest and fastest way to do the conversion and then be able to use the Disk2VHD vhd file in either a virtual machine or in native boot.

    A GPT VHD made with Disk2VHD cannot be used as it is on virtual machine or native boot. Converting it to MBR makes things easy.

    It's of course totally your own business how you do it, main thing is to succeed. I was simply telling about an option that makes it easy.

    Kari
      My Computer


  6. Posts : 1,750
    Windows 10 Pro
       #16

    Kari said:
    First, it's irrelevant, totally irrelevant what partitioning system your host and a VHD used in native boot are using. A GPT host can add and use a MBR VHD in native boot, and an MBR host can add and use a GPT VHD.

    Second, the Part Three in tutorial I linked shows how to convert a GPT VHD made with Disk2VHD to MBR. It's the easiest, simplest and fastest way to do the conversion and then be able to use the Disk2VHD vhd file in either a virtual machine or in native boot.

    A GPT VHD made with Disk2VHD cannot be used as it is on virtual machine or native boot. Converting it to MBR makes things easy.

    It's of course totally your own business how you do it, main thing is to succeed. I was simply telling about an option that makes it easy.

    Kari
    Kari,

    I want to make sure I understand what you said. I'm staring to use Hyper-V for virtual machines.

    If I create a VHD, it doesn't matter if the host is MBR and the VHD is GPT, if both are GPT, if both are MBR, or if the host is GPT but the VHD is MBR.

    If all that is correct, then why does a VHD created with Disk2VHD have to be MBR to be directly bootable?
      My Computers


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

    x509 said:
    If all that is correct, then why does a VHD created with Disk2VHD have to be MBR to be directly bootable?

    Because when you create a VHD with Disk2VHD from a GPT disk, it does not recognize and include the EFI System Partition in VHD it creates.

    You have to remember that Disk2VHD is although still a powerful tool quite an old program. When originally coded all systems were BIOS & MBR, the program "learned" that to make a bootable VHD it needed to include the first partition on first hard disk (System Reserved partition in MBR) which contains the boot records in addition to OS and possible data partitions selected by user.

    It's still using this same principle even on GPT disks. Disk2VHD includes the first partition of the first disk which it assumes contains the boot records but on GPT disk it is just a Recovery Partition (yellow highlight in screenshot below) but ignores the next partition (EFI System Partition) which on GPT disks actually is the one with boot records (red highlight):

    Fun trying to convert an existing install to a vhd!-image.png
    (Click to enlarge.)

    This results a totally working but not bootable VHD. The user now has two methods to make it bootable and use it on vm or native boot, either convert it to MBR or manually create the EFI system partition and boot records on it. I prefer the conversion method because it is so incredibly easy and simple.

    Kari
    Last edited by Kari; 09 Aug 2016 at 09:37. Reason: Incredible amount of typos :)
      My Computer


  8. Posts : 1,750
    Windows 10 Pro
       #18

    Kari said:
    Because when you create a VHD with Disk2VHD from a GPT disk, it does not recognize and include the EFI System Partition in VHD it creates.

    You have to remember that Disk2VHD is although still a powerful tool quite an old program. When originally coded all systems were BIOS & MBR, the program "learned" that to make a bootable VHD it needed to include the first partition on first hard disk (System Reserved partition in MBR) which contains the boot records in addition to OS and possible data partitions selected by user.

    It's still using this same principle even on GPT disks. Disk2VHD includes the first partition of the first disk which it assumes contains the boot records but on GPT disk it is just a Recovery Partition (yellow highlight in screenshot below) but ignores the next partition (EFI System Partition) which on GPT disks actually is the one with boot records (red highlight):

    Fun trying to convert an existing install to a vhd!-image.png
    (Click to enlarge.)

    This results a totally working but not bootable VHD. The user now has two methods to make it bootable and use it on vm or native boot, either convert it to MBR or manually create the EFI system partition and boot records on it. I prefer the conversion method because it is so incredibly easy and simple.

    Kari

    Thanks for this explanation. Very clear.
      My Computers


  9. Posts : 17,661
    Windows 10 Pro
       #19

    You are welcome.
      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 08:35.
Find Us




Windows 10 Forums