Page 1 of 1
Running off moved snapshot?
Posted: 13. Sep 2016, 16:44
by Shadowbyte
We've got a Window 7 guest running on top of Linux.
About two weeks ago we moved the snapshot located in the snapshot folder to open some space thinking that it was not being actively used. It appears now that we have been running from the snapshot when we tried to re-start this morning. Is it possible that VM was running off a file that was non-existant? This seems strange. If not, were should we be looking for the data that has been stored for the last couple weeks.
Thank you in advance.
Re: Running off moved snapshot?
Posted: 13. Sep 2016, 17:32
by scottgus1
Snapshots are similar to Windows' System Restore points: point-in-past-time markers, not extractable, useless without the base system in place, but easier to corrupt because the files are accessible on the host drive.
Snapshots also do not store "files", like a backup folder would. Virtualbox snapshots store changed disk sectors, which may or may not contain the entire file.
Manually moving a snapshot will definitely result in data loss, and there is no way to tell if moving it back will restore the data within or will mess up other data.
Snapshots make a guest more delicate and do not work as backups. They should only be used on guests you're experimenting with and with data you wouldn't mind losing. The forums are replete with users destroying their important data because they did something wrong with a snapshot. Add your experience to this ever-growing list, unfortunately. The best backup is a simple folder-copy after the guest is shut down. See this tutorial
Moving a VM and re-interpret it as "Backing Up a VM". You can also back up while the guest is live with in-the-guest software.
Re: Running off moved snapshot?
Posted: 13. Sep 2016, 18:28
by socratis
To add to what Scott said, read the following nice explanation about differencing disks and snapshots (which are based on the concept of differencing disks) and you'll pretty easily figure out why they can be really bad.
ChipMcK in a [url=https://forums.virtualbox.org/posting.php?mode=quote&f=1&p=276859#pr276859]recent post[/url] wrote: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.