How to use GNOME Boxes' snapshot capability | Opensource.com

How to use GNOME Boxes' snapshot capability

GNOME Boxes' snapshot capability preserves data in case you need to revert your virtual machine to a previous state.

Gnomes in a window.
Image by : 
Gunnar Wortmann via Pixabay. Modified by Opensource.com. CC BY-SA 4.0.
x

Subscribe now

Get the highlights in your inbox every week.

In the first article in this series about GNOME Boxes, I explained how to get started with the virtualization application, and in the second article, I described GNOME Boxes' remote access capabilities. Here in the third installment, I will cover GNOME Boxes' snapshot functionality, which is a useful way to preserve data quickly.

Snapshot technology, which has been implemented in databases, filesystems, and operating systems, is extremely useful with virtual machines (VMs). Taking a snapshot of a VM preserves its state at a specific point in time. Restoring or reverting the snapshot returns the VM to that state, regardless of any changes made after the snapshot was taken. This capability can be useful for conducting tests of new software or patches and also when something has gone horribly wrong. As a virtualization tool, GNOME Boxes has this feature.

Time travel

Snapshots allow us to move forward and backward in time. We can save the Box at various points and revert to those points whenever we want to revisit one. There is one important thing to remember, though. The current, running state of a Box can be considered the active state. When you revert to any snapshot, you will lose the active state. So, if you intend to (or think you might) return to the current state, you must take a new snapshot prior to reverting to another one. Note that this feature is not applicable to remote Boxes.

To access the snapshot feature, click the Properties menu on a local Box. If you are on the main screen, right-click on the Box. If you are viewing a Box, you can access the menu from the button in the top-right corner. Then click Snapshots at the top of the Properties screen.

1-propertiesmenu.200.png

Local Box Properties menu

A local Box's Properties menu

2-nosnapshotstakenyet.600.png

Local Box Snapshots screen

A local Box's Snapshots screen

Creating a snapshot

The Snapshots screen shows all existing snapshots and a small plus (+) button at the bottom for creating new ones. Go ahead and click the plus button. The first thing you see is "Creating new snapshot…" and a progress indicator. Be patient, as creating a snapshot can take a few minutes. When it's complete, the new snapshot appears with the date and time it was created and a small gear icon. This icon brings up the Actions menu for reverting, renaming, or deleting the snapshot.

3-newsnapshotwithmenu.600.png

Snapshot with menu

A snapshot and its Actions menu

That's it! You now have a snapshot of your Box.

Reverting a snapshot

Suppose you are a tester. Each time a new version of your product is built, you need to conduct user acceptance testing. You could create a new VM every time or replace the old version with the new one. That can be a time-consuming process. Removing an old version may not completely remove all remnant files, which could taint future testing. This is where a snapshot comes in incredibly handy. Simply revert to a previous, "known-clean" state before each new test to ensure the integrity of the test.

Or suppose you made some changes to your VM and ran a few scripts, then you realize some important files in your home directory were mistakenly deleted. You don't need to worry, though. You can go back to the Snapshots screen, select the Actions menu for the snapshot named 08/15/2019, 10:28:52 AM, and click Revert to this state. The Box will be returned to the exact point when this snapshot was taken.

Renaming a snapshot

As you create more snapshots, it can get confusing to keep track of them based only on the creation date and time, which is Boxes' default naming convention. For this reason, it is good to rename your snapshots to make them more descriptive. Just open the Actions menu for the snapshot and select Rename from the drop-down.

4-renamesnapshotsexample.600.png

Snapshots with descriptive names

Snapshots with descriptive names

Deleting a snapshot

If you decide you no longer need to keep a snapshot, it's easy to delete it. Just go back to the snapshot's Properties and select Delete from the menu. Deleting a snapshot will not interfere with any other snapshot or the active state of the Box.

As I have shown in my previous Boxes articles, you can have one or more VMs—or as GNOME Boxes calls them, Boxes.

A cube of innovation.

GNOME Boxes is an easy way to create virtual machines for development, experimenting, and learning tasks.

Topics

About the author

Alan
Alan Formy-Duval - Alan has 20 years of IT experience, mostly in the Government and Financial sectors. He started as a Value Added Reseller before moving into Systems Engineering. Alan's background is in high-availability clustered apps. He wrote the 'Users and Groups' and 'Apache and the Web Stack' chapters in the Oracle Press/McGraw Hill 'Oracle Solaris 11 System Administration' book. He earned his Master of Science in Information Systems from George Mason University. Alan is a long-time proponent of Open...