Page 1 of 1
Best way to backup a VM?
Posted: 9. Dec 2013, 04:31
by PeterNosko
Could someone tell me the best way to back up individual guest machines? I exclude my machines folder from Time Machine backups because of the size (and because the machine might be active during such backups).
If I do an appliance export, could I delete my current machine and re-import from this .ova w/o issues like a duplicate disk ID, etc?
Thanks.
Re: Best way to backup a VM?
Posted: 9. Dec 2013, 08:38
by ChipMcK
The guest OS should be ShutDown when you copy the V4-VBox folder/directory [containing the virtual machine] to a directoryfolder on a backup (external) hard drive.
The file structure of Version 4 of VirtualBox defaults to having all files pertaining to a virtual machine in a single folder/directory.
Re: Best way to backup a VM?
Posted: 9. Dec 2013, 08:39
by socratis
PeterNosko wrote:Could someone tell me the best way to back up individual guest machines?
I'm not sure that it's the "best" way, but it's my way™. I exclude the VBox-VMs folder from the TimeCapsule backup and I manually copy the folder to another HD along with my /Users/<username>/Library/VirtualBox folder. This is done when the VMs are shutdown. I also take a (large) cup of coffee at the time, just because of the shear GBs involved. It's not a daily practice, more like a monthly one (if I remember at all

).
Re: Best way to backup a VM?
Posted: 9. Dec 2013, 17:13
by PeterNosko
Thanks to both of you. Backing up while the VM is shut down is common sense. In fact, I don't even like to have VirtualBox open. I guess the way to be sure is to test a "restore." I wish I had done this before I reactivated my Windows license (which I had to do by phone).

Re: Best way to backup a VM?
Posted: 9. Dec 2013, 19:40
by Rootman
The above work just fine, they take up as much disk space as your VDI file is for each backup though. I take a lightly different tack. I back mine up just like I back up my physical boxes.
It is fairly involved and has a rather steep learning curve though. I boot each VM to an ISO file with a Windows PE (built with WinBuilder - Google it) and then use Symantec Ghost to ghost each machine over the network to the hosts storage. This backs up only the data and can compress it fairly well too. There is no real advantage other than space savings. I can restore the image to a larger or smaller VDI or recreated VM as well without much effort. It's just how I do it.
Re: Best way to backup a VM?
Posted: 9. Dec 2013, 19:45
by PeterNosko
Rootman wrote:...with a Windows PE (built with WinBuilder...
Thanks, Rootman. But I run this one Windows VM out of necessity, and it gives me my fill of that particular OS.

Re: Best way to backup a VM?
Posted: 10. Dec 2013, 16:53
by Rootman
Yep, I hear you.
I find that the way I do it, after mounting the learning curve - also allows me the ability to restore individual files / folders as well, being a type of true backup rather than just a copy of the VDI file. I've also used it to resize disks and clone the OS without having to mess around much at the host level beyond just creating a new VDI.
Re: Best way to backup a VM?
Posted: 10. Dec 2013, 19:49
by PeterNosko
Rootman wrote:also allows me the ability to restore individual files / folders as well...
Do you mean individual files on the VM? FWIW, I map the My Documents folder to a shared "network" folder on my host and let Time Machine back up all my data files. Time machine proved itself to me when I lost my boot drive to a hard mechanical failure. I replaced it with a new drive, booted my OS X DVD, restored from the backup and an hour later (to borrow from Service Pro's motto), it was like it never happened.
Re: Best way to backup a VM?
Posted: 10. Dec 2013, 21:16
by Rootman
PeterNosko wrote:Do you mean individual files on the VM? FWIW, I map the My Documents folder to a shared "network" folder on my host and let Time Machine back up all my data files. Time machine proved itself to me when I lost my boot drive to a hard mechanical failure. I replaced it with a new drive, booted my OS X DVD, restored from the backup and an hour later (to borrow from Service Pro's motto), it was like it never happened.
Yep, I treat the VM just like I treat any physical PC. On a "real" PC I stick my thumbdrive in a USB slot, boot to it via Easy2Boot (a SUPERB set of scripts that uses Greb4DOS to make booting damn near ANY ISO as simple as drag and drop) to Windows PE and back up / reimage or work on the drive. I do the same for VMs just by mounting the ISO to the same PE and boot to it and cut a Ghost image of the OS to a network resource. I've restored complete OS's or just damaged parts using Ghost Explorer and just drag and drop what I need back to the drive.
Sometimes people forget that you can treat these VMs just like any other machine and fix 'em or abuse 'em the same ways. Including running Timemachine or any other such util on them.
Re: Best way to backup a VM?
Posted: 12. Dec 2013, 00:55
by noteirak
@Rootman: so you backup the content of the VM, but not all the extra metadata associated with it? That would also cause the same issues as physical PC : you will encounter issue if you try to restore that ghost image to a new VM, since the UUIDs are different. I can see reactivation issues in Windows and booting issue in Linux.
Your way is also a lot more overhead and downtime to perform a backup.
Finally if the VM is properly maintened, I don't see where you can gain space : the VDI should be compacted regularly to keep the size as close as possible as the real data.
To me it looks like you loose all the advantages of having a *virtual* machine and get all the disadvantages of physical ones.
Re: Best way to backup a VM?
Posted: 14. Dec 2013, 18:11
by Rootman
noteirak wrote:@Rootman: so you backup the content of the VM, but not all the extra metadata associated with it? That would also cause the same issues as physical PC : you will encounter issue if you try to restore that ghost image to a new VM, since the UUIDs are different. I can see reactivation issues in Windows and booting issue in Linux.
Your way is also a lot more overhead and downtime to perform a backup.
Finally if the VM is properly maintened, I don't see where you can gain space : the VDI should be compacted regularly to keep the size as close as possible as the real data.
To me it looks like you loose all the advantages of having a *virtual* machine and get all the disadvantages of physical ones.
Well to each his own. I boot to PE, chkdsk and defrag the VM and then back it up, takes 30 minutes and I get a clean backed up OS I can restore files or folders from. It take minutes to create a new VM in VBOX, boot to the same PE and use ghost to make a clone. It works quite well for me. It's just another option.