Boot from VHD

Discussion in 'Virtualization' started by hobbit200, Aug 17, 2016.

  1. hobbit200

    hobbit200 MDL Novice

    Nov 11, 2012
    8
    6
    0
    I have the following problem:

    I have created a win 10 virtual machine and saved in a vhd file.
    The file was coppied on an empty hard disk.
    The hard disk is put alone on a desktop.
    I want the desktop to boot from the vhd inside the hard disk.
    How can I make this hapen? Any ideas?

    Thank you in advance.
     
  2. sebus

    sebus MDL Guru

    Jul 23, 2008
    6,356
    2,026
    210
    EasyBCD should help you
     
  3. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    As sebus said, just use easybcd to add it to your current bootloader.

    That feature is called native VHD and works since W7. But older windows can boot from a vhd using some tricks.

    Remember that win 7 can't manage the VHDX format, and cant boot from them although it can be installed inside of them on using W8+ HyperV.
     
  4. MrG

    MrG MDL Expert

    May 31, 2010
    1,402
    1,625
    60
    #4 MrG, Aug 18, 2016
    Last edited: Aug 18, 2016
    Awhile back I successfully tested this in W7, using VBPro (now DBPro).
    I just took a look @ W10 Disk Mgr. & found the same choices are there see bottom screenshot

    DSCF0001.JPG Win7_7231x86VHD_ VBP3.3SetAsDefaultOS.jpg Win10 VHD_ 1b.jpg
     
  5. xinso

    xinso MDL Guru

    Mar 5, 2009
    12,657
    13,673
    340
    #5 xinso, Aug 20, 2016
    Last edited: Aug 20, 2016
    The desktop has only the hard disk you put on, and no other hdd/ssd with working OS?

    If yes, then maybe RamOS.
     
  6. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120

    Just read the link

    Boot with the recovery console, use diskpart to attach the vhd, use bcdboot to add it to the bootloader.

    (obviously be sure that the partition inside the VHD is marked as active)
     
  7. stayboogy

    stayboogy MDL Addicted

    May 1, 2011
    846
    215
    30
    this ^^^

    technet has the answer to all these kinds of questions. learning the capabilities of bcdboot will help you.
     
  8. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    816
    1,122
    30
    If you are on UEFI all you have to do it mount/attach the VHD, open CMD and type bcdboot X:\Windows where X is the drive letter of the mounted VHD.

    I am on Windows 7 host and tried to boot Windows 7 VHD but it failed, so I had to mount the registry hive of the VHD and set dword start to 0 on the msahci key and I could boot into the VHD but it behaves weird, it loads stuff that is on my C: drive.

    The VHD is a clean Windows install but when I booted it the software that is installed onto my C: drive was running on the VHD boot so I tried to boot a Windows 8.1 VHD to be sure that it is the VHD being booted but it fails with "vhd boot initialization failed" even after I did the registry edits required.
     
  9. sebus

    sebus MDL Guru

    Jul 23, 2008
    6,356
    2,026
    210
    Because you do need to delete entries in

    HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices

    so W7 can renumerate devices & get its own disk (vhd) as C:
     
  10. DavidinCT

    DavidinCT MDL Addicted

    May 9, 2015
    522
    99
    30
    Interesting....Could this be done under a bootable USB 3.0 drive ?