Fixing Windows 7 BSOD Stop 0x7B in a Xen VM after migration from physical partition to a logical volume

0

I had been dual booting my laptop ( Sony Vaio-VGNCR26B ), with the two os's being Win7 and Ubuntu 12.04 LTS ( I think this is referred to 12.04.1 LTS now ). Previously, I had been able to boot the native windows using VBox. Out of curiosity, I decided to move to a bare-metal hypervisor, like Xen.

First, I cloned the whole 160 GB drive to make sure I did not lose anything. Then I separately cloned the Windows partition using Clonezilla. Wiped the hdd clean, and installed Ubuntu 12.04.2 LTS over LVM. ( Note: I gave Ubuntu 9 Gb of space ). After, logging into the the new system, I downloaded, built and installed Xen 4.2.0. Finally, I built a VM for Windows 7.

I then installed Win7 on the new 120 Gb logical volume created for windows. This created two partitions inside the logical volume. The 100MB or so System partition which stores the \Boot folder and the other partition is given to the Root filesystem. After a successful install, I restored the saved Windows image, using partclone, over the current root partition. During, the clone operation I saw that the source image ( the partition ) was 117 GB while the destination partition was 120 Gb.

After the clone operation was completed, I was left with a Windows virtual machine which gets to the starting windows screen and then stops with a BSOD ( STOP: 0x0000007b ). Advanced boot options donot help, as it simply states I must try System restore with a rescue disk. Booting into Win7 Rescue mode and executing Bootrec /fixboot ( or /fixmbr ) does not help. Interestingly, Bootrec /ScanOs shows 0 Windows installations. All of these errors point to an invalid partition table. Even though I can mount the partition under linux without any issue and Windows system rescue can see the partition. I have tried also switching on drivers from the registry by setting the Start value for all keys with "Scsi Miniport" reference to 0 ( 0h ). I have also checked if the drive signature was the issue but the signature in the registry and the disk uniqueid are equal.

So, does someone know of any techniques to fix the disk geometry ? Would it destroy the data on the VM ? How should I clone the 117 GB partition onto the 120 GB "drive" ?

I thank you in advance for your time answering my query!

Please note: All my data is backed up. So destructive techniques are fine, but any good practice tips will be much appreciated.

windows-7
linux
installation
xen
asked on Super User Mar 1, 2013 by Samrat Roy

1 Answer

1

The first issue you encountered was not disk geometry, it was storage controller/driver in Windows. The problem is that the native, dual-boot Windows system uses whatever storage controller is built into your system, while the Xen domU uses an older IDE controller to present the emulated disk (even if you're passing through a physical partition - it is still emulating a storage controller). To get Windows booted correctly, you need to fix the storage drive in Windows - that is, you need to install the new storage controller in Windows at boot time. The major issue is that, in order to install a new storage driver, you have to boot Windows successfully. I believe most of the P2V guides have you install this storage driver on the native platform before you shut down Windows and start it on the virtual platform. So, you may need to go back to dual-boot and boot into Windows on the native computer, install the new storage driver, and then shut it down and boot into Xen and boot the Windows VM. You can Google plenty of guides for Windows P2V that walk you through these steps.

The issue with passing through just the Windows partition to the Xen domU is that it only passes that partition through, and not the MBR or any of that. For Windows 7 this can be especially bad, since it uses a separate boot partition and actually needs both of those partitions. By booting into recovery mode and doing the fixmbr, you probably wrote an MBR over the first few sectors of the actual Windows partition, which destroys some data. There may be a way to correct it, but at this point it is probably easiest to just start from scratch on Windows.

Also, one final point - most computers come with an OEM license of Windows. I'm not licensing expert, but Windows will almost certainly complain about the change in hardware platform and need to re-license/activate itself under the new hardware, which may not work correctly, since the Xen BIOS does not have the magic Windows OEM license bit.

answered on Super User May 16, 2013 by Nick

User contributions licensed under CC BY-SA 3.0