Categories
Self-organization

How to save time by using snapshots in virtualbox

Taylor Gibb is a professional software developer with nearly a decade of experience. He served as Microsoft Regional Director in South Africa for two years and has received multiple Microsoft MVP (Most Valued Professional) awards. He currently works in R&D at Derivco International. Read more.

How to save time by using snapshots in virtualbox

Snapshots are a massive time saver when you are testing settings and configuration for your Geek School testing. Read on to see how you can take advantage of them while following along with our articles.

The basic idea of a snapshot is that you setup your virtual machine exactly how you want it, take a snapshot, and then you can make any changes you want. You could even install something awful, because it doesn’t matter – all you have to do is roll back the snapshot, and your virtual machine will be exactly how it was before.

It’s the perfect way to do a bunch of testing and figure things out, without breaking your setup. Plus, it’s a virtual machine, so you could always reload it anyway. If you haven’t already read our article about setting up a test lab, you should do that first.

Taking a Snapshot

Taking a snapshot in VirtualBox is actually very easy, and when done can save massive amounts of time. To get started open up your Virtual Machine and click on the Machine menu item, then select Take Snapshot…

How to save time by using snapshots in virtualbox

Since we will be snapshotting a clean install you will need to give your snapshot an intuitive name and description to remember this.

How to save time by using snapshots in virtualbox

The virtual machine will then dim out periodically while a point in time snapshot is taken.

How to save time by using snapshots in virtualbox

Reverting To a Snapshot

The purpose of reverting to a snapshot is so that you can go back in time to a particular state, in our case a clean state just after we installed the OS. Since we can only do this when the virtual machine is not on, go ahead and shut it down.

How to save time by using snapshots in virtualbox

Then select your virtual machine from the list and switch over to the snapshots view. Here you will see a list of the various snapshots you may have taken. To restore to a snapshot simply right click on it and choose Restore Snapshot From the Context Menu.

How to save time by using snapshots in virtualbox

For most situations you are going to want to uncheck the option to create a snapshot of the virtual machine current state. The reason being is that you will normally want to restore when you have broken something, there’s no point in taking a snapshot of a broken configuration.

How to save time by using snapshots in virtualbox

You will then see that the “Current State” will become the same as the snapshot you selected to restore to.

How to save time by using snapshots in virtualbox

Now when you power on the virtual machine you will see the virtual machine quickly reverting itself.

How to save time by using snapshots in virtualbox

Always remember that without snapshots, recording the Geek School would be nearly impossible, so remember to use them and save yourself countless hours. That’s all there is to it.

Account Information

Share with Your Friends

How to use snapshots in VirtualBox

How to use snapshots in VirtualBox

If VirtualBox powers your virtual machines, start taking advantage of the snapshot feature today.

Virtual machines (VMs) revolutionized the data center. With the ability to easily spin up a machine and even roll back to a working state, VMs bring a level of ease IT would never have enjoyed. Rolling back your VM is handled by way of snapshots. If you’ve never used the snapshot feature in your virtual technology, let me first explain why they are so crucial.

Snapshots allow you to save a particular state of a VM; this can be handy when you want to test something, or you’re about to make a change to that VM, and you need to be able to roll back to a working instance. Not only does this save you a lot of headaches, but it can be a serious time-saver.

More about data centers

  • Intel announces 12th generation Intel Core and 50 new processors at CES 2022
  • How to test if your Linux server is vulnerable to Log4j
  • IBM is all in on hybrid cloud, and its new cloud modernization center wants to help you be, too
  • Master your server with these 7 informative resources (TechRepublic Premium)

Every VM technology has its version of snapshotting…VirtualBox included. It’s easy to manage snapshots in VirtualBox–you can take snapshots of a running VM or a VM in a saved or even off state. Once you create a snapshot, you can restore a previous snapshot, delete a snapshot, and view details of a snapshot.

I’ll walk you through the steps of taking a snapshot and rolling back to a snapshot in VirtualBox. You’ll be surprised by how easy this process is to complete.

SEE: Virtualization Policy (Tech Pro Research)

Creating a snapshot

You can create a snapshot when a VM is either on, saved, or off. I’ll demonstrate the process of taking a snapshot when the VM is powered on; I’ll show how to do this with a Red Hat Enterprise Linux (RHEL) 7.3 VM.

Once the machine is up and running click Machine | Take Snapshot. A new window will appear, prompting you for a name and a description of the snapshot (Figure A). It’s important to fill out the name and description because you might take multiple snapshots, and you don’t want to get those snapshots confused; plus, this allows you to restore back to multiple points in the configuration.

Figure A

Once the snapshot is taken, you can go back to work on the VM.

You can also create a snapshot from a VM in a pause or off state. To do this, select the VM in the left pane, click the Snapshots button in the upper right corner, select Current State, and then click the Snapshots button (Figure B).

Figure B

Restoring a snapshot

Say you’re working in your VM, and you make a change that breaks the system…what do you do? You roll back to one of your previous snapshots. To do this, it’s as simple as creating a snapshot, with a couple of caveats.

First and foremost, the VM you want to work with must not be running. You can restore a snapshot if the VM is either in a saved state or powered off. To restore a state, do the following.

  1. Select the VM to work with from the left pane in the main window.
  2. Click the Snapshots button in the upper right corner.
  3. Right-click the snapshot you want to restore.
  4. Click Restore Snapshot (Figure C).
  5. In the resulting window, uncheck the box for Create A Snapshot Of The Current Machine State.
  6. Click Restore.
  7. Allow the restore to complete.

Figure C

The reason why you uncheck the box for Create A Snapshot Of The Current Machine State is because, most likely, you won’t want to take a snapshot of a broken state; instead, you’ll want that broken state to go away. If you do want to save that broken state (or whatever state the VM is in to make you want to restore a previous instance), you can leave that box checked. You will get the chance to name that current state and give it a description. That means it’s not actually overwriting your current saved state.

There is another way to restore snapshots. If you’ve taken snapshots of a VM, when you go to close it you will see an extra entry in the close dialog (Figure D). This entry allows you to restore to the current snapshot (i.e., the one that was taken most recently) as the VM closes. The next time you start the VM you will be at the current snapshot. This option only gives you the ability to restore to the current saved snapshot–you don’t get to choose.

Figure D

Deleting a snapshot and discarding a saved state

It is possible to delete a snapshot or to discard a saved state. To delete a snapshot, do the following.

  1. Open VirtualBox.
  2. Select the VM in the left pane.
  3. Click the Snapshots button in the upper right corner.
  4. Right-click the snapshot you wish to delete.
  5. Click Delete Snapshot.
  6. When prompted, click Delete.

You can also discard the current state by selecting the VM in the left pane and then clicking the Discard button (the downward pointing arrow). When prompted, click Discard, and the saved state will be discarded. Note: When you discard a saved state, it is like powering off the machine without doing a proper shutdown–this can cause problems with your VM, so use it very wisely.

A must-use feature

If you’re not using snapshots on VirtualBox, you’re doing it wrong. Snapshots is a must-use feature that will serve you very well and save you from possible frustrations. Start working with snapshots immediately…you won’t regret it.

In this article, we will examine the steps to take a Snapshot of virtual machines used in Oracle VM VirtualBox virtualization software.

How to save time by using snapshots in virtualbox

How to Use Snapshot in Oracle VBox

The use of Snapshot in virtual machine can be compared to the Restore service used in Windows operating systems.

It is recommended you get Backup before installing an important program on a virtual computer on VirtualBox or performing a critical Windows update. In the event of a serious system failure, you can easily restore your system to its previous state with the backup you received.

Using Snapshot in virtualization programs such as VBox and VMware Workstation is the main reason to reduce the error rate of the operating system and to take precautions against errors that may occur.

NOT: The use of Snapshot on the latest version 6.0.10 of Oracle VM VBox is the same!

How to Snapshot in Oracle Software

Taking a backup on a virtual machine on VirtualBox software is an easy process. We will take a backup of virtual machine and restore it from backup again.

Follow the steps below to take Snapshot in Oracle in order.

Step 1

Open the Oracle VM VBox program and run the VM you want to backup.

How to save time by using snapshots in virtualbox

Step 2

Once the VM is running, click on Machine / Take Snapshot from the menu.

How to save time by using snapshots in virtualbox

Step 3

Type a name and description for the backup and click OK.

How to save time by using snapshots in virtualbox

Step 4

Wait while you are getting a backup of your virtual machine. This process will complete in about 1 minute.

How to save time by using snapshots in virtualbox

Step 5

Once you have received the backup, click on the Snapshots section as shown below.

How to save time by using snapshots in virtualbox

Step 6

You can see the current status of the VM in the window below. You can also perform Restore in this window.

How to save time by using snapshots in virtualbox

How to Restore VM to a Previous Snapshot

For example, after Snapshot is received, the operating system installed on the VM has collapsed. To recover your operating system, you can restore your backup on the VM and use it again in a short period of time.

That’s why using Snapshot in Oracle VBox is a great feature.

Step 1

Click on the Restore button on the Windows 7 VM in the right pane.

How to save time by using snapshots in virtualbox

Step 2

The following window informs you that it will return from the backup named Snapshot-Fresh. If the option “Create a snapshot of the current VM” is checked, unchecked it and click on the Restore button.

How to save time by using snapshots in virtualbox

Step 3

Wait while the Windows 7 VM restore.

How to save time by using snapshots in virtualbox

Step 4

Windows 7 VM restored from backup. To use the Snapshot in VBox, create a new folder on the desktop of the virtual machine and close the VM.

How to save time by using snapshots in virtualbox

Step 5

Restore the Windows 7 virtual pc again.

How to save time by using snapshots in virtualbox

Step 6

Likewise, click on the Restore button to continue.

How to save time by using snapshots in virtualbox

Step 7

Wait for the Windows machine to be restored.

How to save time by using snapshots in virtualbox

Step 8

As you can see in the image below, the Windows 7 VM was restored to its previous state because the created folder is no longer available.

How to save time by using snapshots in virtualbox

Step 9

In the window below you can see the information from the backup taken.

How to save time by using snapshots in virtualbox

How to Take Backup in Oracle VM Software on Windows 10 ⇒ Video

You can watch the following video to take and restore Snapshot in VBox. Also, you can subscribe to our YouTube channel to support us!

Final Word

In this article, we have reviewed Snapshot, one of the most frequently used features when using the VBox virtualization program. Thanks for following us!

Let’s say you have set up a fully functional Centos 7 machine for your development work. You have installed development tools, Linux packages, build-essentials as part of your work. Down the line, you messed up something in your operating system by changing some important configuration and your OS is not booting up properly.

At this moment if you don’t have any backup to your machine then all your work is lost and you have to build the machine from scratch. This is where snapshots come in handy. Every virtualization software has the features of snapshots.

Snapshot is a point-in-time copy that allows us to save the state of the machine and can restore the machine state whenever needed using these snapshots. Virtualbox manager provides an easy-to-use interface to handle snapshots.

