locked
How to convert Gen 2 VM to Gen 1? RRS feed

  • Question

  • Dear Hyper V Expert,

    may I know is it possible to do conversion from Gen 2VM to Gen 1, so I can attach the VHD into my Gen 1 Hypervisor?

    thanks.

    Friday, April 15, 2016 11:42 AM

Answers

  • Hi Henry,

    There is no tool from MS that I am aware of which converts Gen 2 machine to Gen 1. As per the below link, the third party tool "Platespin" can achieve this. However, there is no gurantee it works and you need to do on your own risk.

    http://www.ms4u.info/2015/02/convert-generation-2-virtual-machine-to.html

    -Umesh.S.K

    • Proposed as answer by Tim CerlingMVP Friday, April 15, 2016 1:17 PM
    • Marked as answer by Leo Han Tuesday, April 26, 2016 9:20 AM
    Friday, April 15, 2016 12:04 PM

All replies

  • Hi Henry,

    There is no tool from MS that I am aware of which converts Gen 2 machine to Gen 1. As per the below link, the third party tool "Platespin" can achieve this. However, there is no gurantee it works and you need to do on your own risk.

    http://www.ms4u.info/2015/02/convert-generation-2-virtual-machine-to.html

    -Umesh.S.K

    • Proposed as answer by Tim CerlingMVP Friday, April 15, 2016 1:17 PM
    • Marked as answer by Leo Han Tuesday, April 26, 2016 9:20 AM
    Friday, April 15, 2016 12:04 PM
  • Moving from Generation 1 to 2 or from Generation 2 to 1 is a change in the BIOS and thus the installation. 
    I tis not a simple switch in a VM just like it isn't a simple switch on bare metal.
    It is possible to go from Generation 1 to 2 (BIOS to UEFI)-
    https://blogs.technet.microsoft.com/jhoward/2013/11/14/hyper-v-generation-2-virtual-machines-part-10/
    It is not so simple to go from UEFI to BIOS.

    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

    Friday, April 15, 2016 2:29 PM
  • Hi Umesh,

    it is indeed good tool but there is no free version which is quite disappointed.

    Friday, April 15, 2016 3:40 PM
  • PlateSpin has been around for 10+ years.

    It was never free.

    But then, you get what you pay for...


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

    Friday, April 15, 2016 3:43 PM
  • PlateSpin has been around for 10+ years.

    It was never free.

    But then, you get what you pay for...


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

    Hi Brian,

    thanks for the advise.

    it seems that there is no other way without using third party tools. I am thinking if I am doing backup by using the Microsoft server backup 2012 to backup the VM into vhd file, can it be attached on gen 1 hypervisor?

    Thanks

    Friday, April 15, 2016 4:22 PM
  • There are lots of backup and restore methods that you can try.

    As I mentioned - this is a BIOS type change to the OS. 

    So whatever method you try, it must take the installed machine state and move that to a new disk partitioning format and bootloader.

    You and try DISM / ImageX - it is built into Windows.  Capture an image and then apply it.

    Either way, you have to deal with the fundamental bootloader and BIOS changes.  This is not simple nor straightforward.  Thus there aren't free tools.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

    Friday, April 15, 2016 4:47 PM
  • Hi Henry, that will also not work.  The backup will retain the original disk type and thus will still be Gen 2.

    This can be done purely using built-in Microsoft tools, but as Brian mentioned isn't that easy.

    The core problems you need to solve are the EFI -> BIOS change, but even more specifically the GPT -> MBR.

    You also must solve the SCSI -> IDE change that will accompany this.

    And finally the different boot partitions associated with GPT and MBR.

    EFI-> BIOS, this happens regardless of what you do so is the constant.

    GPT->MBR.  This is the longest portion and the portion most prone to errors.  You can't just convert GPT->MBR or vice versa.  So you have to make a copy of your vhdx file.

    With purely Microsoft tools this is DISM.  Since you're running Gen 2 successfully, then your host is Windows Server 2012 R2 and you should have this built-in (no need for imagex).

    To make this work (you'll need roughly 2x free space of the size of the vhdx file in question):

    1. Mount the good backup vhdx (hopefully your backup server is also win2012r2).

    2. Capture the mounted disk image using dism.  Depending upon how big it is, this could take a very long time and might not even be feasible if the size goes into the terabytes.

    3. Create a new vhd of vhdx or vhd (if going onto a win2008 host) file type with the right size and type.

    4. Mount the vhd(x) created in step 3 and create partitions and format ntfs.  Default should be an mbr disk.  if you have special partitioning needs take care of it at this stage (especially if you use BitLocker, pay close attention to separation of the boot partition).  Make sure you mark the boot partition (it may be the same as the data partition) as active.  Don't forget to assign letters to the drives.

    5. Apply the image captured in Step 2 to the newly formatted disk in Step 4.  

    This completes the successful conversion of GPT ->MBR that is needed.

    Next you have to fix the bootloader.  bcdboot.exe will take care of this part pretty easily.

    Since you have no bcd store to worry about (this is stored in the efi boot partition which was not copied), you'll just let windows create a blank one for you with the necessary settings.

    Use bcdboot <driveletter from 4>:\Windows /s <driveletter from 4 that contains the boot partition>

    This assumes you only use the default bcd settings.  If you have customized boot loader, then you'll have to adjust it with bcdedit as necessary.

    Dismount the newly created vhd file and attach it to the gen1 vm.

    SCSI->IDE.  Good news is that since you're going from Hyper-V to Hyper-V, this is handled by the integration services drivers and for Win2012R2 is pre-installed.  I've personally never had an issue of using newer guest IS on older Hosts, but your mileage may vary.

    Start the gen1 vm.  Assuming everything finished correctly, your VM should boot at this point.  It'll go thru the standard "new hardware detected" phase post-login and reboot, but it should be operational.

    If you get the dreaded 0x7B then the Good News i mentioned is not so good, and you'll have to do something far more archaic to make it work (but still works).



    • Edited by JamesB24 Friday, April 15, 2016 7:00 PM
    Friday, April 15, 2016 6:16 PM
  • Hi Henry,

    I suggest you build a new Gen 1 VM and migrate the data from Gen 2 to it.

    I suppose it is time-saving and has no cost.

    Best Regards,

    Leo


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, April 18, 2016 5:59 AM
  • Thanks for posting!

    Thursday, May 12, 2016 2:10 PM
  • I had the same problem. I converted the disk from VHDX to VHD and it couldn't boot in Azure or AWS due to the UEFI boot. I was able to change from UEFI to BIOS thanks to a video in youtube:

    https://www.youtube.com/watch?v=DDaSFRAviq4

    It was very easy to convert the disk from Gen 2 to Gen 1 then I uploaded it to Azure and AWS and now my instance can boot my VHD disk.


    Friday, July 8, 2016 1:42 PM
  • Asdande's answer should be the accepted one. 
    Thursday, December 14, 2017 2:55 AM