Page 1 of 1

Performing backups of the VirtualBox files

Posted: 5. Jan 2014, 15:25
by jackyyaplt
Hi,
I would like to periodically backup my VirtualBox files (yes, I mean the physical windows files). I would like to know if I can just backup only those files that had been changed?

I usually create snapshots, and directly powering off the machine (i.e. I did not go through the guess OS shutdown, but just close it with the option of powering off the machine). I noticed that the original disk vmdk files (i.e. those disk files in the root of the VM, e.g. MyVirtualMachine-disk1.vmdk) are usually unchanged, only those in the snapshots folders are changed.

In such case, can I do an incremental backup by simply copying the snapshots folder and the *.vbox and *.vobx-prev files only?

Thanks and regards,
Jacky
(I am using Windows 7 x64 host and Linux as the guest)

Re: Performing backups of the VirtualBox files

Posted: 5. Jan 2014, 16:52
by mpack
Snapshots have nothing to do with making backups, so they don't enter into the discussion here.

The best way to backup a VM is to copy the entire VM folder to backup storage. IMHO anything less is risky. This has been discussed many times - try a search.

Re: Performing backups of the VirtualBox files

Posted: 5. Jan 2014, 20:56
by ChipMcK
When a virtual disk is first created for a new virtual machine, it is considered as the base disk for the guest - data for the guest is read from and written to that disk image.

The differencing disk records changes sector-by-sector to the whole disk image, not changes to any file in the disk. VirtualBox does not know what file system is employed on the disk image and therefore can not access any individual file of/on the disk image; only the guest OS is aware of that information.

First SnapShot creates a differencing disk for read/write access while the base disk becomes read-only - as the guest modifies its data, the data is written to the differencing disk and the base disk is untouched.

Second SnapShot creates another, new, differencing disk for read/write access while the first differencing disk becomes read-only along with the base disk.

Subsequent SnapShots create additional differencing disks, with the preceding differencing disk joining the hierarchy (pecking order/chain) of read-only disks.

Keep in mind that access to/from the virtual disks is sector-by-sector, not file-by-file.

When the guest requests that a sector be read, the latest SnapShot is read first. If the sector is not found there (Sector-Not-Found is returned), the next SnapShot in the chain (youngest to oldest), until the base virtual disk is reached. Then the sector on/in the base virtual disk is either read or Sector-Not-Found is returned.

Best of Luck