Creating Snapshots in Virtualbox

You can take a snapshot when the machine is in running or powered off state. There will be a difference with snapshots when you take in two different states. When you take a snapshot when the machine is running, the snapshot will be taken to whatever state your machine is in at that point. All the applications running, tools you have opened in your machine all will be captured.

To work with snapshots, select your virtual machine and click the icon as shown in the below image.

How to save time by using snapshots in virtualboxOpen Virtualbox Snapshots

Once you open the snapshot menu you will have the below options to take control of your snapshot. In the below image, you can see there is a “Current State” that is your current running Guest machine state.

How to save time by using snapshots in virtualboxVM Current State

To take a new snapshot press the “TAKE” icon or press “CTRL+SHIFT+T”. You will be prompted to enter a snapshot name and description for your snapshot.

How to save time by using snapshots in virtualboxCreate VirtualBox VM Snapshot

Once you click the ok button you will see the snapshots as shown in the below image. I have also taken couple more snapshots after installing few packages.

List of Virtualbox VM Snapshots

The snapshots are stored under your VM installation directory. You can find a directory called Snapshots where all your snapshots .vdi files are created.

View Virtualbox VM Snapshots

Restoring Snapshots in Virtualbox

Now you can switch back to your previous virtual machine state by restoring the snapshots. Go to Snapshot manager, select the snapshot you want to switch to, and press Restore.

How to save time by using snapshots in virtualboxRestore Virtualbox VM Snapshots

Now the snapshot will be restored and when you start the machine it will start from the current snapshot you restored. See from the below image the current state it now derived from the restored snapshot.

Check VM Current State

Removing Snapshots in Virtualbox

To remove the snapshot, go to the snapshot manager and select the snapshot, and press Delete Icon. It will remove the snapshot.

How to save time by using snapshots in virtualboxDelete VirtualBox VM Snapshot

In the next article, we will take a look at how to clone your virtual machines in VirtualBox.

Taylor Gibb is a professional software developer with nearly a decade of experience. He served as Microsoft Regional Director in South Africa for two years and has received multiple Microsoft MVP (Most Valued Professional) awards. He currently works in R&D at Derivco International. Read more.

How to save time by using snapshots in virtualbox

Snapshots are a massive time saver when you are testing settings and configuration for your Geek School testing. Read on to see how you can take advantage of them while following along with our articles.

The basic idea of a snapshot is that you setup your virtual machine exactly how you want it, take a snapshot, and then you can make any changes you want. You could even install something awful, because it doesn’t matter – all you have to do is roll back the snapshot, and your virtual machine will be exactly how it was before.

It’s the perfect way to do a bunch of testing and figure things out, without breaking your setup. Plus, it’s a virtual machine, so you could always reload it anyway. If you haven’t already read our article about setting up a test lab, you should do that first.

Taking a Snapshot

Taking a snapshot in VirtualBox is actually very easy, and when done can save massive amounts of time. To get started open up your Virtual Machine and click on the Machine menu item, then select Take Snapshot…

How to save time by using snapshots in virtualbox

Since we will be snapshotting a clean install you will need to give your snapshot an intuitive name and description to remember this.

How to save time by using snapshots in virtualbox

The virtual machine will then dim out periodically while a point in time snapshot is taken.

How to save time by using snapshots in virtualbox

Reverting To a Snapshot

The purpose of reverting to a snapshot is so that you can go back in time to a particular state, in our case a clean state just after we installed the OS. Since we can only do this when the virtual machine is not on, go ahead and shut it down.

How to save time by using snapshots in virtualbox

Then select your virtual machine from the list and switch over to the snapshots view. Here you will see a list of the various snapshots you may have taken. To restore to a snapshot simply right click on it and choose Restore Snapshot From the Context Menu.

How to save time by using snapshots in virtualbox

For most situations you are going to want to uncheck the option to create a snapshot of the virtual machine current state. The reason being is that you will normally want to restore when you have broken something, there’s no point in taking a snapshot of a broken configuration.

How to save time by using snapshots in virtualbox

You will then see that the “Current State” will become the same as the snapshot you selected to restore to.

How to save time by using snapshots in virtualbox

Now when you power on the virtual machine you will see the virtual machine quickly reverting itself.

How to save time by using snapshots in virtualbox

Always remember that without snapshots, recording the Geek School would be nearly impossible, so remember to use them and save yourself countless hours. That’s all there is to it.

Chris Hoffman is Editor-in-Chief of How-To Geek. He’s written about technology for over a decade and was a PCWorld columnist for two years. Chris has written for The New York Times and Reader’s Digest, been interviewed as a technology expert on TV stations like Miami’s NBC 6, and had his work covered by news outlets like the BBC. Since 2011, Chris has written over 2,000 articles that have been read nearly one billion times—and that’s just here at How-To Geek. Read more.

How to save time by using snapshots in virtualbox

VirtualBox is packed with features that you may have never used, even if you frequently use it to run virtual machines. VMware keeps many of its best features to its paid versions, but all of VirtualBox’s features are completely free.

Many of the features here require Guest Additions installed in your virtual machine. This is good to do anyway, as installing the Guest Additions package will speed up your virtual machines.

Snapshots

VirtualBox can create snapshots that save a virtual machine’s state. You can revert to the saved state at any time by restoring a snapshot. Snapshots are similar to leaving a virtual machine in a saved state, but you can have multiple saved states and restore from them at any time.

To create a snapshot, click the Machine menu while the virtual machine is running and select Take snapshot or use the Snapshots panel. You can restore snapshots from this interface later.

Snapshots are particularly useful if you want to do something to a virtual machine and then erase your changes. For example, if you use a virtual machine to test software, you can create a snapshot of a clean Windows system, then install the software and play with it. When you’re done, you can restore the original snapshot and all traces of the software will be erased. You don’t have to reinstall your guest operating system or manually back up and restore a virtual machine’s files.

How to save time by using snapshots in virtualbox

Seamless Mode

Seamless mode allows you to break windows out of your guest operating system window and place them on your host operating system’s desktop. For example, if you use VirtualBox to run an important Windows program on your Linux desktop, you can use Seamless mode to have that Windows program be present on your Linux desktop.

To use this feature, install VirtualBox’s Guest Additions package inside the virtual machine, select the View menu, and click Switch to Seamless Mode.

How to save time by using snapshots in virtualbox

3D Support

VirtualBox has basic support for 3D graphics. You’ll have to go out of your way to enable this — the appropriate drivers aren’t installed by default when you install Guest Additions and you must manually enable these settings from the virtual machine’s settings window.

The 3D support won’t allow you to play the latest 3D games, but it does allow you to enable Windows Aero desktop effects in the virtual machine and play older 3D games that aren’t too demanding.

How to save time by using snapshots in virtualbox

USB Devices

You can connect USB devices to your computer and expose them to the virtual machine as if they were connected directly. This feature can be used with USB drives and a variety of other devices. As long as USB support is enabled in the virtual machine’s settings window, you can click the Devices tab, point to USB Devices, and select the USB devices you want to connect.

How to save time by using snapshots in virtualbox

Shared Folders

VirtualBox allows you to set up “shared folders” that both the host operating system and guest operating system can access. To do this, VirtualBox essentially takes a folder on the host operating system and uses network file sharing to make it accessible inside the virtual machine. Configure shared folders from the virtual machine’s settings window and then access or mount them as you’d mount normal network shares.

How to save time by using snapshots in virtualbox

Shared Clipboard and Drag and Drop

Copy and paste and drag and drop don’t work between the guest and host operating systems by default. However, VirtualBox allows you to share your clipboard between your guest operating system and host operating system, making copy-and-paste work properly. You can also use drag and drop to easily move files back and forth. Both of these features reduce the friction of using software inside a virtual machine, but they’re disabled by default.

How to save time by using snapshots in virtualbox

Cloning Virtual Machines

VirtualBox allows you to clone a virtual machine, creating a copy of it. If you try to copy-paste the files manually, you’ll end up with problems because both virtual machines will use the same identifier number for their virtual disks. When you clone a virtual machine, VirtualBox will ensure they don’t conflict with each other.

How to save time by using snapshots in virtualbox

Port Forwarding

Virtual machines are normally isolated from the network. If you’d like to run server software inside a virtual machine, you’ll probably want to set up port forwarding so the server software is reachable from outside of the virtual machine. You’ll find this option in the Network settings pane, under Advanced.

You could also opt to connect the virtual machine directly to the network instead of using NAT, but NAT with port forwarding may be a better way to only allow specific ports through without changing your network settings too much.

How to save time by using snapshots in virtualbox

Importing and Exporting VM Appliances

Appliances are virtual machines with preinstalled operating systems. You can create your own appliances or download appliances in OVF format and import them into VirtualBox. This is particularly useful for Linux virtual machines and other systems that can be distributed freely, although you could also create your own appliances and distribute them throughout your organization.

How to save time by using snapshots in virtualbox

Remote Display

VirtualBox allows you to enable remote display for a virtual machine, allowing you to run a virtual machine on a headless server or other remote system and access it from another computer. VirtualBox does this with “VRDP,” which is backwards compatible with Microsoft’s RDP protocol. This means you can use the Remote Desktop Connection program in Windows or any other RDP viewer to access your virtual machine remotely without the need for any VirtualBox-specific software.

How to save time by using snapshots in virtualbox

You can also enlarge a virtual machine’s disks in VirtualBox. VirtualBox doesn’t expose this option in its interface, requiring you to use the VBoxManage command instead.

Updated: January 22, 2021

One of the cool things about VirtualBox is that it lets you create snapshots of your virtual machines. You work, you save a state, you make changes, and then you conveniently revert back to the saved state. You can branch any way you like, create snapshots with the virtual machines running or stopped, and the functionality provides you with a lot of flexibility – and determinism – as you can consistently re-test known system states over and over.

The uncool thing about snapshots is that they take quite a bit of space. I noticed that one of my virtual machines, with an expected footprint of only about 11 GB was actually taking 46 GB of disk space. And as you can imagine, there were snapshots – a total of seven different saved machine states. This ain’t bad, but what if you no longer need the snapshots and want to compact them, i.e. flatten them, i.e. merge everything down and trim down on disk usage? Let’s explore this further.

How to save time by using snapshots in virtualbox

How do you merge snapshots in VirtualBox?

This is actually a non-trivial question. There isn’t a magic button that can just layer all the different snapshots quickly. What you can do is, manually delete snapshots under the current one – one by one. This will make VirtualBox merge the changes, a process that can take quite some time.

How to save time by using snapshots in virtualbox

How to save time by using snapshots in virtualbox

Luckily, there’s a faster alternative – cloning. We talked about cloning several times in the past – mostly for the purpose of virtual machine resizing. If you have created a virtual machine with a disk that has become too small for purpose, you can resize the disks – but this ONLY works if there are no snapshots. In that tutorial, I showed you how to clone a machine (and collapse snapshots), and then resize the disk. Essentially, that’s all we need for the job. But for the sake of clarity, let me demonstrate step by step.

