Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use VirtualBox 4.1.x on my Ubuntu machine and I’ve set up several virtual machines. Since there are several ways one can move a virtual machine in VirtualBox to another computer, I was wondering which one is the recommended way:

  1. Use the “Import/Export utility.”
  2. Copy the entire virtual machine folder, containing the .vdi and .vbox files.
  3. Clone the VDI using “Virtual Media Manager” and then recreate a VM on the target machine but using the cloned VDI as the hard disk.

I have successfully used the 1st method several times and it has always worked. The problem is that after exporting and importing, the disk image is transformed into VMDK and not VDI anymore!

The 2nd method is probably the easiest but I’m not sure that simply copying the files will work or not on the target machine. When searching about this method, I found some people had problems in which they had to edit the VirtualBox.xml file to solve it!

At last, there’s the 3rd method, but it requires the extra work of creating a VM similar to the original VM configuration, which is not desirable.

It’s clear from the above explanation that my desired method is the 2nd one, but I need expert advice on this if it works or not. I don't want any XML editing getting in my way!

What’s the best method of safely transferring my VM’s to another computer with VirtualBox?

share|improve this question
Just transfer the files and place them in the same location. – Ramhound Aug 18 '13 at 21:16
@seyed 1. A fail-safe solution with high success rates/ reproducibility may not always be the recommended and/ or best solution to a problem and vice a versa. However, since, you ask about the recommended solution, option (2) from your list (though error-prone) would be the quickest and hence recommended! Options (1) & (3) fall under the fail-safe category, as they will work under most circumstances. P.S.: post-export, some (most?) configuration settings can be changed (if options 1 / 3 are used)! ... Hope this helps. – Amar Jul 6 '15 at 10:43
up vote 68 down vote accepted

Well done for doing your research. I regularly use all three options.

  1. (Use the “Import/Export utility”). This is the easiest because it combines the whole VM into a single file and transfers it over without issue pretty much every time. However, in my experience when creating the OVA or OVF file for export it throws away all snapshots and if done incorrectly can result in a VMDK file. When you re-import the VM you should be able to select what type of HDD file you want created, VDI or VMDK.

  2. (Copy the entire virtual machine folder, containing the .vdi and .vbox files). This is my preferred option and although I have had to edit the XML file a few times it's been my own fault for messing something up. Make sure that when you copy the VM, you get ALL the files associated with it. The issues I ran into were when certain snapshots and secondary VDI files were in the wrong directory and weren't copied properly. If you copy all the files (and permissions) you should not have any problems whatsoever.

  3. (Clone the VDI using “Virtual Media Manager” and then recreate a VM on the target machine but using the cloned VDI as the hard disk). This is less desirable because then you have 2 copies of a VM, and it can cause licensing issues, network issues, etc, depending on how you clone the VDI file.

In summary, I would definitely recommend option 2, just make sure you get all the needed files when you move it over.

share|improve this answer
Thanks for the reply. I will wait a few more days to see if anyone else has any other point. (+1) – Seyed Mohammad Aug 19 '13 at 8:08
Looks like no one has anything to add ... So I'm marking this as the answer. – Seyed Mohammad Aug 27 '13 at 7:09
Just an additional reference for Option 1, link, after importing, the format is VDMK, it seems to be determined and cannot be changed. – simongcc Sep 4 '14 at 3:41
@tbenz How do I avoid getting a VMDK when exporting? – Don Rhummy Nov 10 '15 at 22:40
Just to be complete: If you do Option 2, do this on the target machine: Virtualbox > Machine > Add > [navigate to the folder where all the VM files are]. Probably a good idea to put the new VM files in the same folder where all your other VMs are stored. – Donn Lee Apr 15 at 18:20

In case anyone else is looking for an answer to this I successfully moved 5 Virtual Box VMs to another Win7 install on a new hard drive on the same machine (essentially a move from one guest OS to another on the same PC). I realise that drivers on a completely new machine would probably vary and potentially have a negative effect on the move but I've documented the process below in the hope that it may help someone.

  • There was no requirement to clone VMs or alter the xml file. VB version was fairly current: 4.3.12r93773.
  • New copies of VMs were created in a new folder/shared drive to retain existing/old VMs intact. I can still boot from the old hard drive which I've retained for redundancy/issue resolution until I'm happy with my new setup; so I can access the old VMs in their former state if necessary.
  • Drive letters will vary/may not be necessary depending on your setup.

On Old Win7 Host:

  1. Ensure all VMs are powered off.

On New Win7 Host:

  1. Create new folder called X:\NewVMs\VirtualBox VMs (from New Win7 machine to ensure permissions OK)
  2. Copy/Paste (don’t drag) all VMs and related folder contents from the old folder to this folder (uses new permissions)
  3. Uninstall VirtualBox (if installed)
  4. Delete .virtualbox folder and all contents (if existing)
  5. REBOOT to confirm no program files or registry entries remaining (if uninstalling old VirtualBox).
  6. Install/Re-install VirtualBox (ensure you’re using the same version as the VirtualBox on which VMs were created on old host/machine (in my case ver. 4.3.12r93773))
    IMPORTANT: (Don’t select tickbox to open/run VirtualBox at end of installation)
  7. Copy/paste (don’t drag) .virtualbox folder and contents from Old Win7 Host (usually C:\Users[username].VirtualBox
  8. Now open VirtualBox
  9. Set preferences for new Default VM creation folder to the same file path as the newly created VirtualBox VMs folder: X:\NewVMs\VirtualBox VMs
  10. Test status of VMs

Good luck.

share|improve this answer
While this is an informative Answer, it isn't regarding what was asked. Another Question might be a more appropriate location for your Answer. – akTed Mar 28 '15 at 19:34

My preferred option is option 2 as well:

  1. Copy the entire VM folder, containing the .vdi and .vbox files.

But sometimes a UUID mismatch will happen. Often this happens if you just copy the VDI disk image of one machine into another machine but I have had it happen during straight copies of full directories as well.

So, if this is the message you get after moving the virtual machine and trying to start it up in the new setup:

Failed to open the hard disk .

Cannot register the hard disk becuase a hard disk with UUID already exists.

Just go into the directory of your virtual machine; of course change the actual path to match the actual path you are going into:

cd /full/path/to/virtualbox/virtualmachine/Sandbox

And run this command to assign the disk a new UUID:

VBoxManage internalcommands sethduuid Sandbox.vdi
share|improve this answer

Method 2 works well now, without any XML modification required:

  1. Stop your Virtual Machine
  2. Exit VirtualBox
  3. Copy the VM folder to the new location
  4. Restart VirtualBox, and delete the old VM.
  5. Go to Machine menu ≥ Add and browse to your old folder.

That's it!

ps: I have VirtualBox 4.3.20 on OSX 10.10

share|improve this answer
Can't believe is not up-voted much as it should be! This is the most easy way (too easy!) when moving the VMs within the same OS. Successfully moved two VM from drive C to drive D. Mine is Win7 64bit with Virtualbox 5.x – Edwin Yip Jun 4 at 12:37

For the special case where:

  • you only have a single VM (or want to move all of your VMs),
  • and the host is the same hardware with same OS version (or reinstalling same OS to same machine)

If you are in this case, then things are easy:

  1. Shut down VirtualBox on both hosts.
  2. Copy the .config/VirtualBox and VirtualBox VMs folders from the source host.
  3. Copy these folders to the destination host.
  4. Start VirtualBox on the destination host
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .