Because of certain issues with XenClient on my laptop (external webcams half working, battery losing power before the system completes hibernation, wireless with computer based certificates not working, sluggish hard disk performance…), I decided to do a reverse P2V, a V2P (virtual to physical) of my main virtual machine (Windows 7 Enterprise).
First, I uninstalled XenClient tools to make sure the XenClient drivers were removed – so they couldn’t cause any trouble. Then I bought a copy of Acronis TrueImage and imaged the virtual machine and stored the .tib file on my NAS. It took about 5 hours to do so (did I mention sluggish hard drive performance yet?), but it did the job.
Then, using a TrueImage boot cd, I restored the backup to the disk. I selected the three partitions, well actually two – the system disk (containing the Windows folder) and the System Reserved partition (I’ll come to that in a sec), plus the MBR (Master Boot Record).
When the restore was complete, I could boot Windows (yey), however during boot it BSOD’ed with a 0000007B STOP error. Booting into safe mode didn’t work either. Bummer. At that moment I was thinking that the System Reserved partition was causing this issue. The System Reserved partition is by default a small (100MB) partition containing System Recovery tools and is also required for BitLocker – but isn’t really necessary for Windows to work. When present, this is also the Active partition, and hence contains the boot files. So, if this somehow gets corrupted, it can cause booting to Windows to fail.
After some hours of troubleshooting with bootrec and bcdedit, I decided to remove this partition altogether. I had to set the system partition as the Active partition and run bootrec /RebuildBCD in order to allow booting from the system partition without the System Reserverd partition.
Still, booting into Windows resulted in a 0000007B error. Now with only a single partition left, I was growing convinced this was a driver issue. Since the OS was virtualized it was working with a different set of drivers and didn’t have the drivers for the bare metal hardware on board. Since the laptop was based on a Intel chipset, I thought a about somehow installing the Intel RST drivers. However, this deemed impossible, so that was a dead end.
Then after some searching on Google, I hit a MS KB (922976 – Error message occurs after you change the SATA mode of the boot drive), which I thought could be related somehow. Now, I knew that in my laptop BIOS the disk access method was set to AHCI. Maybe the VM, being virtualized, was accessing it using ATA? So, the article describes setting the Start value in the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci key to 0 as a solution. Since I couldn’t boot into Windows, I used a Windows 7 DVD to go into System Restoration mode and launched a Command Prompt. From there I launched regedit, loaded the SYSTEM hive on disk (C:\Windows\System32\Config\SYSTEM), navigated to ControlSet001\Services\Msahci and noticed Start was set to 3. I changed it to 0, unloaded the hive and rebooted.
And Windows 7 booted to the logon screen! Succes! From there it’s just a case to install the remaining drivers to have a fully functioning Windows installation. Hopes this saves others a lot of time and headaches!
In any case I wish all a happy New Year!