Virtual machine cloning

If you select any which virtual machine in your list inside the VirtualBox Manager, you will see the Clone button in the menu above the right pane. Click the button and follow the wizard. There are quite a few details, but the important ones are as follows. First, select the Clone type. You want a Full Clone. Second, select which snapshots you want to preserve. We need: Current machine state. Now, if you go for the second option (Everything), this will not give us any disk space saving benefits.

How to save time by using snapshots in virtualbox

You can also clone network addresses, disk names and hardware UUID – this can be extremely useful, because then you won’t really need to worry about any potential conflicts whereby a seemingly identical operating system sees “different” hardware. You will be making an identical clone.

Press the Clone button and let the magic happen. The process will take some time – it depends on the size of your virtual machine, the disk usage, and your system resources. But overall, the process will take about as much as it takes to collapse a single snapshot, so if your virtual machine has multiple snapshots, you automatically gain time.

Once the process is complete, you can use your cloned machine right away. I tried multiple variations, including a suspended virtual machine, and it worked perfectly fine. The clone resumed right where the original system was, including open windows and applications. All of it. The only difference was that the snapshots were gone, and once I deleted the original machine, I had gained back a significant chunk of disk space.

Conclusion

There you go. Same same but different. While this article does not differ significantly from the tutorial I provided you on disk resizing, it does focus on the cloning part only. You have two ways you can go about managing your snapshots – and disk space – with VirtualBox machines, but the full cloning process is faster than manually deleting individual snapshots. However, the latter method does allows you to retain some of the snapshots, or alternatively, only collapse specific ones. For instance, you could collapse the oldest snapshots, but keep the last three.

Well, hopefully, you will find this guide useful. VirtualBox has tons of nice features, and it’s really a handy tool for the entrepreneuring nerd. Snapshots are highly practical, but they do tend to lead to increased disk space usage. Considerably so. If you’re ever short of GB on your platter or wafer, you can selectively clone virtual machines or delete specific snapshots to get some of that fine digital equity back. We’re done.

VM Snapshot a method to create a copy of Virtual Machine (VM) at specific point of time and in other words in we can say VM snapshot is used to preserve a particular state of a VM.

In this article we discuss how to create and restore VM snapshot in VirtualBox on Ubuntu Linux, I am assuming VirtualBox is already installed on Ubuntu Linux and couple of VM s are running on it.

Create VirtualBox VM Snapshot

Step:1 Start the VirtualBox

How to save time by using snapshots in virtualbox

Step:2 Select the virtual machine for snapshot and then click on ‘Snapshots‘ option, in my case i am going to create a snapshot of CentOS 7 VM.

How to save time by using snapshots in virtualbox

Specify the Snapshot Name and Description and then Click on ‘OK

How to save time by using snapshots in virtualbox

Note : When we try to take snapshot of running VM then Virtualbox manager will put that VM in Paused state , so once the snapshot task is completed then we can move the VM’s state from Paused to Running.

How to save time by using snapshots in virtualbox

Restore VirtualBox VM from Snapshot

Step:1 Power off the Virtual Machine.

Step:2 Select the VM and Go to ‘Snapshots‘ option and then click on “Restore Snapshot option

How to save time by using snapshots in virtualbox

When we click on “Restore Snapshot” option , it will give us an option to create snapshot of current sate of the VM and if you don’t want the current state snapshot then untick the option ( Current state will be deleted permanently ).

How to save time by using snapshots in virtualbox

Click on “Restore” option to Restore the snapshot.

How to save time by using snapshots in virtualbox

Now Click on Start option to start the VM

How to save time by using snapshots in virtualbox

VirtualBox is one of the most widely used software for running virtual machines on lots of systems. Developed by Oracle, VirtualBox is truly a piece of work that can help anyone in lots of situations. For running virtual machines, Linux is often used as it’s a lightweight system with extremely powerful features.

If you’re a VirtualBox user, you obviously have to know how to backup a virtual system from the VirtualBox. It’s really useful in lots of situations, for example, exporting the virtual system to others or for development purpose etc.

How to make the backup

Snapshots

There are several ways you can make a backup of a virtual system on VirtualBox. For Linux, it’s the easiest method to use the “snapshot” feature. The benefit is, it allows saving the instant state of the VM and restore the same state at any time.

How to take a snapshot

  • Open VirtualBox.
  • Start the virtual system you wish to take backup.
  • Once opened, go to Machines >> Take snapshot.

How to save time by using snapshots in virtualbox

  • Enter a name for the snapshot. You can also add snapshot description and other information.

How to save time by using snapshots in virtualbox

Restoring snapshots

  • Open VirtualBox main window.
  • Click the arrow next to the “Machine Tools” button.

How to save time by using snapshots in virtualbox

  • Select the snapshot you want to restore from the “snapshot manager”.
  • Click “Restore”.

How to save time by using snapshots in virtualbox

It’s done! You can easily create and restore snapshots as you like.

Exporting VMs

VirtualBox also allows you export and import VMs just like a file. However, this will make a backup copy of the VM’s files and operating system; no snapshots. The virtual machine, then, can be deployed into any other virtual system.

  • Open VirtualBox.
  • Go to File >> Export Appliance.

How to save time by using snapshots in virtualbox

  • Select the virtual machine you want to back up.
  • Choose the backup file path and format.

How to save time by using snapshots in virtualbox

How to save time by using snapshots in virtualbox

The exported file can be deployed in any system.

In these times, many users are launching to test different operating systems on their computers. This is something that can be done traditionally, or by using virtual machines in programs like VirtualBox, for example.

And it is because either out of curiosity, professional subjects, or simply to acquire knowledge, there are many who use these solutions in particular. As many of you may already know, these programs will be very useful to us in these tasks that we refer to.

How to save time by using snapshots in virtualbox

What is a virtual machine

In this way we have the possibility to install and test several operating systems on the main one, that is, virtually. As you can imagine, this allows us to install and use Linux distributions on different virtual machines , using these programs. That is something that, for example, we can do from our Windows computer, all without affecting its operation.

How to save time by using snapshots in virtualbox

Of course, we must bear in mind that all this will require us to reserve a certain amount of space on the hard drive, space that the main system will not be able to use. At the same time, we must know that we are virtualizing a complete operating system , with all its functions, which has a significant consumption of PC resources. But once we know all this, to say that the utility that programs like the aforementioned VirtualBox that you can download from this link offers us, is a lot.

So we can use and test, without any problem or danger, all kinds of operating systems and programs in them, without affecting the main system . But of course, due to the freedom that all this presents us, in the same way certain problems of operation can occur. For example, let’s say these virtual machines are widely used to test potentially dangerous programs. Thus, by installing and executing them in a virtual operating system, we prevent all of this from actually damaging the main system of the computer.

How to create a snapshot in VirtualBox

But of course, at the same time, what can be damaged, for this or other reasons, is the virtual machine that we have created. Thus, just as it happens in the Windows that we normally use on the PC, the virtual one can stop working or start .

This can be due to multiple reasons, so we would have to start again from scratch with that virtual machine. This is a waste of time and work, but we are going to show you an alternative solution. For this we can use the functionality called snapshot or snapshot in VirtualBox. This is something that we are going to achieve from the Machine / Take Snapshot menu option.

With this what we really achieve is to save the current state of our virtual machine. Thus, in the event of a disaster that does not allow us to access it in the future, we can return to that point. It is logical to think that with this simple step, we avoid having to create and install the damaged virtual system from scratch. Therefore we could say that it is something similar to keeping a backup copy of it. Of course, this will not require additional disk space .

At the same time we will have the possibility of saving multiple states or snapshots of the same virtual machine. Therefore, for this, the first thing we do is access the menu option that we mentioned. Then a window will appear in which we customize that snapshot that we are going to create.

It is worth mentioning that in order to create that snapshot or snapshot, we just have to assign a representative name to it. At the same time, something that will be very useful to us, we can type a description of it. This will be very useful to us if we plan to create several snapshots of that same virtual machine, since it will help us to recover it more quickly.

So, as it is easy to imagine, this is a useful function that is of great help and that will save us a good amount of time and work, in the event that a major problem occurs in the virtual machine.

Account Information

Share with Your Friends

How to automate VirtualBox snapshots with the VBoxManage command

How to automate VirtualBox snapshots with the VBoxManage command

If you’re looking for a way to automate VirtualBox virtual machine snapshots, learn how to use a bash script and cron to make this happen.

Your data center might be powered by a mixture of technologies. Chances are, virtual machines (VMs) will be in that mix.

If you happen to be taking advantage of VirtualBox, you know there are plenty of tools to make that experience more flexible and powerful. Some of those tools require a bit of command line and/or scripting prowess on your part. One such instance is the automation of snapshots.

More about data centers

  • Intel announces 12th generation Intel Core and 50 new processors at CES 2022
  • How to test if your Linux server is vulnerable to Log4j
  • IBM is all in on hybrid cloud, and its new cloud modernization center wants to help you be, too
  • Master your server with these 7 informative resources (TechRepublic Premium)

Snapshots are an incredibly important aspect of your VirtualBox landscape. With snapshots, you can roll back issues such as a security issue, data loss, or a broken update.

If you’re running VMs, you don’t want to have to remember to go back and take a snapshot on a regular basis. With the help of the VBoxManage command, you can use scripting magic to make taking snapshots a no-brainer.

Before I walk through this process, know that:

  • I’m using Elementary OS Loki as my host;
  • I’m going to automate the snapshotting of a single VM called UBUNTUSERVER_WEB; and
  • This should not be considered a backup solution.

Let’s get to work.

SEE: Virtualization Policy (Tech Pro Research)

The script

The first thing we must do is cobble together a script that will be used by cron to work the backup magic. This will be a very simple script to back up a single VM, though you can modify this script to suit your needs. You can also create a backup script for each of your VMs that require snapshotting.

The contents of my script (to back up a VM called UBUNTUSERVER_WEB) look like this:

#!/bin/bash
​NOW=`date +”%m-%d-%Y%T”`
​SNAPSHOT_NAME=”UBUNTUSERVER_WEB_$NOW”
​SNAPSHOT_DESCRIPTION=”Snapshot taken on $NOW”

VBoxManage snapshot UBUNTUSERVER_WEB take “$SNAPSHOT_NAME” –description “$SNAPSHOT_DESCRIPTION”

The above script:

  • creates a timestamp;
  • names the snapshot with the VM name with an appended timestamp;
  • gives the snapshot a description; and
  • runs the VBoxManage snapshot command using the above defined variables.

Once you have the contents of the script massaged to perfectly fit your needs, save and close the file (we’ll name it vboxscript, for our example) and then give it executable permission with the command chmod u+x vboxscript. You’re ready to move on to the schedule part of the program.

Cron that script

