Monday, November 3, 2014

How to start Windows 10 from a virtual hard disk

Figure 1. A virtual hard disk as a new choice in the boot menu.
So you decided to install the Windows 10 Technical Preview in a Hyper-V virtual machine and now you want to boot your computer directly into that virtual machine (Figure 1). So here is how. You simply use, as an administrator, the command line BCDboot tool (bcdboot.exe) located in the C:\Windows\system32 folder. BCD, as you may know, stands for Boot Configuration Data and it is the "store" that contains boot configuration parameters and controls how the operating system is started (since Windows Vista) replacing the old and less sophisticated boot.ini file. See the BCDboot command-line options. What BCDboot does is simply to copy critical boot files to the system partition and to create a new system BCD store entry (Figure 2). In my particular case, I had the virtual disk in the G: partition . All I had to do was to mount it. How? Select the disk and then, in the File Explorer "Manage" section of the Ribbon (now highlighted with "Disc Image Tools" on the top bar), click on "Mount" to the left (you will have to provide the administrator password. The system will assign a new letter to this drive, say J (this has nothing to do with where the actual virtual disk is located). Then in the command line run bcdboot J:\Windows. That's all there is to it. In a MSDN blog entry, explaining the difference between BCDboot and BCDedit (the other command to manage the BCD store) you can find detailed instructions. The result is what you see below. You need not worry about the new mounted drive. The next time you reboot the system will unmount it.


Figure 2. A new BCD store entry to include a VHDX

No comments:

Post a Comment