
Ich verwende VirtualBox 4.1.x auf meinem Ubuntu-Rechner und habe mehrere virtuelle Maschinen eingerichtet. Da es mehrere Möglichkeiten gibt, eine virtuelle Maschine in VirtualBox auf einen anderen Computer zu verschieben, habe ich mich gefragt, welche die empfohlene Methode ist:
- Verwenden Sie das „Import/Export-Dienstprogramm“.
- Kopieren Sie den gesamten Ordner der virtuellen Maschine, der die
.vdi
und.vbox
Dateien enthält. - Klonen Sie den VDI mit „Virtual Media Manager“ und erstellen Sie dann eine VM auf der Zielmaschine neu, verwenden Sie dabei jedoch den geklonten VDI als Festplatte.
Ich habe erfolgreich die1. Methode 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?
Antwort1
Well done for doing your research. I regularly use all three options.
(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.
(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.(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.
Antwort2
Method 2 works well now (with VirtualBox 4.0 and higher), without any XML modification required:
- Stop your Virtual Machine
- Exit VirtualBox
- Copy the VM folder to the new location
- Restart VirtualBox, and delete the old VM.
- Go to Machine menu ≥ Add and browse to your new location.
That's it!
ps: I have VirtualBox 4.3.20 on OSX 10.10
See this VirtualBox forum post for more details.
Antwort3
My preferred option is option 2 as well:
- 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
Antwort4
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:
- Shut down VirtualBox on both hosts.
- Copy the
.config/VirtualBox
andVirtualBox VMs
folders from the source host. - Copy these folders to the destination host.
- Start VirtualBox on the destination host