We’re going to set this up to run daily, but you can set it up to run as often as you like. This builds up a LOT of snapshots, so you might want to alter that to take weekly snapshots, or go ahead with the daily option and know that you’ll need to go into the VirtualBox GUI and merge the snapshots by creating a clone (we’ll cover this at a later date).

From a terminal window, let’s move your script (vboxscript) to a location the VirtualBox user will have permission to access. If this is a standard user, you might place that script in a new directory, such as

/.scripts. We’ll assume you run VirtualBox as a standard user and create that folder with the command mkdir

/.scripts. Now move vboxscript into that folder with the command mv vboxscript

/.scripts. We’ll create the cron job to run the script every day at 1:00 AM. Issue the command (as the user that runs VirtualBox) crontab -e and add the following to the crontab file:

Once you save that file, the scheduling will be set, and a new snapshot will be created at 1:00 AM. That’s it–the automation of VirtualBox snapshots is now working for that particular VM.

You can easily create scripts for each VM you run. Just remember that it will be important to regularly clone the VM; otherwise, you’ll wind up with an inordinate number of snapshots.

Last Updated: Dec 14, 2021

How to save time by using snapshots in virtualbox

Vagrant makes it easy to go from zero to working in a very short time. We can feel free to completely wreck our setup because we can reset it back to a working state. The flip side to this is that while it’s easy to reset our VMs it might be a challenge or time-consuming to recreate our data inside the VMs.

What if there was an easy way to take a snapshot of our current VMs drive state so we could quickly get back to it?

In this article we’ll talk about how to use Vagrant’s snapshot feature to do just this.

What is a Snapshot?

Normally, when a VM writes data to its virtual drive the hypervisor saves the data to a virtual drive file for that VM.

How to save time by using snapshots in virtualbox

Several hypervisors allow us to define a “snapshot” that freezes the data on the drive at a specific time.

How to save time by using snapshots in virtualbox

After the snapshot has been created instead of writing to the main virtual drive file the hypervisor writes data to a separate file.

How to save time by using snapshots in virtualbox

We can create multiple snapshots which can either stack on top of each other or exist in parallel with each other.

How to save time by using snapshots in virtualbox

How to save time by using snapshots in virtualbox

The superpower of snapshots is that because we’re just recording the differences between when we took the snapshot and now it doesn’t take up the same amount of space as a duplicate copy of the VMs drive. We can also quickly discard our changes and get back to when we created our snapshot.

There is a performance penalty to having multiple snapshots. Because each virtual disk has a listing of changes when our VM performs a read operation each virtual disk file has to be consulted to be able to find which one contains the correct data. It’s easy to create a performance bootle neck so we recommend trying to keep the number of snapshots down to at most 2 and never in a production environment for more than an hour or so.

Vagrant allows us to take advantage of this feature (if it’s supported by our hypervisor) using the snapshot command.

We could do these same actions in the GUI of our hypervisor but Vagrant makes it a little nicer to work with.

Creating a Snapshot

The first thing we need to discuss is how to create a snapshot. This is done by using the vagrant snapshot save command followed by the name we want for our snapshot. For example, we can create a snapshot after vagrant up ing our environment so we can quickly get back to that state of having everything fresh but not wait for all the steps required to initialize the VMs.

To see all the snapshots we’ve created we can run the vagrant snapshot list command.

As we “save” new snapshots they’re based on the snapshot we’re currently working off. If we generated a bunch of testing data we can create a new snapshot.

This snapshot has a parent of “initial-setup” which we can see in the VirtualBox GUI. At this point, VirtualBox is keeping track of the difference between our base box, the changes to “initial-setup”, and any changes we’ve made after we created our “after-creating-development-data” snapshot.

How to save time by using snapshots in virtualbox

Restoring to a Snapshot

When we want to get back to a snapshot we can use the vagrant snapshot restore command followed by the name of the snapshot. When this happens any data that hasn’t been saved to a snapshot will be lost.

This process actually shuts down the VM before restoring the snapshot so take that into account whenever a snapshot is restored.

Deleting a Snapshot

Snapshots are costly in terms of performance and drive space so we must clean up the old snapshots using the delete command.

We might need to create a new set of test data. To do that we’ll restore our VM to our “initial-setup” snapshot, make our changes, and create a new snapshot.

But then we still have our “after-creating-development-data” sitting around using up space. To remove it we can use the vagrant snapshot delete command with the name of the snapshot.

Push/Pop

That covers the majority of the snapshot feature but we still haven’t discussed the push and pop commands. These allow us to create a temporary snapshot so we can try something by quickly creating a snapshot and then restoring to the snapshot and deleting it in one command.

This is helpful when we want to test an upgrade inside our development environment (maybe upgrading to a new version of PHP) without worrying about messing up our setup if it goes awry.

To use this command we just call vagrant snapshot push and it will generate a new snapshot that starts with the word “push”.

The new snapshot even shows up in the list of snapshots from vagrant snapshot list .

When we’re done with whatever we’re doing we can then pop the snapshot which again restores the snapshot and then immediately deletes the snapshot so we’re back to where we started.

If we check our list of snapshots again we’ll see that it’s gone now.

What You Need To Know

  • Snapshots provide a method to lock our VMs data at a specific point
  • Makes it easier to test change to data
  • Vagrant provides this using the vagrant snapshot command
  • vagrant snapshot save to save
  • vagrant snapshot restore to go back
  • vagrant snapshot delete to remove an outdated snapshot

Scott Keck-Warren

Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He’s the father of two and can be found most weekends working on projects around the house with his loving partner.

Like this post? Don’t forget to follow us on Twitter and Facebook for updates.

Deleting a snapshot and discarding a saved state
Open VirtualBox. Select the VM in the left pane. Click the Snapshots button in the upper right corner. Right-click the snapshot you wish to delete.
Click to see full answer

How much space does a VirtualBox snapshot take? The current snapshot . vdi file is timestamped 2011-02-28 01:05. It is

How do I disable mouse capture in VirtualBox?

You can go into:

  1. Settings.
  2. Mouse and Touchpad.
  3. and in Devices Tab, disable the “VirtualBox Mouse Integration” device. This permanently disables mouse integration in Xfce.

What is Auto capture keyboard in VirtualBox?

On the Input screen you can also choose to automatically capture the keyboard when you open a virtual machine. … This means all keystrokes are directed to the virtual machine until you press the Host key to return control of the mouse and keyboard to the host machine.

Where is host key in zoom?

You can locate your 6-digit host key within your Zoom Profile page. You can edit and enter your preferred 6-digit Host Key at any time. 6-digits are required. The Host Key is provided for starting meetings and claiming host controls using the Zoom client, for phone conferencing, or using an H.

How do I find my Windows host key?

By default, the Host key is the Right Ctrl key on the keyboard. There may be some keyboards, like laptop keyboards, that do not have a Right Ctrl key.

How do I fix the mouse cursor in integration in VirtualBox?

  1. Shut-Down the VM.
  2. Select a particular VM and go to settings.
  3. Go to System section.
  4. In the Motherboard tab, change the Pointing Device as below; From: PS/2 mouse To: USB Tablet OR USB Multi-touch Tablet.
  5. Save settings and Start the VM.

How do I get my mouse out of VirtualBox Windows 10?

Press the “Ctrl” and “Alt” keys simultaneously. This releases both keyboard and mouse input from the virtual machine, giving you control of the mouse pointer.

What happens if I delete snapshot?

Deleting a snapshot does not change the virtual machine or other snapshots. Deleting a snapshot consolidates the changes between snapshots and previous disk states and writes all the data from the delta disk that contains the information about the deleted snapshot to the parent disk.

What are snapshots in VirtualBox?

VirtualBox snapshots are a powerful and easy to use feature that allows you to save a VM in it’s current state for use at a later time. At any point in the future you can restore the VM to this state no matter how much the VM has changed since the snapshot was taken.

Can I delete VirtualBox snapshots?

Deleting a snapshot and discarding a saved state
Open VirtualBox. Select the VM in the left pane. Click the Snapshots button in the upper right corner. Right-click the snapshot you wish to delete.

Where are VirtualBox snapshots stored?

VirtualBox snapshots reside in the Machine Folder. You should be able to change the default machine folder using the menu option File->Preferences, under the General tab.

How do I get my mouse out of a VM?

Press the “Ctrl” and “Alt” keys simultaneously. This releases both keyboard and mouse input from the virtual machine, giving you control of the mouse pointer. In most cases, VMware Player allows you to move the mouse pointer out of a virtual machine window automatically.

We have a virtual server named Jira running under VirtualBox 4.0 (host is Debian Squeeze). At some point in time a VM failed to boot, so we had to boot from GRML rescue iso. Before doing that we have created a snapshot of VM. After fixing boot problems VM continued to use that snapshot as it’s current state. This is the output of VBoxManage showvminfo jira:

As you can see, snapshot is named beforeGRML. Actually I suspect that this snapshot is current state, and disk image is a state before we have recovered the machine with GRML iso.

  • is it correct that beforeGRML snapshot is actually a current state?
  • whatever a ‘current state’ is, I want to merge it with VM disk and have no snapshots – how to do that?

Please note that VM is hosted at a remote Debian server and I use VBoxManage command line interface. (I’ve tried reading documentation but still can’t figure out what all those ‘snapshot delete’ and ‘snapshot restore’ would do.)

2 Answers 2

No beforeGRML is not the current state. It is the machine state of the point in time when you made the snapshot.

VirtualBox is really unintuitive with snapshot command naming, if you want to merge the current state you have to delete the snapshot.

The delete operation deletes a snapshot (specified by name or by UUID). This can take a while to finish since the differencing images associated with the snapshot might need to be merged with their child differencing images.

To revert to the state of the snapshot you use the restore operation:

The restore operation will restore the given snapshot (specified by name or by UUID) by resetting the virtual machine’s settings and current state to that of the snapshot. The previous current state of the machine will be lost. After this, the given snapshot becomes the new “current” snapshot so that subsequent snapshots are inserted under the snapshot from which was restored.

Another way to get a virtual disk in the state of a specific snapshot is to clone that virtual disk with VBoxManage.

To be sure what virtual disk you clone, open for read the .vbox file or use the GUI to get the disk path (i prefer to use full paths rather than hard disk IDs).

Cloning a . TheNameOfVirtualDisk. gives you all previous states merged onto the new one, while letting untouched all the snapshots.

Then you can test in a new machine this new disk and see if it is what you want it to be and if it works.

So, that way if something goes wrong, you lose nothing except only some time.

Not to mention, if you want to get rid of only a snapshot in the middle of the tree of snapshots. it is a PAIN, the terminology VBox uses make a lot people to get confused.

But, thinking this way you will FIX the terminology: Deleting a Snapshot does not lose anything else except that point in time (internally it merges that State into all of the childs).

