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.
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.
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.
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.
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/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/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/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.