Page 1 of 1

Comand Script - backup virtual machines overnight

Posted: 28. Nov 2013, 17:28
by Elidan
Hi

I have been looking at backing up virtual computers overnight. I was just wanting to check that I am on the right track here...

If I used 'controlvm "computer name" shutdown' to shutdown the computer
then ran 'clonevm "computer name" --basefolder h:\vmcomp' after that to copy the hard drive to a backup drive

would I need to schedule startvm to run later or could it be put in the same script to run when the clone is finished? is so would it be a simple matter of scheduling a couple of batch files overnight in order to make safe vm backups of my computers?

thanks in advance

Re: Comand Script - backup virtual machines overnight

Posted: 30. Nov 2013, 10:27
by noteirak
Subjet has been discussed quite a few times - but yes you can of course restart a VM within the same script. Why couldn't you?

On the other hand, using the clone command for a backup means you are NOT doing a backup, but a new copy of the VM with many important IDs reset within.
You may encounter activation problems as well as network issues - see vboxmanage clonevm User Manual entry for details.

What you should do is a copy of the VM folder. This way you will have the same VM in case you need to restore.

Re: Comand Script - backup virtual machines overnight

Posted: 2. Dec 2013, 17:32
by Elidan
Thanks for the advice.

So basically the clone is totally unnecessary and a scheduled shutdown and startup would be easier with a file copy in between.

Re: Comand Script - backup virtual machines overnight

Posted: 2. Dec 2013, 18:21
by mpack
The purpose of cloning is to create a new VM which is a copy of an existing VM. If all you want to do is make a backup of the existing VM then simply copying the VM folder is all you need: ideally with the VM fully shut down (not suspended). Btw, it's a folder copy - copying (say) just the VDI file does not make an adequate backup. The control files are important too.