Let me explain with a more complex example. You have a Top level, with two childs, one of that child has also two childs while the other has three childs. Top level is A (one node), second level is B (two nodes), third level is C (five nodes), so tree is as follows:

  • A1
  • A1 – B1
  • A1 – B1 – C1
  • A1 – B1 – C2
  • A1 – B2
  • A1 – B2 – C3
  • A1 – B2 – C4
  • A1 – B2 – C5

Imagine now you want to get rid of B1, then when you delete B1 the differencing disk need to be merged onto C1 and C2, so C1 & C2 will be childs of A1; it is not as simple as deleting a single file; this VirtualBOX call it DELETE the B1 snapshot.

Now comes the other way of wish: Want to lose the states after a point, let me saw for that tree, i want to get rid of B2 and all its childs, so there is no more B2 part on the tree (implies eliminating all levels of its childs), so it will be very fast to do, it is only to delete some files (C3, C4, C5 & B2); this is not possible to be done in VirtualBOX, what VirtualBOX call RESTORE is to get rid of C1, C2 & C3, but not B2. you need to manually edit the .VBOX file and do that work manually. If you restore A1 to get rid of B2, you will also loose B1, C1 & C2 in the process.

So be sure what you do!

Yes, VirtualBOX allows you to get rid of B2 and all its childs, but not in one step, you need two steps:

  1. Restore B2, so all childs get removed and their files deleted
  2. Delete B2, so B2 it self get removed and its files deleted

Hope now it can be a little bit clear. a lot of people on internet talk about losing all their work because they RESTORE A1, trying to REMOVE B2.

If terms had been REMOVE and DESTROY it would not caused so much confusion.

REMOVE a node is to get rid of that node without touching the rest (if it has childs merge the state on all of them, if not just delete the state). DESTROY a node is to get rid of a node and all its childs (just delete the state and all child states).

I do not understand why VBox talks about RESTORE when talking about Snapshots, that introduces a lot of misunderstanding.

Is there any way to restore a snapshot from inside a VBox guest machine?

I have a Windows machine that hosts numerous machines. Currently we are working with something using a Ubuntu guest and it is really painful to have to keep switching machines just to revert a snapshot.

What I had in mind is setting the machine to a “base” state and every time I want to go to that I just type some command like:

Than the machine would restart in the previous snapshot and I would just need to restart ssh to continue.

2 Answers 2

You cannot snapshot a running machine, you have to freeze it before, so my guess is that the host itself cannot do that.

In the host machine, from command line you can do this using VBoxManage.

The file is located in

and is used as a command-line interface with VirtualBox.

Using the command:

Them after that:

To return to the last state, for more read the text bellow, to have easy acess to VBoxManage add it to your path:

One of the most useful feature of virtualization software is its ability to take snapshots of VMs. It’s always a good idea to take a snapshot of a VM before making changes to it. Snapshots help on the hardware level to recover a system that has been rendered unusable due to changes to the hardware configuration, and on the software level they protect against data loss due to accidental deletion or virus.

Taking a snapshot from the VirtualBox CLI is child’s play. VBoxManage snapshot “Fedora” take snap1-stable-system takes the snapshot of a stable Fedora VM when everything is working perfectly. Saving a snapshot might take some time, depending on the VM and the resources on the host. To make sure you don’t make changes to a system while a snapshot is being taken, VirtualBox grays out the whole VM interface, and you cannot use it until the snapshot has been saved.

With a stable snapshot in hand, go ahead and play with the system. If you get in trouble and your machine won’t boot or starts behaving abnormally, you can revert to the snapshot of the stable machine. To do this, first power off the VM with VBoxManage controlvm “Fedora” poweroff, then revert to last snapshot with VBoxManage snapshot “Fedora” discardcurrent -state. If you have multiple snapshots, you can revert to the last but one snapshot with the -all switch instead of -state.

Of course when you revert to an older state, all the changes you made since that snapshot was taken are lost, including all configuration changes and changes to old and new files. You can work around this by specifying that your data should be stored on a “writethrough” disk, which behaves like a normal disk but isn’t affected by snapshots. Put another way, when you take a snapshot, VirtualBox ignores the writethrough disk. You can store all your important data and files or your complete /home directory on that disk.

To add a writethrough disk, use the -type writethough option when creating a new disk with createvdi. You can also change a disk you created earlier and make it writethrough. To do so, first unattach it from the VM with VBoxManage modifyvm “Fedora” -hdb none, and then unregister it with VBoxManage unregisterimage disk fourgig (using the name of the disk on your system in place of fourgig). Now register it back again but as a writethrough disk with VBoxManage registerimage disk “fourgig” -type writethrough. Finally, attach it back to the VM using VBoxManage modifyvm “Fedora” -hdb fourgig.

Now you can safely save data on this disk, and no matter what state the VM is in, the data will always be safe. But remember not to revert back to a state that was saved before this disk was created; if you do, VirtualBox will simply delete the disk, becase it didn’t exist in that state. Also, VirtualBox doesn’t currently let you take a snapshot of a VM that has a writethrough disk attached, so you have to unattach a writethough disk before saving the state of the VM and then reattach it. I hope in upcoming VirtualBox versions the presence of a writethrough disk will have no influence on the snapshot process.

–> share-line

–> –> –> –> plus

Snapshots preserve the state and data of a virtual machine at the time you take the snapshot. When you take a snapshot of a virtual machine, an image of the virtual machine in a given state is copied and stored. Snapshots are useful when you want to revert repeatedly to a virtual machine state, but you do not want to create multiple virtual machines.

You can take multiple snapshots of a virtual machine to create restoration positions in a linear process. With multiple snapshots, you can save many positions to accommodate many kinds of work processes. Snapshots operate on individual virtual machines. Taking snapshots of multiple virtual machines, for example, taking a snapshot of a VM for each member of a team, requires that you take a separate snapshot of each team member’s virtual machine.

Snapshots are useful as a short term solution for testing software with unknown or potentially harmful effects. For example, you can use a snapshot as a restoration point during a linear or iterative process, such as installing update packages, or during a branching process, such as installing different versions of a program. Using snapshots ensures that each installation begins from an identical baseline.

With snapshots, you can preserve a baseline before you change a virtual machine.

Several operations for creating and managing virtual machine snapshots and snapshot trees are available in the vSphere Client . These operations enable you to create snapshots, revert any snapshot in the snapshot hierarchy, delete snapshots, and more. You can create snapshot trees where you save the virtual machine state at any specific time so that you can revert that virtual machine state later. Each branch in a snapshot tree can have up to 32 snapshots.

A snapshot preserves the following information:

  • Virtual machine settings. The virtual machine directory, which includes the disks added or changed after you take the snapshot.
  • Power state. The virtual machine can be powered on, powered off, or suspended.
  • Disk state. State of all the virtual machine’s virtual disks.
  • (Optional) Memory state. The contents of the virtual machine’s memory.

The Snapshot Hierarchy

The vSphere Client presents the snapshot hierarchy as a tree with one or more branches. Snapshots in the hierarchy have parent to child relationships. In linear processes, each snapshot has one parent snapshot and one child snapshot, except for the last snapshot, which has no child snapshot. Each parent snapshot can have more than one child. You can revert to the current parent snapshot or to any parent or child snapshot in the snapshot tree and create more snapshots from that snapshot. Each time you revert a snapshot and take another snapshot, a branch (child snapshot) is created.

Parent Snapshots The first virtual machine snapshot that you create is the base parent snapshot. The parent snapshot is the most recently saved version of the current state of the virtual machine. Taking a snapshot creates a delta disk file for each disk attached to the virtual machine and optionally, a memory file. The delta disk files and memory file are stored with the base .vmdk file. The parent snapshot is always the snapshot that appears immediately above the You are here icon in the Snapshot Manager. If you revert a snapshot, that snapshot becomes the parent of the You are here current state.

The relationship of parent and child snapshots can change if you have multiple branches in the snapshot tree. A parent snapshot can have more than one child. Many snapshots have no children.

Snapshot Behavior

Taking a snapshot preserves the disk state at a specific time by creating a series of delta disks for each attached virtual disk or virtual RDM and optionally preserves the memory and power state by creating a memory file. Taking a snapshot creates a snapshot object in the Snapshot Manager that represents the virtual machine state and settings.

Each snapshot creates an additional delta .vmdk disk file. When you take a snapshot, the snapshot mechanism prevents the guest operating system from writing to the base .vmdk file and instead directs all writes to the delta disk file. The delta disk represents the difference between the current state of the virtual disk and the state that existed at the time that you took the previous snapshot. If more than one snapshot exists, delta disks can represent the difference between each snapshot. Delta disk files can expand quickly and become as large as the entire virtual disk if the guest operating system writes to every block of the virtual disk.

There are several ways you can make a backup of a virtual system on VirtualBox.

  1. Open VirtualBox.
  2. Start the virtual system you wish to take backup.
  3. Once opened, go to Machines >> Take snapshot.

Similarly, it is asked, how do I backup my virtual machine?

To back up the virtual machine:

  1. Ensure your virtual machine is in a powered off state.
  2. Locate the virtual machine folder.
  3. Right-click the virtual machine folder and click Copy.
  4. Navigate to the folder in which you want to store the backup, right-click anywhere within the folder, and click Paste.

Additionally, how move VirtualBox VM to another computer?

  1. Use the “Import/Export utility.”
  2. Copy the entire virtual machine folder, containing the . vdi and . vbox files.
  3. Clone the VDI using “Virtual Media Manager” and then recreate a VM on the target machine but using the cloned VDI as the hard disk.

Beside above, where are VirtualBox snapshots stored?

8 Answers. VirtualBox snapshots reside in the Machine Folder. You should be able to change the default machine folder using the menu option File->Preferences, under the General tab. “One thing I would like to add is that you can’t change your snapshots directory for a VM in which you currently have snapshots saved.”

What is difference between backup and snapshot?

The major difference between snapshot and backup in SQL Server is the time taken by the both to backup and restore data. However, backups are quite slow when compared snapshots while taking backup and restoring the database. It is because the snapshot is not an actual copy of data, it is a virtual copy of the data.

Hi folks. So I’ve come to really appreciate the snapshot feature of virtualbox, and in general just the idea of sandboxing an environment I can play in, and recover from any I do (goof) on the system. Well my only problem is remembering to take the actual snapshots. So here’s a quick dirty tutorial on how to set up the VBoxManage feature to do this for me!

So first what is a snapshot? From the VirtualBox “Man Page”

“This command is used to control snapshots from the command line. A snapshot consists of a complete copy of the virtual machine settings, copied at the time when the snapshot was taken, and optionally a virtual machine saved state file if the snapshot was taken while the machine was running. After a snapshot has been taken, VirtualBox creates differencing hard disk for each normal hard disk associated with the machine so that when a snapshot is restored, the contents of the virtual machine’s virtual hard disks can be quickly reset by simply dropping the pre-existing differencing files.”

