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.
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.
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
The desktop has only the hard disk you put on, and no other hdd/ssd with working OS? If yes, then maybe RamOS.
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)
this ^^^ technet has the answer to all these kinds of questions. learning the capabilities of bcdboot will help you.
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.
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: