I recently had a mishap on my VM, where for somereason the settings of my BridgeNetwork got changed randomly. I had to spend quite a bit of time to figure out the root cause. Rightnow, I manually copy paste the VM into another folder which is then periodically backedup to Google-Drive. However, when I tried to copy the backup to the original folder under "C:\Users\username\VirtualBox VMs\", I couldnt startup both of the VMs (the latest one and the one from the backup), as it complained that the VMs had same UUIDs. I was able to figure out how to rectify this issue, but would like to prevent this kind of issue and make this process automated (https://stackoverflow.com/a/49471969/4752883)
While debugging this issue, I came accross 3 solutions to backup the drive, and am trying to figure out whether one process is better than the other, for automating the backup process at regular intervals of time.
- export/import the VM
- copy paste the VM folder
- clone the VM
From this article https://forums.virtualbox.org/viewtopic.php?f=1&t=63079, it
seems atleast in 2014, copying the folder is better process. However, copying
the folder isn't allowed when the VM is actually running. Cloning and exporting
the VM is allowed, when the VM is running. Since my VM is running almost all
the time, I would have to manually shutdown the VM and then copy the VM folder,
which would defeat the purpose of automation. So it seems that the only 2
exporting the VM or `cloning the VM. Further, if I copy the VM
folder, and then try to bring up the copy of the VM and the VM itself, the
UUIDs will clash. As a result I wont be able to bring both of them up online at
the same time to debug any issues.
Just to future proof this solution, these are some requirements that I came up with to backup the VM
- ability to automate the backup at a period of 7 days
- ability to run the backup without having to stop the VM
- ability to move the backup from one computer to another (to reduce risk of computer failure)
- ability to save the backup folder on another drive (to prevent harddisk failure)
- ability to bring up both the VMs at the same time without too much work
- preserve all settings (snapshots, ip addresses, configurations) from the current VM
- ability to transfer to other VM softwares (
VMwareetc) in future. This is a
nice to havefeature, but not necessary, and I am unlikely to move to
VMWarein the near future.
If I copy paste the folder into another folder, and then zip it up, it seems I cant restore it back along with the original repo, as UUIDs will clash. So is it better instead to clone it and then create a zip file of that for backup?
If I export the VM as a appliance, will it retain all the settings of the VM (snapshots, ip addresses, etc), while just giving it new UUIDs and creating a archive?
What combination of commands can I use to satisfy the requirements atleast 1-6, and if possible 7?