I’m assuming you’ve installed Virtualbox to your machine. And I’m assuming you’re using Windows as the host machine. (Don’t judge me! I *DO* have a machine with a dedicated Bunsen install!)

1. First you should add the C:\Program Files\Oracle\VirtualBox path to your Windows Machine. To do this:
A. Click on the Windows Button.
B. Click on Control Panel.
C. Click on System.
D. Click on Advanced System Settings. (maybe on the left menu)
E. This will bring up the System Properties menu. Click on the Advanced tab.
F. At the bottom, click the “Environment Variables” button
G. Look under the System Variables scroll box and scroll down to where it says Path.
H. Select it, and click Edit.
I. Under the Variable value add the addition of: C:\Program Files\Oracle\VirtualBox
J. Make sure you separate the last path with the ; character. Make sure not to delete the other path options already there.
2. Okay so that will let you now run commands from the VirtualBox directory without having to CD over to it, or specify the full path
just for convenience. So now we’ll use Microsoft’s Task Scheduler to set up a simple task to create the snapshot.
Click on Start, and either search for “Task Scheduler” or go to control panel> administrative tools > task scheduler.
3. The main menu has lots of options but don’t be daunted, it’s simple once you’re familiar with it. On the left window, right click
on the “Task Scheduler Library”, and select New Folder.
4. Name the folder something like VirtualBox. Once it’s created, right click on that newly created directory and create one more new directory. Name this one something
specific to which VM you want to have the task run for. For example if you have 3 VM’s, you can create three separate directories, under the main “VirtualBox” directory.
5. So let’s walk through the task creation for one. Select one of the VM specific folders you made and on the right “Actions” pane, select
“Create Task”
6. When opened, You’ll be on the “General” tab. Type a name for your task. Because I’m doing snapshots, I named mine SnapShot (so original).
Make sure the Author is your logged user. Type a description if you’d like. (may help, keeping the different VM’s unique)
7. Just as a failsafe, I would check the “Run with highest privileges”.
8. Make sure the “Configure For” dropdown has the OS you’re running selected.
9. We’re all done here, so click “Triggers” tab, and click new. On the top of the menu you’ll see a drop down labled “Begin the task” This is all manner of triggers that we can
specify how you want your snapshot task to begin. I put mine on a schedule, but other options include “On Logon”, “On Startup” or “On Event” etc. and even more exist.
You can really delve deep and specify very precisely how you want this snapshot to be triggered. A lot of it has to do with Event ID’s that I don’t really even want to be
bothered with. To keep things simple, I’d just go for “On a Schedule”.
10. Choose how often you want it to run, and how often you want it to repeat, etc.
11. Once you have the schedule of it’s running worked out, move to the Actions tab. The only actions that I have on mine were “Run a Program”, “Send an Email” and “Display a Message”Welp.
Run a program sounds about right. It gives you a browse option as to what program you want to start. So, for our backups we need to select the VBoxManage.exe.
It’s by default, located in C:\Program Files\Oracle\VirtualBox\VBoxManage.exe Select this.
12. Below, you need to specify a few specific options. The main command to take the snap shot is VBoxManage snapshot “

“I have not failed, I have found 10,000 ways that will not work” -Edison

Cloning VirtualBox VM Snapshots Wednesday, March 18th, 2009

This is another “how to” tech article, anyone who is not interested in such things may stop reading now.

VirtualBox is a great virtualization software (hypervisor as the lingo currently goes) – I believe it matches up nicely against the current VMWare Workstation line and they offer both an open source version which is free for any use as well as a commercial version (with some added features such as SATA support) that is free for personal use.

VirtualBox allows you to take snapshots of the current VM state so that you can safely return to a previous state of your VM if you messed something up (for example – installed too much software on your Windows XP VM). Unfortunately, unlike what the VirtualBox UI will have you think, the snapshot features allows you to take progressive snapshots but you can’t fork your snapshot tree – you can’t create branches off old snapshots. Snapshots which are not current can be either discarded (have their state merged into another state) or reverted too (discard all the newest data and return to the old state).
How to save time by using snapshots in virtualbox

Additionally, you can’t copy (clone) VMs with snapshots except copying the oldest state1.

Still, if you want to keep your old state, and maybe fork some previous snapshots and create something of a real tree structure, there is a round about way to achieve something similar:

Suppose you have created a set of snapshots similar to the screenshot above, and now you want to use “Old State B” as a basis for a new set of snapshots (that will not include the changes in “Old State C”).

In the screenshot below you can see the VirtualBox Media Manager lists the VMs virtual HD with all its snapshots – “Arbel.vdi” is the base snapshot “Old State A”, the next down is “Old State B”, then “C” and finally “Current state”.
How to save time by using snapshots in virtualbox

Theoretically what you would want to do is to use VirtualBox’s command line management interface to clone the virtual HD state of “Old State B” (UUID 4e1f756e-f158-4c07-bc9a-20261f574730) into a new base HD, like this:

And then create a new VM that you can use for the new set of snapshots (as we said, you can’t actually see a tree of snapshots, but you can represent each branch using its own VM. Not really space efficient, but works).

The problem is that VirtualBox’s clonehd will not let you clone a snapshot other then the base. This is due to the fact that snapshots are simply “difference lists” between the previous snapshot and the current state. Whenever you take a snapshot VirtualBox will “freeze” the current state as a read-only VDI file and create a new VDI where it will save only the blocks that the VM has written too after the snapshot. In order to clone a snapshot VirtualBox will need to first consolidate all the changes between all the previous snapshots. This functionality apparently is not implemented yet.

What you can do is to clone the base snapshot – this is a normal VDI file that all the snapshot VDIs refer to (and it is read-only with regard to the VM so you can clone it even if the VM is currently running). So I can clone “Old State A”, but not “Old State B”. But what I can do is to force VirtualBox to consolidate “Old State A” and “Old State B” back into the base snapshot (“Arbel.vdi” in the above screenshot) by discarding the base snapshot: open the “Snapshots” tab for the VM whose state you want to clone, select the first snapshot “Old State A” and choose “discard” from the toolbar. What really happens is that VirtualBox pretends to remove “Old State A” but it actually removes “Old State B” after copying all the changes in “B” back into “A”. You now have a base snapshot which contains the state in “Old State B” which you can clone. Do note though that in VDI file terms, the VDI file for “Old State B” (4e1f756e-f158-4c07-bc9a-20261f574730 above) was removed and you need to clone the base VDI, like this:

Now you can create a new VM with the “new-old-state-b” VDI as the boot hard disk.

What happened to “Old State A”? Its gone – not there any more. If you want to keep it in case you want to base a new set of snapshots on that, you have to clone it first before discarding it (for the cost of the whole disk space it took, of course).

I do wish though that VirtualBox would offer the ability to manage a tree of snapshots it would make the whole situation much more convenient to work with for QA purposes, and I believe they will offer this capability in the near future as most of the infrastructure seems to be already in place (including the UI to display it 🙂 ). Another tiny feature that I’m missing from VMWare Workstation is “VM groups” to make it easier to manage many VMs – but that is a different story altogether.

Update:
Starting with version 3.1, VirtualBox does support a tree of snapshots – it will let you boot to any intermediary snapshot and take new snapshots from that. Which is more or less exactly what I wanted.

Its not entirely trivial to use: to start a VM from an old snapshot, choose the snapshot to use and select “Restore Snapshot” – VirtualBox will then rebase the “current state” on that snapshot by discarding the old “current state” and “forking” a new “current state” from the snapshot you’ve chosen. You can then start the VM based on this new state.

Building Professional Web Hosting Solution
> Post Linux OS Setup Initial Steps Section

  1. Understanding Root Account Privileges Methods
  2. Creating and Adding Local Users to Sudoers List
  3. Installing Linux Virtual Machine Guest Additions
  4. Cloning Virtual Machines using VM Snapshot

One of the coolest features in virtualization is Cloning Virtual Machines using VM Snapshot. The following slideshares will show you how easy and fast to create copies of your Linux VM. The idea is to save time and focus on Testing or production. I am going to use Snapshot V1 using Linked Cloned Technology. Snapshot V1 can carry the Basic OS Setup, Basic Configuration, and the Latest Updates/Upgrades. You don’t need the following procedure if you are using Public VPS.

Objectives:

1. Using VirtualBox or VMware Station Snapshot as Template

2. VirtualBox – Creating Linked Clone VM from a Template

3. VMware Station – Creating Linked Clone VM from a Template

Prerequisites:

A. Basic VirtualBox or VMware Station Knowledge

B. Needed Packages and Drives should be Installed

Table of Contents

Using VirtualBox or VMware Station Snapshot as Template

The benefits of having VM snapshot to act like a Template are a lot, just to name a few: 1) You would know that root account holds the default password you set, 2) the system got latest updates and upgrades you installed, and 3) faster to deploy, which saves you tons of time. Therefore, Templates expedite the deploy process to create multiple Cloned VMs which will give you the opportunity to focus on testing or production.

As you probably guessed, after 1 month or so, you can run the Template VM again, update, upgrade, and create Snapshot V2. Once the snapshot is taken, you can create Linked Cloned or Full Cloned VMs from that New Snapshot for testing or production use.

The following slideshares will show you step by step how to 1) Create your first version1 Snapshot, 2) From that Snapshot, create Linked Clone VMs, 3) Organize Cloned VMs in specific folders. The slideshares suitable for either Debian, Ubuntu, and CentOS Linux, or any VM that have been created using VirtualBox or VMware Station.

TIP: Most of my testing happens on Linked Cloned VMs to save storage, however, when I need to roll VMs for Production, I use FULL Clone created from the Linked Clone tested VM.

An automated backup for Oracle VirtualBox VMs in Windows

  1. Clone or copy this repository to the desired location.
  2. Edit and rename (optional)Example Start.bat according to your needs. See below Usage
  3. Create a basic task to periodically start Example Start.bat(or whatever you named it) with Task Scheduler.

I’ve tried passing the arguments directly to VirtualBox Backup.bat in Task Scheduler but the task didn’t start correctly. Using Example Start.bat as the placeholder makes editing the parameters a bit more ‘user friendly’ and easier to duplicate.

If you do not pass a parameter it will revert to it’s default behavior as documented below.

Pass this parameter along with a valid path to set the target folder. A subfolder is automatically created for each VM. Your can use Windows default variables like %USERPROFILE% and %ONEDRIVE% . The custom variable %_CURRENTDIR% will set the target folder to where you save the .bat files.

Leaving the backupdir parameter out will create a snapshot of the VM without copying any files. This setting automatically sets Backup Mode to snapshot and enables Stack. Keep is currently not supported in combination with this setting. Compress does not apply and is ignored.

Parameter Description
–backupdir “%_CURRENTDIR%” Parent folder, see above description.
–backupdir “%USERPROFILE%” C:\Users\YourUsername
–backupdir “C:\Backup” C:\Backup

In order to succesfully create a backup, the VM needs to be in a stable (not changing) state. To reduce downtime, a snapshot is created and the VM is restarted (if it was running in the first place).

