I recently got a new unibody Macbook Pro and moved my entire OS (from my old SR MBP) using Carbon Copy Cloner. For my Boot Camp partition, I used Winclone, but after restoring I ended up with a broken Windows install that threw STOP 0x0000007B every time I tried to start it. Fusion refused to start it either, giving me an “The Boot Camp partition is not prepared to run as a virtual machine” error.
VMWare refuses to boot it because the Boot Camp partition was created using Boot Camp Assistant, which defaults to FAT32, but my restored Windows used NTFS. There are instructions for changing the partition type to “07″ using fdisk in OS X, but my partition type was already set to that. Even though fdisk claimed to write a new MBR, VMWare still complained.
Windows shows a BSOD because it doesn’t have drivers for the new drive controller, which I can’t install unless I boot into Windows!
I can’t boot natively, and I can’t boot it in VMWare to fix the problems. Time for a fresh install? NO! There is a solution.
|
I am assuming that everything is installed in the default directories and partitions. I am also assuming you are using VMWare Fusion 2.04. If not, your naos version may differ. If you have your VMs in a custom location or have installed Boot Camp in a non-standard way, please adjust the commands accordingly |
VMWare uses a special supplementary VM (called Helper or “naos 1.0″ internally) to set up a Boot Camp partition initially, so if this VM runs into problems the entire process aborts and gives the “not prepared” error.
The reason for prep failure will be revealed by looking at the logs of the helper VM. Open up a Terminal window and check the logs:
| cat ~/Library/Application\ Support/VMware\ Fusion/Virtual\ Machines/Helper/naos-1.0.vmwarevm/*.log | grep unable |
Look for an entry like the following:
| Sep 25 22:13:36.802: vcpu-0| Guest: 401 reconfig : unable to mount Windows disk as NTFS or FAT32 |
If you don’t see anything that matches the above error, STOP.
I don’t know what the problem is and continuing could damage things further.
If you do have an entry like this in the logs, keep the Terminal window open and proceed to the next step.
1b – Bypass the VMWare setup process
Here we will be basically creating a barebones VM and pointing it to the physical partition. It won’t be treated like special Boot Camp VM, and will use the raw partition as-is.
In order to make sure that the next steps won’t hose the hard drive, we must check whether Boot Camp is actually installed in the default partition on the main drive. In the same Terminal window, execute the following command:
| cat ~/Library/Application\ Support/VMware\ Fusion/Virtual\ Machines/Helper/naos-1.0.vmwarevm/*.log | grep DISKLIB-FLAT |
You should see several entries that mention /dev/disk0s3. If it’s something else, adjust the following steps to match your configuration.
- Open up VMWare Fusion and hit Command-N to bring up the New Virtual Machine Assistant.
- Click Continue without disk
- Select Create a custom virtual machine. Select Windows XP for the OS
- On the next page click Customize Settings and name your virtual machine “BC”. Then click Save
Once the settings window for the VM appears, select the hard drive and reduce the size to the absolute minimum (1.00GB) and click Apply.
In the Terminal window, go to your user’s Virtual Machines directory with the following command:
| cd ~/Documents/Virtual\ Machines/ |
Next, go into the directory of your newly-created VM:
| cd BC.vmwarevm |
Next, delete the virtual hard drive:
| rm *.vmdk |
The next step is to tell this VM to use the physical Boot Camp partition as the boot drive (make the /dev/* name matches the verification we did earlier. The default is /dev/disk0s3):
| /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 3 BC ide |
Here, /dev/disk0 is the name of your entire physical drive, 3 is the partition number (the Boot Camp partition), and BC is the name of the Virtual Machine you created. This will create a new .vmdk file pointing to the physical Windows partition.
Launch the VM, enter your root password, and wait for Windows to load. When I did this, Windows automatically checked the drive for errors then booted normally.
2 – Install mass storage drivers
Since migrating the Boot Camp image is essentially no different than physically moving an XP drive to a new machine, we can follow this Microsoft KB article on how to inject driver entries into the registry.
Four drivers are required, plus a file containing the appropriate registry entries. These can be extracted from your Windows CD, in driver.cab (and additionally sp2.cab if you have an SP2 install CD). The registry file can be created using instructions in the KB article.
WinRAR is able to browse and selectively extract from CAB files. Alternatively, you can use the extract command to get them out (from a Windows command prompt) using the following syntax:
| expand |
Do not overwrite existing files in the \System32\Drivers directory! In fact, all the files you need may already be present, so check before digging out your XP disc. Once all the files are in place, run the registry file and merge it into the system registry.
3 – Fix the Boot Camp drivers
When I rebooted into Windows, I noticed that none of my devices worked. I guess there were so many hardware changes that the older Boot Camp drivers were completely useless. Not even the keyboard functioned!
I slaved over this with a generic USB keyboard and my Leopard install disc (containing Boot Camp 3.0 drivers), trying to coerce Windows into upgrading the drivers. I got very close, with the exception of the trackpad. My guess is that the existing touchpad driver interferes with the new multitouch drivers (of which there are two), preventing a clean install. The devices were visible in Device Manager, but were automatically disabled and would not function if enabled manually.
In the end, I decided to completely nuke the existing Boot Camp install and start fresh. Since the VM is still running, use this opportunity to completely uninstall any Boot Camp related software from Windows. This includes “Boot Camp Services” and all separate drivers appearing in the Add/Remove list. Then, run the Boot Camp 3.0 installer inside the VM and let it finish. Hopefully when you reboot, Windows will automatically pick up the new Boot Camp drivers and install things automatically. If not, get a generic USB keyboard/mouse and do it manually.
I noticed that my USB keyboard would not be recognized if I plugged it in after the New Hardware wizard popped up. This is probably because Windows was waiting for me to either install the drivers it wanted or dismiss the dialog box. I couldn’t do either without any input devices! Boot Windows with your USB devicesĀ already plugged in.
4 – Clean up
If all is well, you can safely remove the temporary “BC” virtual machine and use the “special” Boot Camp VM. If your Boot Camp VM isn’t being recognized or is messed up for some reason, follow the instructions here on how to delete and then restore it.
Feel free to leave a comment if there are any problems!
Thank you for this excellent post; saved me a lot of hassles. I had created a new partition and for some reason VMWare didn’t like this. This fixed it though