Performing backups of the VirtualBox files

This is for discussing general topics about how to use VirtualBox.
Post Reply
jackyyaplt
Posts: 11
Joined: 12. May 2011, 20:28
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 7 x64

Performing backups of the VirtualBox files

Post 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)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Performing backups of the VirtualBox files

Post 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.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, OSX
Location: U S of A

Re: Performing backups of the VirtualBox files

Post 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
Post Reply