Page 1 of 1

Copy bootcamp XP to virtualbox

Posted: 26. Oct 2009, 10:25
by limaalpha
Hi all,

Please pardon my confusion as I'm a newbie.

I discovered Virtualbox *after* using bootcamp on my MacBook to set up
dual boot Windows XP and OSX. Virtualbox is now running on OSX and, rather
than re-installing XP from scratch, I'd prefer to create some sort of image
of the existing installation. As XP is running on the same system, there
shouldn't be problems with drivers, etc. From what I've read, this should
be possible, yes?

I'm not sure how to proceed. Do I understand that I should use clonezilla
within the XP system to create an image file? Then copy that image onto
OSX (or onto a USB, CD, etc) and use that to create a guest in Virtualbox?
In a month or so, after I make sure all is well, I'll reclaim the disk space
where the bootcamped XP lived.

Many thanks for any guidance. I just need a place to start from.

Cheers,
Lyn

Re: Copy bootcamp XP to virtualbox

Posted: 26. Oct 2009, 10:33
by limaalpha
Update: Just looked up clonezilla and discovered that it's a linux/unix app.

Windows is not my specialty. What do I use instead to create the sort of
image required?

Lyn

Re: Copy bootcamp XP to virtualbox

Posted: 27. Oct 2009, 06:32
by BillG
It is probably quicker to start over. There is no guarantee that a disk image will boot. If it won't boot, you need to do an OS repair (which takes just as long as an OS install).

Re: Copy bootcamp XP to virtualbox

Posted: 27. Oct 2009, 07:02
by Etepetete
As BillG noted, cloning an existing installation is tedious and there are various components to take into consideration. There is a sticky on this forum as well as other threads regarding this subject. The problem I see facing you is the dual boot installation, as cloning the installation is done with the Linux dd command and that makes a raw image of the complete hard disk, i.e. you will have an image with your dual boot setup and the VDI you create from it will also have this dual boot setup in it. Normally, I would say "go for it". To successfully clone an existing installation allows you to learn a lot. In your case, I would follow BillG's suggestion. Unless of course, you want to add the information gleaned from your experience to the community and make us all smarter.

Re: Copy bootcamp XP to virtualbox

Posted: 27. Oct 2009, 08:13
by limaalpha
Thanks, I had just about come to that conclusion, i.e. do a new install of XP.

The greatest problem, of course, is political. I'm not central IT and there are
a large number of hoops to be jumped through, plus various blood sacrifices
required to be granted permission to use the corporate XP installation disk.
They'll assume I'm up to evil doings.

Maybe if I offer them my firstborn....

Lyn :twisted:

Re: Copy bootcamp XP to virtualbox

Posted: 27. Oct 2009, 12:35
by mpack
First, if you clone a native partition and restore it into a VM then it will not be running on the same hardware. The VM version will be running on virtual hardware, will use a whole different set of drivers, and probably require reactivation (unless its a volume license install?). You will most likely need to follow the VBox migration tips to get the new VM running ok. You should run the MergeIDE step inside the live XP installation before you try P2Ving it.

As to the problem of creating the clone: as others have noted, your problem is that you want to backup one partition only, but recreate an entire bootable disk. If you have plenty of disk space available then this is possible with my CloneVDI tool. You need to create a simple uncompressed "dd" style dump of the partition, giving the resulting file a .raw extension, then give it to CloneVDI which will convert it into a VDI. Unlike VBoxManage, CloneVDI has code to detect that the file you gave it is only a partition dump and will create an entire bootable disk around it. To run CloneVDI you will need a Windows or Wine host. If you are using a USB drive as storage for the partition dump then you can expect all of this to take a long time to complete. However most of that will be unattended, hence many fewer man-hours than a reinstall.

Re: Copy bootcamp XP to virtualbox

Posted: 23. Sep 2011, 19:57
by Lik
mpack wrote:You need to create a simple uncompressed "dd" style dump of the partition, giving the resulting file a .raw extension
Hi mpack, I am a newbie. I have downloaded CloneVDI. Currently, doing a "dd" by using these commands in Mac OS Lion Terminal

sudo dd if=/dev/disk1s3 of=/dev/disk0s3 bs=10240

But I do not know how to give the resulting file a .raw extension. Please advise.

Thank you

Re: Copy bootcamp XP to virtualbox

Posted: 23. Sep 2011, 20:16
by vbox4me2
mpack wrote:You should run the MergeIDE step inside the live XP installation before you try P2Ving it.
For reasons we don't understand, Windows memorizes which IDE/ATA controller it was installed on and fails to boot in case the controller changes. This is very annoying because you will run into this problem with basically all migrated images.
Come to think of it, I've never ever had a problem such indicated here, no matter how small or large the ide drive was, maybe this 'info' needs a rethink.

Re: Copy bootcamp XP to virtualbox

Posted: 24. Sep 2011, 06:54
by Etepetete
Lik wrote:...But I do not know how to give the resulting file a .raw extension. Please advise....
If I remember correctly, using dd results in a .img file extension. CloneVDI will handle that with ease. And also, dd makes a raw copy so you should just be able to change the file extension of the image by hand.

Re: Copy bootcamp XP to virtualbox

Posted: 24. Sep 2011, 10:34
by mpack
As regards the need for MergeIDE, I regard this Microsoft Knowledgebase article as definitive. I can confirm that I did get the stop 0x7B error on my XP SP2 P2V before I used this fix, and MergeIDE stopped it happening. Also I expect MS didn't create the article for nothing.

On the file extension, it's as Etepetete says: .raw or .img are accepted. If the file has the right format but the wrong extension then you can simply rename it. dd does produce the right format. Note that the feature which converts partitions into working drives only works with NTFS and FAT partitions dumps.

Re: Copy bootcamp XP to virtualbox

Posted: 24. Sep 2011, 18:52
by Lik
When I use this command in Terminal at Mac OS Lion

sudo dd if=/dev/disk1s3 of=/dev/disk0s3 bs=10240

It gives me many files and folders. Not one single file. None of the files has an extension of .img or .raw

Re: Copy bootcamp XP to virtualbox

Posted: 25. Sep 2011, 06:45
by Etepetete
Try modifying your command to look like this:

Code: Select all

dd if=/dev/disk1s3 of=/dev/disk0s3/filename.raw bs=4096 conv=notrunc,noerror
For "filename" use whatever is meaningful to you. Including the file extension makes sure the image file has the extension you need. disk1s3 is the bootcamp partition. disk0s3 also needs to have enough free space equal to, or better, more than the complete size of disk1s3.
I think one issue of concern is that the bootcamp partition is exactly that, a partition and not a sole HDD. When I used dd I was making an image of a complete hard drive and saving it to a completely different hard drive. If you do succeed in copying the bootcamp partition, you are more than likely still going to have problems with the boot sector and probably with hardware device drivers as well.
Here is a link that contains tons of info on how to use dd.

Re: Copy bootcamp XP to virtualbox

Posted: 25. Sep 2011, 11:15
by Lik
Tks, Etepetete, I've taken your advice n have been to the link you recommended. I have modified the command but still has an error. The error message is

"dd: /dev/disk0s3/bootcamp.raw: Not a directory"

What can I do next?

Re: Copy bootcamp XP to virtualbox

Posted: 25. Sep 2011, 17:28
by Etepetete
I think it is because "disk1s3" is not a partition but instead just a directory. In that case dd would copy the directory "disk1s3" to another directoy but of course bootcamp.raw is a file and not a directory. I don't own a Mac. You might get better information from the folks in the Mac Host Discussion group. I had assumed that the bootcamp partition was a real partition.