To restore a backup you simply copy/extract the files to your desired location, add (add, not new) VM to OracleBox and restore the latest snapshot. Be aware that you will not be able to restore a backup while the original VM still exists in the same instance of VirtualBox because the drives will have identical UUID’s.

Parameter Description
–backupmode acpipowerbutton The VM is completely shut down and boots normally after the snapshot is created. Not ideal if login is required after boot. Booting a restored backup is like normal booting the VM.
–backupmode savestate The VM’s state is frozen and saved, VM resumes normally after the snapshot is created. Not all operating systems can handle this gap in time. Booting a restored backup is like unfreezing time, the same gap applies. You might need to restart your VM to fix any time gap issues.
–backupmode snapshot The VM is saved in a live snapshot without any downtime. Booting a restored backup is as if the VM experienced a power failure. It the best suboptimal solution to prevent downtime.

Each backup is saved to a subfolder inside the target folder named after the VM. The backup is named [prefix ]YYYY.MM.DD-HH24.MM[ suffix] . Pass one or both parameters to append an additional string to the backup name.

Parameter Description
–prefix “Automated Backup” Prefix the backup name with “Automated Backup”
–suffix=”Daily” Suffix (append) the backup name with “Daily”

Set one of the above parameters to exclude or explicitly include a single VM from backup. Does not accept wildcards and is case sensitive.

Explicitly excluding a single VM will still run backups for all other VMs. Explicitly including a single VM will exclude all other VMs.

Parameter Description
–include “Remi” Will include only the VM named Remi from the backup rotation and ignores the rest.
–exclude “Not Me” Will exclude only the VM named Not Me from the backup rotation but does backup the rest.

. In order to enable data compression you need to install 7-Zip to the default path C:\Program Files\7-Zip\7z.exe . To disable compression, leave this parameter out or explicitly set it to -1 .

The VM Backup Files can be compressed to a single 7-Zip file to save some diskspace and to make them easier to move around.

Parameter Description
–compress -1 (default) Disable compression.
–compress 0 No compression rate. While this does not actually reduce filesize, it does reduce the backup to a single file.
–compress [1 – 9] Set compression level: 1 (fastest) . 9 (ultra).

Delete old backups with the same prefix and/or suffix and retaines the last [x] . If no Prefix and/or Suffix is set, all files and folders in the VM’s backup subfolder are validated and possibly removed.

Parameter Description
–keep 0 (default) No cleanup. Keep all backups.
–keep [x] Retain the [x] latest created backups.

A snapshot is always created before the files are copied. This uses some disk space because VirtualBox saves the new state on top of the latest snapshot. To save disk space, the snapshot is deleted after the backup is created (unless you’re using Snapshot Only). Add this flag to retaun the snapshots, stacking each snapshot on top of the previous one (uses a lot of disk space).

Parameter Description
–stack Retain all snapshots.

You will need to create and schedule multiple Example Start.bat files, one for each generation. Make sure you use a different prefix, suffix or even target folder for each generation to prevent unintended deletion of backups.

Rotation Parameters Description
Daily Son.bat –keep=2 Scheduled to run at 02:00 daily.
Weekly Father.bat –keep=4 Scheduled to run at 02:15 on every Monday of every week.
Monthly Grandfather.bat –keep=3 Scheduled to run at 02:30 on the first Monday of every month.

By the end of June 2020 it would look like this.

Day 1-4 1-5 1-6 8-6 15-6 22-6 28-6 29-6 30-6
Son X X
Father X X X X
Grandfather X X X

About

An automated backup for Oracle VirtualBox VMs in Windows

Igor Ljubuncic

on 7 March 2019

  • Share on:
  • Facebook
  • Twitter
  • LinkedIn

Data backups are arguably the most important part of one’s software setup. While many scenarios fall into the realm of if, data loss belongs in the when domain. Over time, every one of us will experience some kind of hardware failure, be it an optical disk, a hard disk or a lost phone. It is vital to have a good backup procedure in place, so you can quickly and smoothly recover, and resume your work.

Last week, we talked about application backups. This week, we will talk about another important aspect of how to preserve your data – snapshots.

When you install a new snap, the application data will be saved in two main locations:

  • Application data will be stored under /snap, or /var/snapd (like in Fedora).
  • User data will be stored under /home/(your user)/snap/.

Each revision of the snap will be stored in a separate directory, with incremental numbers, e.g.: 6 or 42, with the symbolic link current pointing to the version that is in use, typically the latest revision.

Moreover, there will also be a sub-directory called common in each snap folder in your home, containing components that are not specific to any particular revision of the snap, like generic configurations or cached data.

For instance, the contents of the gimp snap under /snap/gimp/:

The contents of the same snap under /home/(user)/snap/gimp/:

At first glance, the system-level data and user data may seem identical, but as you navigate deeper into the folder structure, you will notice the differences. Following our example, the contents of the sub-directory current under /snap/gimp/:

Likewise, here are the contents of the sub-directory current under /home/(user)/snap/gimp/:

This is user-specific data, and it contains important changes and customisations that people will introduce as they use the snap, including various aesthetic tweaks, plugins, scripts, fonts, and more. And we want to backup this data!

If you are somewhat familiar with the Linux command line, you can create your own snap data backups. You can use scripts (or backup) tools to copy the snap data to a backup folder, and you can even automate the task so it’s done in the background (perhaps a nightly run).

You may also want to consider keeping any application-specific data under your home directory in sync with the snap data, so that you always use a common set of tweaks, settings and configurations. We have talked about the tools like rsync and mackup in the last article, and you can use these to manually set up your backup routine for any snap data you need. This way, if you remove and purge your snaps, reinstall your host, or deploy snaps on a different machine, you will still have your user data.

If you’re not comfortable with scripting, luckily, you don’t need to make any big changes yourself. Snaps come with a built-in snapshot functionality, invoked through the use of the save command. If you type snap help save, you will get more details into how snaps create and restore snapshots:

With the snapshot functionality, you can create backups of your snaps with relative ease. You can snapshot all snaps or individual ones (you may only be interested in some of the data), and if there are multiple users on the system, you can backup their data as well, or just your own. For instance:

Once you have snapshots on your system, you can list them with snap saved or verify their integrity with snap check-snapshot (snapshot id):

You also have the option to restore snapshots, and delete (forget) any snapshots you do not require anymore.

In the background, whenever your take a snapshot of a snap, the data stored under /home/(user)/snap/(snap name) will be compressed into a zip archive and stored under /var/lib/snapd/snapshots, e.g.:

Each zip archive contains declarative metadata as well as several sub-archives (in .tgz format), including per-user data, stored as your-user-name.tgz. This means you have additional freedom in handling your data. For instance, you copy the top-level zip archive or the per-user tgz archive anywhere you like, add it to any backup procedure you may have, or even deploy it on remote systems. If you reinstall your system, or even set up a new one, you can still retain your snap data, and quickly restore it whenever you need it.

Snapshots allow you to control your data and create an elegant, modular backup and restore setup for your snaps, so you can port your user settings to other Linux machines, or any new devices you may deploy. You also have the option to use them whenever you have to rebuild your operating system. This allows you to resume working without losing data or having to waste time reapplying the customization you need and like.

You have the ability to save snapshots of individual users or snaps, which gives you even more granularity of the process. Finally, you can also script and automate the functionality, so that everything runs in the background, and you are always ready and up-to-date for any data loss eventuality.

If you have any questions or comments regarding snapshots, please join our discussion forum and share your thoughts with us.

Ubuntu desktop

Learn how the Ubuntu desktop operating system powers millions of PCs and laptops around the world.

A virtual machine (VM) snapshot captures the state and data of a virtual machine at the specific time when the snapshot was taken. It acts pretty much like the usual operating system snapshots. A VM snapshot is an exact copy of the VM and can be used for VM migration or creating multiple instances of the same VM. It can also be used for restoring the VM to the former state at which the snapshot was captured.

What Is a VM Snapshot?

A virtual machine snapshot is just an image of the state and data of a virtual machine, captured and stored at a given point in time. VM power states can be as follows: running, powered-off, unknown, suspended, aborted or paused, and either active or disconnected. A virtual machine’s data includes all files from disk, in memory and on other supported storage devices.

A VM snapshot does not have any impact on the virtual machine itself. However, if you’re working in an environment where you need to repeatedly roll back to a specific state of the VM, a VM snapshot can allow you to do so without having to create multiple VMs. For instance, you can use a VM snapshot as a safe restoration point for performing upgrades or making changes in the existing VM settings and configurations. If something goes wrong, you can revert back to the captured VM snapshot easily. It can also be useful in development and testing environments, where you need several virtual machines with similar configurations for testing purposes. Or, you may be performing and testing several code changes iteratively and need to have a safe rollback point.

What Are the Components of a Snapshot File?

A VM snapshot file consists of all the files stored on the storage devices of a virtual machine. Taking a snapshot creates files with extensions .vmdk, -delta.vmdk, .vmsd, and .vmsn, which are stored with the VM base files. The delta files are stored with the base VMDK file, which is stored in read-only mode to preserve its state. And VMSD and VMSN files are stored in the VM directory.

When you take a snapshot, the original VMDK file with the current disk state is preserved in read-only mode, and the guest OS can no longer make changes to it. Instead, a delta or a child disk file called delta.vmdk is created to which the guest OS can write. It holds the current disk state and the state that existed when the last VM snapshot was taken. The delta disk has two files: a disk descriptor file (with extension .vmsd) that contains information about the VM snapshot—like relationships between snapshots and child disks for each snapshot—and a flat file (called flat.vmdk) with raw data.

Optionally, you can take a memory snapshot which also captures the memory state of the virtual machine. A memory snapshot also includes a memory state file (with extension .vmsn) that holds the memory of the VM at the time of the snapshot capture. The size of the memory file and the time it takes to capture the memory state depends on the configured maximum memory for the original/parent VM.

In a Hyper-V environment, VM snapshots are called checkpoints. Capturing a new checkpoint creates files with extensions .vmcx, .vmrs and .vmgs in the snapshots folder. The file with extension .vmcx is a binary configuration file, the file with extension .vmrs holds the information about the state of running VMs, and the file with extension .vmgx stores the VM guest state. Other files created when a checkpoint is captured include an RCT file for tracking changes between two consecutive backups, MRT files for data resilience in the event of a failed backup operation, and an AVHDX file that is merged with VHDX file once the checkpoint is deleted.

What Are the Limitations of VMware Snapshots?

