Main Task
What is the procedure for dumping a VirtualBox system? Note that this is not migrating the guest OS from hardware to virtualization or anything else mentioned by Googling "migrate virtualbox". I mean:
- Moving all guest data (virtual drives, snapshots, etc) onto external media or remote storage
- Being able to confidently and completely delete that data from my system
- From a different system with VirtualBox installed, being able to fetch the guest data, write it to the local storage, and boot it up.
I suspect that the backing up part is straightforward enough; but the restoration may require manual edits of the XML config files via some well-defined process. I'd love to know that process.
Bonus points
- I am on Linux, but a platform-independent solution would be great too. Hell, even a Windows solution would be a decent starting point.
- If the solution supports dissimilar installation and data directories, that would be cool. But if not, I can accept the requirement that both systems use identical paths for VirtualBox directories
- Support for dissimilar host hardware (specifically Ethernet) might be nice, but is not terribly important for me.
Well, any ideas? I will upvote partial solutions which point me in the right direction.
If you're using VirtualBox 2.2.0 or newer (you should; lots of bugs fixed and bottlenecks removed) you get this out of the box. You can import and export virtual machines in the cross-solution Open Virtualization Format. You can do this both via GUI, and from scripts using the vbox command line interface. The resulting backups are cross platform.
See the VirtualBox 2.2.0 PDF manual chapter 3.8 on page 55: Importing and exporting virtual machines.
Fpr Linux: If you wan't to transfer all virtual machines you can simply copy the ~/.VirtualBox folder from one machine to another. As long as the VirtualBox Versions are the same this will simply work. (I recently mounted this folder via sshfs and even this worked).
When using VirtualBox, you can't move the virtual machines around unless there are no snapshots. With snapshots present, it causes all kinds of headaches and corruption - and the snapshots themselves cannot be moved either.
So remove all of your snapshots, then copy the file around: I'd stick with the entire subdirectory. I've done it myself: moved a guest from one Linux laptop to a newer one. I had to add the VM to the list of VMs known of by VirtualBox, but it worked beautifully.
You could also convert the VMs to vmdk files and move them about that way. With the files as vmdk files, you could potentially move the VMs from VirtualBox to VMware or other similar steps.