Inscrivez-vous maintenant pour un meilleur devis personnalisé!

What are VirtualBox guest snapshots and how do you take them?

02 févr. 2023 Hi-network.com
Marko Geber/Getty Images

For a very long time, VirtualBox has been my go-to for virtual machines. It's free and has served me quite well. 

With VirtualBox, I can create any number of host operating systems, which makes it possible for me to run multiple Linux distributions and even MacOS or Windows. I currently have 36 different guest operating systems installed and ready to go at any time.

One way I've managed to keep my guest VMs running smoothly is by taking regular snapshots. This is one of the VirtualBox features I depend on.

What are VirtualBox guest snapshots and how do you take them?

Simply put, a snapshot is a way to save a virtual machine in its current state. Let me further explain this by way of an example.

See also

  • How to install Ubuntu Linux (It's easy!)
  • How to run a Windows app on Linux with Wine
  • How to get started with Git on Linux
  • How to kill a process in Linux

Say, for instance, you have a virtual machine for Ubuntu desktop that is running perfectly. However, you want to test a configuration or application that you're not quite sure about. 

Before you begin the installation of that app or make that configuration, you take a snapshot of the current state. You then install the app or make the configuration, and it breaks the desktop. No matter what you try, you can't get it back. 

What do you do? You revert to the snapshot you just took, where everything was running perfectly. Once reverted, you have your desktop back and you're good to go.

Also: How to create a Linux virtual machine with VirtualBox 

That's how important snapshots are. Now, allow me to show you how they work.

Requirements

The only things you'll need are a running instance of VirtualBox and a guest VM. It doesn't matter what operating systems serve as the host or the guest, as the process is the same.

That's all you need. Let's get to the snapshots.

1. Shut down the guest OS

To take a snapshot of a guest, the first thing you must do is shut down the guest operating system. Make sure to do this through the guest OS's regular shutdown process. 

For instance, with Ubuntu, you'd click the system tray in the upper right corner, click the power button, and then click Power Off.

Powering off Ubuntu Linux 22.04.

Screenshot by Jack Wallen/

2. Open the Snapshots toolbar

Right-click the guest VM for which you want to take the snapshot and click Snapshots.

Accessing the VirtualBox Snapshots feature through the right-click menu.

Screenshot by Jack Wallen/

3. Take the snapshot

In the resulting toolbar, click Take, which will open a pop-up. In the pop-up, give the snapshot a name and an optional description. 

Also: How to spin up a Linux virtual machine quickly with Boxes

I would recommend making the name be something like the date and giving it a description along the lines of "Pre-X Configuration" or "Pre-X-Installation," where X is the app to be configured or installed. The point is to make it as obvious as possible, so you don't have to guess which is which when you have multiple snapshots.

Naming a new VirtualBox snapshot.

Screenshot by Jack Wallen/

How to revert to a snapshot

Once the snapshot is taken, it's then available for you to use. If you click on the VM listing in the left pane, you'll see two things: the snapshot and the current state. The current state may be the broken state you cannot use. 

We've created a snapshot that can now be restored.

Screenshot by Jack Wallen/

If the current state is unusable, click the name of the snapshot you created and then click Restore. You can also create a snapshot of the current machine state. But if that state is broken, you might not want to do that, so uncheck that box.

You must click the Restore button before it will begin.

Screenshot by Jack Wallen/

This will restore your virtual machine to the snapshot you took, which means it's back to a running state.

Also: PikaOS is a next-gen Linux distro aimed at gamers

And that's all there is to creating and using a VirtualBox snapshot. Get in the habit of using this feature, as it can really save you a lot of headaches. I take snapshots every time I'm about to do something major to a guest OS. That simple task ensures that I always have a running state for a guest operating system.

Open Source

GitHub vs GitLab: Which program is right for you?The best Linux distros for beginnersFeren OS is a Linux distribution that's as lovely as it is easy to useHow to add new users to your Linux machine
  • GitHub vs GitLab: Which program is right for you?
  • The best Linux distros for beginners
  • Feren OS is a Linux distribution that's as lovely as it is easy to use
  • How to add new users to your Linux machine

tag-icon Tags chauds: Services et logiciels Logiciel libre

Copyright © 2014-2024 Hi-Network.com | HAILIAN TECHNOLOGY CO., LIMITED | All Rights Reserved.