The biggest problem of VMware snapshots is that they can affect the performance of a virtual machine, because they utilize the same infrastructure and resources as the parent VM. There are several other limitations to keep in mind when capturing VMware snapshots:

  • Capturing VMware snapshots of raw disks, raw device mapping (RDM) physical mode disks, and guest OSs with Internet Small Computer Systems Interface (iSCSI) initiator are not supported.
  • Snapshots of powered-on or suspended VMs with independent disks are not supported. The VM must be powered off before capturing the snapshot.
  • Capturing snapshots of VMs configured for bus sharing or supporting PCI vSphere Direct Path I/O devices is not supported.
  • Snapshots are not recommended to be used as a means of backup and recovery because of their huge disk space consumption and effect on VM performance.
  • Capturing snapshots of VMs with hard disks larger than 2 TB can take too much time.

How Do Backups Differ from Snapshots?

Using VM snapshots for backups and recovery is against the best practices for using VM snapshots. This is because they do not meet the criteria for effective backups and recovery points. The major difference is that backups are supposed to be completely independent of the original virtual machine that we need to back up. But VM snapshots basically reside on the same disk space as their parent VM. So, if the physical infrastructure of the parent VM fails, the snapshot will be lost along with the parent VM. On the other hand, a backup stored separately will remain unaffected and can be used to restore the base VM files fully.

Snapshots also take up a lot of disk space. So, storing too many snapshots on the same storage infrastructure can result in performance degradation. By nature, snapshots are meant to be deleted after a certain amount of time. You shouldn’t keep them once the need to roll back to the specific point-in-time state is over; for instance, you should delete them after updates have been successfully performed. If snapshots are kept longer than recommended, they can keep growing in size and will ultimately start causing performance issues.

Parallels RAS Offers a Simple Approach to Managing VDI

Parallels® Remote Application Server (RAS) makes it a lot easier and more straightforward to deploy and manage virtual desktop infrastructure (VDI). Parallels RAS enables administrators to deploy VDI desktops through customized templates quickly. They can create a template once and deploy multiple VMs instantly by simply choosing the template and specifying the number of VMs they wish to create. All they have to do is create a virtual desktop and replicate it as needed, even on the fly.

Through linked clones, Parallels RAS enables administrators to replicate the virtual disk of a VM instead of launching another VM. This way, multiple VMs can share a single software installation and save disk space. What’s more, Parallels RAS supports VMs from different hypervisors, such as Hyper-V and ESXi, and hyperconverged infrastructures, —such as Nutanix Acropolis and Scale Computing HC3. It also allows companies to choose between on-premises, hybrid and multi-cloud infrastructures.

Download a 30-day, free trial of Parallels RAS to experience ultimate flexibility and convenience when implementing a VDI.

by Igor Ljubuncic on 7 March 2019

Data backups are arguably the most important part of one’s software setup. While many scenarios fall into the realm of if, data loss belongs in the when domain. Over time, every one of us will experience some kind of hardware failure, be it an optical disk, a hard disk or a lost phone. It is vital to have a good backup procedure in place, so you can quickly and smoothly recover, and resume your work.

Last week, we talked about application backups. This week, we will talk about another important aspect of how to preserve your data – snapshots.

When you install a new snap, the application data will be saved in two main locations:

  • Application data will be stored under /snap, or /var/snapd (like in Fedora).
  • User data will be stored under /home/(your user)/snap/.

Each revision of the snap will be stored in a separate directory, with incremental numbers, e.g.: 6 or 42, with the symbolic link current pointing to the version that is in use, typically the latest revision.

Moreover, there will also be a sub-directory called common in each snap folder in your home, containing components that are not specific to any particular revision of the snap, like generic configurations or cached data.

For instance, the contents of the gimp snap under /snap/gimp/:

The contents of the same snap under /home/(user)/snap/gimp/:

At first glance, the system-level data and user data may seem identical, but as you navigate deeper into the folder structure, you will notice the differences. Following our example, the contents of the sub-directory current under /snap/gimp/:

Likewise, here are the contents of the sub-directory current under /home/(user)/snap/gimp/:

This is user-specific data, and it contains important changes and customisations that people will introduce as they use the snap, including various aesthetic tweaks, plugins, scripts, fonts, and more. And we want to backup this data!

If you are somewhat familiar with the Linux command line, you can create your own snap data backups. You can use scripts (or backup) tools to copy the snap data to a backup folder, and you can even automate the task so it’s done in the background (perhaps a nightly run).

You may also want to consider keeping any application-specific data under your home directory in sync with the snap data, so that you always use a common set of tweaks, settings and configurations. We have talked about the tools like rsync and mackup in the last article, and you can use these to manually set up your backup routine for any snap data you need. This way, if you remove and purge your snaps, reinstall your host, or deploy snaps on a different machine, you will still have your user data.

If you’re not comfortable with scripting, luckily, you don’t need to make any big changes yourself. Snaps come with a built-in snapshot functionality, invoked through the use of the save command. If you type snap help save, you will get more details into how snaps create and restore snapshots:

With the snapshot functionality, you can create backups of your snaps with relative ease. You can snapshot all snaps or individual ones (you may only be interested in some of the data), and if there are multiple users on the system, you can backup their data as well, or just your own. For instance:

Once you have snapshots on your system, you can list them with snap saved or verify their integrity with snap check-snapshot (snapshot id):

You also have the option to restore snapshots, and delete (forget) any snapshots you do not require anymore.

In the background, whenever your take a snapshot of a snap, the data stored under /home/(user)/snap/(snap name) will be compressed into a zip archive and stored under /var/lib/snapd/snapshots, e.g.:

Each zip archive contains declarative metadata as well as several sub-archives (in .tgz format), including per-user data, stored as your-user-name.tgz. This means you have additional freedom in handling your data. For instance, you copy the top-level zip archive or the per-user tgz archive anywhere you like, add it to any backup procedure you may have, or even deploy it on remote systems. If you reinstall your system, or even set up a new one, you can still retain your snap data, and quickly restore it whenever you need it.

Snapshots allow you to control your data and create an elegant, modular backup and restore setup for your snaps, so you can port your user settings to other Linux machines, or any new devices you may deploy. You also have the option to use them whenever you have to rebuild your operating system. This allows you to resume working without losing data or having to waste time reapplying the customization you need and like.

You have the ability to save snapshots of individual users or snaps, which gives you even more granularity of the process. Finally, you can also script and automate the functionality, so that everything runs in the background, and you are always ready and up-to-date for any data loss eventuality.

If you have any questions or comments regarding snapshots, please join our discussion forum and share your thoughts with us.

Introduction

This document describes how to use virtualization for creating checkpoints (which can be frozen and restored for investigation purposes) during simulations with Active-HDL/Riviera-PRO. The virtualization process has been tested on Active-HDL 9.2.SP1 and Riviera-PRO 2015.02.

Overview

Virtualization is a product that can be used as a free solution described on https://www.virtualbox.org. It allows:

Running multiple operating systems simultaneously.

Easier software installations.

Testing and disaster recovery.

By using snapshots, you can save a particular state of a virtual machine for later use. You can revert back to that state at any time, even though you may have changed the VM considerably since then. If you have found some issues, you can add additional signals to the waveform for investigation purposes. The main advantage is that it saves all applications (not just the one involved in the process), all windows documents, etc. Active-HDL and Riviera-PRO support this in the license mechanisms (restoring license connections after restoring images).

NOTES : Before executing the described flow:

Make sure you have the VirtualBox software properly installed.

Have a properly prepared/configured virtual machine.

Have Active-HDL/Riviera-PRO installed, as well as a valid license.

Installing Active-HDL/Riviera-PRO on a virtual machine

After creating the virtual machine and installing the operating system on it, you can install Aldec’s products. The installation on the virtual machine can be performed in a similar way as on a real machine.

NOTE: It is recommended to copy the main installation file which can be downloaded from our website (for example, Active-HDL 9.2sp1 main setup.exe or Riviera-PRO-2015.02.76-Windows.exe ) to a virtual machine in order to avoid the network delays problems and then execute it on this virtual machine.

Starting Active-HDL/Riviera-PRO on a virtual machine

After the license configuration, you can run the specified Aldec product by double-clicking the appropriate icon placed on the desktop.

NOTE: You have to set the ALDEC_LICENSE_FILE environment variable to the proper value in order to run the given product. The variable should point to the location of either the license.dat file or the license server. When specifying the license server, you can use either of the following notations:

Working with snapshots

There are three operations related to snapshots:

You can take a snapshot .

You can restore a snapshot .

You can also delete a snapshot .

Taking a snapshot

This creates a copy of the machine’s current state to which you can go back to at any given time. You can create a snapshot when the VM is running, in the saved state, or in the powered off state. When the VM is running, select Take Snapshot from the Machine menu of the virtual machine window.

How to save time by using snapshots in virtualbox

When the VM is in the saved or powered off state, you can take a snapshot by clicking the Snapshots button that is placed in the top right corner of the main window. Next, do the following:

Click the camera icon or use the Ctrl + Shift + S keyboard shortcut.

How to save time by using snapshots in virtualbox

Define the snapshot name and its description and press OK .

The new snapshot will appear on the snapshots list.

Restoring a snapshot

You can restore a snapshot by right-clicking any snapshot that you have taken and choosing Restore Snapshot . By restoring a snapshot, you can go back (or forward) in time. Note that the current state of the machine will be lost and it will be restored to the exact state that it was in when the snapshot was taken.

How to save time by using snapshots in virtualbox

Deleting a snapshot

Deleting a snapshot will not affect the state of the virtual machine; it will only release the files on disk that VirtualBox used to store the snapshot data. This will free the disk space. To delete a snapshot:

Right-click the desired snapshot.

Select Delete Snapshot .

NOTE: As of VirtualBox 3.2, snapshots can be deleted even while a machine is running.

How to save time by using snapshots in virtualbox

Saving the machine state

With this option, VirtualBox “freezes” the virtual machine by saving its state to your local disk. When you start the VM again later, you will find that the VM continues exactly from the same point where it was previously “frozen”. All your programs will still be open, and your computer resumes the operation. Saving the state of a virtual machine is thus in some ways similar to suspending a laptop computer (e.g. by closing its lid).

For detailed information about these operations, refer to the Virtual Box manual.

Performance of the VM depends on the system settings that were defined during the creation of the machine. The most important settings can be found within the System category.

How to save time by using snapshots in virtualbox

Example scenarios

First scenario

You have a design in which the simulation takes a lot of time. You know that the simulation will not finish in one workday and you do not want to lose your simulation results. You can easily run this simulation on the virtual machine and before leaving, save the machine state. The next day, you can easily start the machine and continue the simulation process.

Second scenario

You have a limited number of licenses for Active-HDL/Riviera-PRO. While running a simulation on a virtual machine, you find that you need to run another simulation but you do not have another license. In this case, you can save the machine state of the running simulation and run the new simulation. After you finish the new simulation, you can start the previous one from the saved machine state.

Third scenario

You had a long simulation and you made a few snapshots. After reviewing/investigating the waveform from the base machine, you realized that it would be helpful to have some information provided by tracing additional signals. You can easily restore a simulation from the previously saved snapshots and add more signals to the waveform. This way, you will not have to restart the whole simulation process and wait a long time for results.