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.

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 VM in VirtualBox to another computer, I was wondering which one is the recommended way:

(1) Use the "Import/Export utility";
(2) Copy the entire VM 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 but the problem is that after exporting and importing, the disk image is transformed into .VMDK and no .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 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 get in my way!

So what's the best method of safely transferring my VM's to another computer with VirtualBox ?

share|improve this question
1  
Just transfer the files and place them in the same location. –  Ramhound Aug 18 '13 at 21:16

2 Answers 2

up vote 10 down vote accepted

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

Option 1 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.

Option 2 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.

Option 3 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 at 3:41

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.

Note1: there was no requirement to clone VMs or alter the xml file. VB version was fairly current: 4.3.12r93773.

Note2: 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.

Note3: 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

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.