Software & Apps Linux Create Clones and Snapshots of Virtual Machines in VirtualBox Make copies of Ubuntu images quickly and easily by Jack Wallen Writer Jack Wallen is a former Lifewire writer, an award-winning writer for TechRepublic and Linux.com, and the voice of The Android Expert. our editorial process LinkedIn Jack Wallen Updated on September 11, 2020 Linux Switching from Windows Tweet Share Email Virtual Machines have been a game changer for testers, admins, and data centers. For those who prefer using open source technology, VirtualBox is an incredible way of creating and managing virtual machines. Two features of VirtualBox that every admin should understand how to use are clones and snapshots. What are clones and snapshots? Simply put, clones are an exact copy of a working virtual machine, while snapshots allow you to save a particular state of a virtual machine (which can be handy when you want to test something, or you're about to make a change to that virtual machine, and need to be able to roll back to a working instance, should something break). Let’s see how to create both clones and snapshots in the latest version of VirtualBox (5.2.20). We’ll demonstrate using a Ubuntu Server 18.04 instance, but the process is the same, regardless of what guest operating system you are working with. Creating a Clone As stated, clones are one of the best ways to create an exact copy of a virtual machine. One very handy way to make use of clones is to create a clean virtual machine of, say, Ubuntu Server, and then clone the original for a fresh base that can be used for any purpose. So with a clean Ubuntu Server 18.04 virtual machine in place (and either off or in a saved state, as clones cannot be created while a virtual machine is running), you can create a clone by following these steps: Open VirtualBox. Select the virtual machine to be cloned in the left pane. Right-click the virtual machine to be cloned. Select Clone from the popup menu. When prompted, give the clone a name, and press Next. Select Full clone from the Clone type window, and press Clone. Depending on how large your virtual machine is, the cloning process can take anywhere from five to twenty minutes. Make sure to give the clone a fitting name for its usage, otherwise you might wind up with a lot of clones with similar names (which could be confusing). When the process completes, your clone is ready to use. Creating and Using Snapshots Snapshots are a great way to save a particular state of a virtual machine (VM). Say, for instance, you plan on installing something new on (or making a change to) a working VM and you want to make sure you have a “saved point” that you can roll back to (in case things go awry). Let’s use the same Ubuntu Server VM to create a snapshot. Say you’re about to install a LAMP stack (or a major upgrade) and you want to make sure you can roll back, on the off-chance the install/upgrade breaks something you’ve installed and configured. To create the snapshot, select the VM to be used in the left pane, and select the Snapshots tab near the top of the window. In the resulting screen, press Take. In the resulting window, give the snapshot a name and a description. Make sure to leave adequate notes in the description, so you know the reason this snapshot was taken and/or how the state of the VM was prior to what was done post-snapshot. Press OK, and the snapshot will be taken. You should now see the name of the snapshot listed with Current State below. To restore a snapshot, follow these steps: Select the virtual machine to work with from the left pane in the main window. Select Snapshots near the top of the window. Select the snapshot you want to restore. Press Restore. In the resulting window, uncheck the box for Create A Snapshot Of The Current Machine State. Press Restore. Select the snapshot you want to restore. The reason why to uncheck the box for Create A Snapshot Of The Current Machine State is simple. If you’re rolling back to a previous state, because the current state is broken, you don’t want to take a snapshot of that broken state. When you uncheck that box, the broken state will be discarded. Another way of restoring a snapshot is through the Close Virtual Machine dialog. With a VM running, select File > Close. In the resulting window, check Power off the machine and then check Restore current snapshot. The one caveat to this method is that it only allows you to restore to the previous snapshot (instead of being able to select a specific snapshot, as you could in the previous method). Press OK and the snapshot will be restored. At this point, your virtual machine will have rolled back to the state found in the restored snapshot. Any change made after that snapshot will be gone.