Personal computing discussed

Moderators: renee, Dposcorp

 
bthylafh
Maximum Gerbil
Topic Author
Posts: 4320
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Virtualizing a Boot Camp partition is hard!

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!
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
bthylafh
Maximum Gerbil
Topic Author
Posts: 4320
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Virtualizing a Boot Camp partition is hard!

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.
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
LaChupacabra
Gerbil First Class
Posts: 145
Joined: Tue Dec 30, 2008 10:59 pm

Re: Virtualizing a Boot Camp partition is hard!

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!
 
bthylafh
Maximum Gerbil
Topic Author
Posts: 4320
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Virtualizing a Boot Camp partition is hard!

Fri Jun 22, 2012 9:21 pm

Huh, thanks. That might come in handy some other time! :)
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
DeadOfKnight
Gerbil Elite
Posts: 726
Joined: Tue May 18, 2010 1:20 pm

Re: Virtualizing a Boot Camp partition is hard!

Fri Jun 22, 2012 9:59 pm

That's not all that's hard ;)
Intel Core i7-5775c, Asus Maximus VII Formula, Win 10 Pro
RTX 2080 Ti FE, Corsair 2x8GB DDR3-1866, Corsair AX860
Corsair H105, WD Red 4TB x2, Creative X-Fi Titanium HD
Samsung 850 EVO 1TB, Alienware AW3418DW, Corsair 450D
 
bthylafh
Maximum Gerbil
Topic Author
Posts: 4320
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Virtualizing a Boot Camp partition is hard!

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.
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On