Ubuntu – How do you back up your Virtual Machine

12.04virtualization

A quick question. I am running a Windows Server 2008 Virtual Machine on Ubuntu using Virtual Machine Manager. My question is I want to make regular back up of the Virtual Machine as its very important since the VM is our DC on our network. Any suggestions?

Best Answer

Backing up the .vdi file (virtual disk image) on a regular basis has some major disadvantages.

First: the Backup becomes pretty large, because you cannot do differential backups, meaning, that when something minimal is changed on the disk image (since it is the virtual hard drive it changes all the time) you can't take advantage of saving just the files that changed because it is only one file. You will have to backup the whole image.

Second: when the machine is running, while you back it up, you have a high chance of getting an inconsistent backup, because the backup program needs some time to walk through the big image. So you would need to turn off the vm.

What you could do, is to use the snapshot feature of VMs. Then you would only have to backup the snapshots, which are way smaller than the virtual disk image and static. Or you could allow the VM to share a folder on your real hardware like explained here, or even better, use a separate fileserver like e.g. samba, if you have the resources, and then simply use guest-side backup to that folder with any backup program you like, or the built-in backup, that comes with the guest-os. The last would be my favorite, because then you get to use all the features, that a built-in backup system comes with.