Boot from VHD

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

  1. hobbit200

    hobbit200 MDL Novice

    Nov 11, 2012
    4
    4
    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
    5,833
    1,748
    180
    EasyBCD should help you
     
  3. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,988
    1,313
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. MrG

    MrG MDL Addicted

    May 31, 2010
    808
    180
    30
    #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
    3,927
    5,278
    120
    #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,988
    1,313
    120
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,988
    1,313
    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)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. stayboogy

    stayboogy MDL Addicted

    May 1, 2011
    709
    115
    30
    this ^^^

    technet has the answer to all these kinds of questions. learning the capabilities of bcdboot will help you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    569
    598
    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.
     
  10. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,833
    1,748
    180
    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:
     
  11. DavidinCT

    DavidinCT MDL Senior Member

    May 9, 2015
    464
    75
    10
    Interesting....Could this be done under a bootable USB 3.0 drive ?