Virtualizing a Boot Camp partition is hard!

The place for all kinds of software for all kinds of operating systems.

Moderator: Dposcorp

Virtualizing a Boot Camp partition is hard!

Postposted on Fri Jun 22, 2012 12:26 pm

So I want to virtualize the Win7 Boot Camp partition on my soon-to-be-retired work Macbook 2,1, because there's a tool I use occasionally that's hard to set up right and I don't use it often enough to remember how it was originally done.

VMware has a tool that can virtualize a running machine over the network. Doesn't work with a Mac's GPT partitions.

So here's the procedure that worked for me:
1) Install a utility called disk2vhd on the Macbook's Win7 install. Make sure you have less than 50% of the partition in use.
2) Run disk2vhd and then copy the resulting .VHD over the network to the VM host machine.
3) Create a new VirtualBox[1] VM. Remove the SATA controller, make sure the IDE controller's set to emulate a PIIX3 (x4 might work, ICH6 definitely does not), attach VHD to the IDE controller.
4) Should boot.

If it doesn't boot at this point, you might have to convert the VHD's GPT partition table to MBR. I downloaded SystemRescueCD, attached the ISO to the virtual machine, booted from it, then ran gdisk using this tutorial:
http://www.rodsbooks.com/gdisk/mbr2gpt.html

Since I'm using VMware for all my other work VMs, I'm going to try converting the VirtualBox VM over next.

[1] MS Virtual PC can't deal with VHDs created from a disk that's bigger than 137GB and VMware Player can't directly use VHDs. VMware's aforementioned virtualization tool can import VPC VMs, but again VPC can't see those big disks. This was a huge pain in the butt!
Think for yourself, schmuck!
i5-2500K@4.3|Asus P8P67-LE|8GB DDR3-1600|Powercolor R7850 2G|1.5TB 7200.11|1988 Model M|Saitek X-45 & P880|Logitech MX 518|Dell 2209WA|Sennheiser PC151|Asus Xonar DX
bthylafh
Grand Gerbil Poohbah
 
Posts: 3223
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Virtualizing a Boot Camp partition is hard!

Postposted on Fri Jun 22, 2012 5:41 pm

VMware Player's OVA import is still a bit crap. I told VirtualBox to export as v0.9 OVA format (for compatibility) but VP still choked, apparently because in a fit of OCD I filled out the metadata that VirtualBox wanted (OS, version, mfr, URLs, etc.) - it said that it couldn't do anything with the metadata and instead of gracefully ignoring fairly useless metadata it failed. So now I have to re-export a 40-some GB virtual machine and hope that not filling that info in will fix it.

Sigh. I'll probably find out that Win7 won't boot because VMware prefers to emulate a SCSI controller and/or it doesn't like its IDE.

...hmm, maybe I could try using that official import tool and point it at the VB vm and not worry about exporting first. It can wait until Monday.
Think for yourself, schmuck!
i5-2500K@4.3|Asus P8P67-LE|8GB DDR3-1600|Powercolor R7850 2G|1.5TB 7200.11|1988 Model M|Saitek X-45 & P880|Logitech MX 518|Dell 2209WA|Sennheiser PC151|Asus Xonar DX
bthylafh
Grand Gerbil Poohbah
 
Posts: 3223
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Virtualizing a Boot Camp partition is hard!

Postposted on Fri Jun 22, 2012 8:04 pm

This is a little late for you, but it may help someone else, so here's another way of (probably, i've never tried it) doing it.

The built in backup tool in Windows 7 is pretty spectacular. If you do a full image backup it will create a bare-metal backup and save it as a .vhd to whatever directory or drive you want. Take a full backup.

Then load up VMware and create a new VM, specifying that you will install the operating system later. Either mount the Windows .iso you used to install Windows in VMware or insert the media into your computer, turn on the VM and boot in the appropriate way. Boot into the recovery console.

In the recovery console you can do a full restore of your system. No messing about with partitions, Virtual Box, or installing any third party utilities onto your Windows box. Something worth noting in this process is that the .vhd that Windows backup makes is not bootable. All of that gets stripped out when you create the backup image, so being able to boot into the recovery console is a requirement to complete this process.

Again, late to the party to help you, but maybe it'll help someone else!
LaChupacabra
Gerbil First Class
Gold subscriber
 
 
Posts: 138
Joined: Tue Dec 30, 2008 10:59 pm

Re: Virtualizing a Boot Camp partition is hard!

Postposted on Fri Jun 22, 2012 9:21 pm

Huh, thanks. That might come in handy some other time! :)
Think for yourself, schmuck!
i5-2500K@4.3|Asus P8P67-LE|8GB DDR3-1600|Powercolor R7850 2G|1.5TB 7200.11|1988 Model M|Saitek X-45 & P880|Logitech MX 518|Dell 2209WA|Sennheiser PC151|Asus Xonar DX
bthylafh
Grand Gerbil Poohbah
 
Posts: 3223
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Virtualizing a Boot Camp partition is hard!

Postposted on Fri Jun 22, 2012 9:59 pm

That's not all that's hard ;)
Intel Core i7-875K, Asus P7P55D-E Pro, Win 7 Home Premium
MSI GTX 560 Ti OC, Mushkin 2x2GB DDR3-1333, Corsair TX650
Cooler Master Hyper 212+, Logitech Z-2300, ASUS Xonar DX
Samsung Spinpoint F3 1TB, Dell Ultrasharp U2410, Antec P183
DeadOfKnight
Gerbil Elite
Gold subscriber
 
 
Posts: 636
Joined: Tue May 18, 2010 1:20 pm

Re: Virtualizing a Boot Camp partition is hard!

Postposted on Fri Jun 22, 2012 10:11 pm

DeadOfKnight wrote:That's not all that's hard ;)


:P I left out all the stuff I tried first.
Think for yourself, schmuck!
i5-2500K@4.3|Asus P8P67-LE|8GB DDR3-1600|Powercolor R7850 2G|1.5TB 7200.11|1988 Model M|Saitek X-45 & P880|Logitech MX 518|Dell 2209WA|Sennheiser PC151|Asus Xonar DX
bthylafh
Grand Gerbil Poohbah
 
Posts: 3223
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA


Return to General Software

Who is online

Users browsing this forum: No registered users and 2 guests