Whenever we take a snapshot in VMware workstation it keeps that particular state in a separate VMDK file. The virtual machine will be working from that file and any changes inside the guest OS will be added to the snapshot file. Sometimes we have to merge these files to the original base file or delete these snapshot files. In this guide, let me explain how to merge snapshots in VMware Workstation.
I’m not going to show any complicated commands or steps here. It is very simple, but you have to understand the fundamentals and how it works. The below steps are applicable for any version of VMware workstation of any host computers OS such as Windows or macOS.
How Do Snapshots work in VMware?
A snapshot is a particular state of Virtual machine. It’s like a system restore point in Windows Operating Systems, but slightly different. In fact, I would say that it is the ‘Time machine’ of a virtual machine. Snapshot feature allows taking the state of a VM to backwards and forward. For example, if you have a snapshot which was taken one week ago, today you can restore it and get back the exact VM how it was working one week ago.
Taking a snapshot before doing any update or testing or major changes is the best way to protect a VM in production or test environment. Each snapshot keeps separate VMDK files under the working folder. We can’t use these separate Snapshot disk files alone (without original base VMDK, previous snapshots and configuration files) in any of the desktop virtualization software including VMware and VirtualBox.
Why We have to Merge Snapshots?
Good question! It is one of the good practices to keep important system states of virtual machine (For example, before any updates, major installations, experiments and for backup purpose too) as snapshots. But after a few days of using the VM, the previous version of VM the snapshots become invalid. We will not need them any more to restore and revert back the VM to the previous state. Here are the reasons why we need to delete and merge snapshots in VMware workstation:
1) Particular snapshot is not important anymore or very old.
2) To get some disk space on the host computer.
3) The snapshot was created accidentally or by any backup software.
4) To use virtual machine in other virtualization software such as VirtualBox or Hyper-V. These programs will not detect VMware snapshot technology. So, the current machine’s state shout be merged to the single base VMDK file before converting to VDI or VHD.
5) To export, import and share the Virtual machine’s disk file. It is recommended to migrate/move a VM in a single virtual hard disk file.
How to Merge Snapshots in VMware Workstation?
It’s simple, just delete them in VMware snapshot manager 🙂
Once we delete a snapshot in Snapshot Manager, it will merge with the previous snapshot file. So, if you have multiple snapshots between the first base VM and current state (You Are Here), you need to delete them all to merge the current state of the VM to original VMDK file.
Important Note: DO NOT delete VMDK files directly in Windows Explorer.
Go to snapshot manager of the particular virtual machine. Select the point and press delete.
Explanation in our Example:
- The three snapshots (marked as B) with the lock symbol are connected to some other cloned VMs. Some virtual machines are created with these snapshots and running differently. These snapshots are base of those VMs and it is called ‘Linked Clones‘. If I delete them, those machines will stop working.
- If I delete D, it will merge with C. You can’t revert back any snapshot deletion, so think twice before pressing the delete button.
- If our purpose is to merge B, C and D to A which is having base original VMDK file, then delete all (B, C, D) one by one. It will remove all snapshot VMDK files and add the changes to the original file. So the current state of VM E will go to next to A.
Capturing a snapshot usually takes less time, but when it comes to deleting it, it takes more time, because it should merge with the previous file. Be patient.
There are few methods available to merge snapshot files without deleting, but it is slightly complicated and required additional tools. I find these are the simple and easy steps to merge snapshots in VMware workstation on Windows or macOS hosts.