Virtual Machine Backup / Restore

This is for discussing general topics about how to use VirtualBox.
Post Reply
Samfree
Posts: 2
Joined: 30. Jul 2012, 06:58

Virtual Machine Backup / Restore

Post by Samfree »

Is it possible to Backup a virtual machine (Including the Virtual Hard Disk and all snap shots) so the it is possible to restore the machine?

I am running 4.1.18, but this version is a result of many upgrades (since Version 2). I have a weird bug that when I terminate a machine
and ask it to revert to the snapshot, the machine becomes inaccessible. I would also like to save all my current VMs, and uninstall
Virtual Box and do a clean reinstall so that any artifacts left over from V2 are gone.

I'd also like to be able to keep backups so that if this does happen I can easily reload the machine.

Can this be done? I would have expected something like this to be included in the manual since it seems like a pretty basic but important
type of task. Any assistance or a reference to a solution would be much appreciated. I've done a fair bit of searching but didn't find
an answer that applies to this exact situation - best I found was cloning a machine.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Virtual Machine Backup / Restore

Post by mpack »

If the VM has not yet been converted to v4 format then I would clone it first (right click VM and select clone - be sure it's a full (not linked) clone) - and make sure the clone works before taking any further steps you might regret. In v4 format all VM related files are contained inside a single folder, that folder is easily copied off to external storage and makes an excellent backup.

One tip however: I would stop using snapshots if you care about data integrity. When you clone a VM, if you choose the "current state only" cloning option then the snapshot structure will be discarded, though the latest data is kept.
Samfree
Posts: 2
Joined: 30. Jul 2012, 06:58

Re: Virtual Machine Backup / Restore

Post by Samfree »

Thanks for the quick reply mpack - a quick follow up question...

I've successfully done the two types of clones with V4 and they seemed to work fine. Only thing I couldn't figure out is how I would reinstall a saved clone folder to recreate the VMs into a clean Virtual Box Install?


Maybe I should make this a separate thread, but I was wondering if you could please explain what you mean by " I would stop using snapshots if you care about data integrity."?
Are you talking about the system messing up the XML file so that the virtual disk is essentially inaccessible?

I've had that problem more than a few times, which is why I am asking about backup, but other than that I've never had any problems.
I don't know what I'd do without snapshots... do all my high risk activities (torrents / websites like facebook/myspace etc. that are
prone to hacking, system software updates, new software, etc.) in a VM. After browsing or if an update goes wrong, it's easy to
revert to the latest snapshot and get rid of the problem. I store anything that I want to keep in a shared folder on a real hard disk.
If you have any better suggestions I'm all ears.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Virtual Machine Backup / Restore

Post by mpack »

I would like to emphasise that cloning is only necessary if the VM is not already in v4 format (which can be distinguished because the control file has a .vbox extension instead of .xml). Once in v4 format the the VM can be backed up by copying the VM folder to secondary storage. A VM can be restored to an earlier state by replacing the VM folder files from the backup copies. The backup can be loaded on a new host by copying the folder onto that host and using Machine|Add... .

I don't think I need to explain what I mean about snapshots and data integrity. Just search this site with the word "snapshot".
Post Reply