Snapshots CLI explained

Discussions related to using VirtualBox on Linux hosts.

Snapshots CLI explained

Postby sonicbuddha » 1. Aug 2009, 07:12

Can I get a little help understanding the basics of snapshotting from the command line? Not to be critical, but this feature doesn't seem to be outlined well in the documentation, which is too bad since it is such a major plus for VirtualBox usage.

Here's how I understand it (and the parts I don't):

To take a snapshot, which is easy enough:

Code: Select all   Expand viewCollapse view
VBoxManage snapshot <guest> take <name> [-desc <description>]

The snapshot is not a full copy but a copy of what has changed since the last snapshot. Each snapshot builds on this logic, keeping snapshots small.

To revert to the last snapshot taken:

Code: Select all   Expand viewCollapse view
VBoxManage snapshot <guest> discardcurrent -state

This changes the current state to the last snapshot, which is what the '-state' implies. This seems self explanatory.

Here's where I get muddy:

Code: Select all   Expand viewCollapse view
VBoxManage snapshot <guest> discardcurrent -all

If I understand this correctly, this skips the last snapshot and goes back to the previous, changing the "current state" to the snapshot previous. I don't understand the logic behind the name "-all", which is admittedly confusing.

If I want to go back to a snapshot several snapshots ago I have to delete snapshots until the snapshot I want to revert to is the most recent, which honestly begs the question of why snapshot management is so rudimentary and I can't specify a specific snapshot by name? Still, that sounds more like a feature request than a request for information- unless I'm missing something.

What is really confusing is that the discard option doesn't work at all like expected. For example:

I have four snapshots, test1, test2, test3, and test4. I run:

Code: Select all   Expand viewCollapse view
VBoxManage snapshot <guest> discard test2

And I don't lose test 2 but instead I lose test1. I continue to delete snapshots and instead of removing what I'm asking its always deleting from the oldest. Why? Is there something I'm missing, such as the snapshots are being merged and then renamed? On what basis of logic? I tried this via the gui and this is not the behavior. Am I encountering a bug?

I am using version 3.0.2r49928

Please explain for I feel very confused and a bit insecure about using snapshotting until I understand it better.
Posts: 5
Joined: 19. Jul 2009, 11:06
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: ubuntu 8.0.4

Re: Snapshots CLI explained

Postby TerryE » 2. Aug 2009, 13:43

My tutorial All about VDIs explains the snapshotting process in more depth.
Read the Forum Posting Guide
Google your Q or search for the answer before posting.
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 15 guests