Live and/or automatic VM backups?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Red Squirrel
Posts: 118
Joined: 25. Jan 2009, 05:28

Live and/or automatic VM backups?

Post by Red Squirrel »

What is the best way to backup VMs in virtualbox 3.2? Does it have any way to back them up live and automaticly?

I'm trying to export as an appliance, but it takes up the GUI so I can only do one at a time. I'm also hoping there's a way to do a compressed backup. Not sure whether or not this export does it. I preallocate my space when I create VMs but I'm hoping the backups don't have to be that big.

I have 2 failing drives in my raid array and it just occurred to me the hell it would be to recreate all those VMs and rebuild all those environments if I get a total failure. File backups are nice but not enough. I need to back these up at least every couple months.

Thanks in advance!
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Live and/or automatic VM backups?

Post by scottgus1 »

Can't help about live backups, with the VM running.

But the concensus on the forum in searches I did and questions I asked, is that a "dead" backup, that is, where the VM has been shutdown properly, is the best. Once it has been properly shut down - with NO snapshots attached, so merge them all in - copy the VDI or other flavor of virtual disk you use and the .Virtualbox folder to another drive. Then restart the VM, if desired.

I use this method to back up a SBS2003 installation and it seems to work fine.
Red Squirrel
Posts: 118
Joined: 25. Jan 2009, 05:28

Re: Live and/or automatic VM backups?

Post by Red Squirrel »

I guess for my needs I can get away with non live backups, though live would be nice.

Now is there a way through command line I can force stop a VM, then start it? My backup job sends a message to say to shut down the VMs about to be backed up, but if I run the job and forget to shut them or w/e I want it to be done automaticly. I also want them to be started back once the backup is done.

The kicker is the vms are not running as root, and the backups run as root, so how would I control the vms from the backup script? Also I'm running in console mode, not headless, so when the vms stop and then start, I would need the console to still be accessible from within the vm user.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Live and/or automatic VM backups?

Post by Perryg »

Red Squirrel wrote: Now is there a way through command line I can force stop a VM, then start it? My backup job sends a message to say to shut down the VMs about to be backed up, but if I run the job and forget to shut them or w/e I want it to be done automaticly. I also want them to be started back once the backup is done.
Sure is. Look in your VirtualBox users manual and VBoxManage. It's all in there
The kicker is the vms are not running as root, and the backups run as root, so how would I control the vms from the backup script? Also I'm running in console mode, not headless, so when the vms stop and then start, I would need the console to still be accessible from within the vm user.
Depends. If you are using a Linux host then you can run scripts as normal use and sudo the lines that require elevated permissions.
Post Reply