Copy/Clone physical partition into virtual hard disk

This is for discussing general topics about how to use VirtualBox.
Locked
sboard
Posts: 1
Joined: 31. Dec 2008, 23:48

Copy/Clone physical partition into virtual hard disk

Post by sboard »

Hi Guys,

I currently have Ubuntu installed on a physical hard disk partition, I have already set up my system to run a virtual machine using the partition as the hard disk. I now want to create a virtual disk that is an exact copy/clone of my physical hard disk partition, is this possible? If so how do I do it?

Cheers
Steve
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Yes, but there is a bug in the clonehd function in 2.1.0. The workaround is to stick with 2.0.6 until 2.1.2 is released or just copy the VDI then use the internalcommands setvdiuuid command to regenerate the UUIDs for the new copy. Once you've done this then you can register it with VB.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
scunning
Posts: 16
Joined: 23. Aug 2008, 18:28

Alittle bit more detail on Cloing an HD

Post by scunning »

TerryE has it exactly right but I wanted to add a bit more for those of us who are not so good with the Windows CLI

I copied a working VDI and re-named it to Alberich.vdi then I had to reset the UUID. Here is the full command and the output:

Code: Select all

C:\Program Files\Sun\xVM VirtualBox>vboxmanage internalcommands setvdiuuid "c:\Documents and Settings\steve\.VirtualBox\HardDisks\Alberich.vdi"

VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

UUID changed to: b57673e3-cee4-4cf1-8605-157ad9cb80f4
Now go into the Virtual Disk Manager and register Alberich.vdi

Then create a new machine and use this disk and it boots right up in a jiffy

steve
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Sorry, I've just realised that I answered the wrong Q and not Steve's. What Steve wanted to do was to copy a HDD onto a VDI. As well as the standard VBoxManage convertfromraw (convertdd in 2.0.6 and earlier) you can also use the disk-to-disk techniques that I discuss in my tutorial All about VDIs.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Mohsen
Posts: 1
Joined: 23. Apr 2009, 06:21
Primary OS: MS Windows 2008
VBox Version: PUEL
Guest OSses: Windows

Re: Copy/Clone physical partition into virtual hard disk

Post by Mohsen »

Steve/TerryE
Can you please help me how to do the clonehd. I have windows as Host and I can not find the uuid of my hard disk. I'd appreciate if you say how to use 'vboxmanage clonehd'.
Thanks
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: Copy/Clone physical partition into virtual hard disk

Post by TerryE »

You can use one of the following as a reference to your HD in the clonehd command:
  • A path absolute file reference
  • A path relative file reference. However remember that this is relative to the default HD location in your preferences, not the current working directory.
  • The UUID which you can obtain from a VBoxManage list hdds command if your HD is registered
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
chemaercero
Posts: 3
Joined: 25. Apr 2009, 11:11
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: WXP

Re: Copy/Clone physical partition into virtual hard disk

Post by chemaercero »

Hi,

Can you guide me to create a VM from my current XP installation.

I have tried but had not success yet.

Regards,
chemaercero
Posts: 3
Joined: 25. Apr 2009, 11:11
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: WXP

Re:

Post by chemaercero »

TerryE wrote: you can also use the disk-to-disk techniques that I discuss in my tutorial All about VDIs.
I could not find the disk-to-disk techniques in the link you mention.

Can you guide me please?

Regards,
chemaercero
Posts: 3
Joined: 25. Apr 2009, 11:11
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: WXP

Re: Copy/Clone physical partition into virtual hard disk

Post by chemaercero »

vbox4me2 wrote:See the quickclick items then.
Sorry, I do not get what you mean?

Regards, :(
Locked