Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any recommended way of cloning virtual machines in VirtualBox? I would like to install an Operating System and then make several clones of that one. I have tried with export and import appliance but I have got some problems doing it that way. See Internet connection fails in Ubuntu on VirtualBox when virtual machine is created from “Import appliance”

I have now also tried VBoxManage clonehd, but I got the same problems as when I exported the appliance. The machine gets no IP-address.

share|improve this question
    
but I have got some problems doing it that way. Details? Please quote error messages. Are the problems with simultaneous usage of the cloned images? –  mctylr Mar 19 '10 at 18:19
    
Details about that problem is in the other question, follow the link. Thanks anyway. –  Jonas Mar 19 '10 at 18:45
add comment

4 Answers

up vote 4 down vote accepted

I have used the vboxmanage command to clone drives and it has worked fine for me. If you are running the machine in bridged network mode on the same machine, perhaps the two virtual machines are competing for the network card somehow.

I would troubleshoot like this:

  • Let the original virtual machine configuration use the new hard drive file, and try to boot only that machine. (Change the "storage" and use the new, cloned disk image instead of the original one).

If this works then you know it's not a problem with the virtual drive, it's the virtual machine config.

If that turns out to be the case you can try this:

  • Verify that the two virtual machines have different MAC addresses (Under "advanced" in the network settings for the VM).

  • Let both machines run in NAT mode.

  • Enable an extra network card on the new virtual machine and see if that gets an IP-address.

share|improve this answer
add comment

If the Import/Export option doesn't work, investigate the command-line options available with the VBoxManager command. This link may prove useful.

share|improve this answer
    
Thanks, VBoxManage clonehd seams to be the right thing to do. But I still got the network problem, but that is however solved in my other question. –  Jonas Mar 19 '10 at 20:22
add comment

I found an article on cloning and copying VirtualBox machines which worked fine for me..

share|improve this answer
add comment

The way I make copies of a VirtualBox VHD is by using CloneZilla, a live CD used for cloning and imaging disks.

In a nutshell:

  1. Install your OS the way you want it.
  2. Download the CloneZilla ISO and mount it in the virtual machine
  3. Attach a virtual hard disk of the same size or larger as a second disk in the virtual machine.
  4. Clone the primary disk to the secordary
  5. If needed, resize the partition.

You should be able to find a tutorial how to do this on the VirtualBox forums.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.