Skip to content

How to Recover Files from a VMDK File: Healthy, Corrupted, Missing Descriptor or Encrypted

By Srinivasan Krishnappa · Ransomware & database recovery engineer · 656+ ransomware recoveries
8 min read
Need this solved now? We have already solved 656+ ransomware and data recovery cases. Call +91 74187 05822, WhatsApp us or email info [at] asittech.com. Free assessment; no data, no charge.

Sooner or later, most VMware administrators need to get files out of a VMDK without the virtual machine that owned it: the VM will not boot, the host has failed, a datastore was copied to a USB disk, or the disk is all that is left after an incident. How easy that is depends almost entirely on which part of the virtual disk is damaged.

This guide explains how a VMDK is put together and then goes through the cases in order, from a healthy disk you only need to open, to a corrupted or ransomware-encrypted one.

What a VMDK actually is

On ESXi, a virtual disk is usually two files. The small one, named like server.vmdk, is a text descriptor: it records the disk's size, geometry, type and the name of the data file. The large one, server-flat.vmdk, holds the data itself as a plain image of the whole disk, sector by sector. VMware Workstation and exported disks often use a single sparse file instead, which stores only the blocks that were written.

Snapshots add more files. Each snapshot creates a delta disk such as server-000001.vmdk (with a -delta or -sesparse data file) that records only the blocks changed since the snapshot. The VM reads through the chain from the newest delta down to the base disk, and each descriptor names its parent and carries a content ID (CID) that the child must match.

Case 1: the VMDK is healthy, you just need the files

If the VMDK itself is fine, the quickest way is to attach it to another virtual machine as an existing disk, read-only if possible, and copy the files out from inside that VM. On a Windows PC with VMware Workstation, Map Virtual Disk mounts a VMDK as a drive letter. On Linux, tools such as qemu-nbd or guestmount from libguestfs mount it directly, and qemu-img can convert it to a raw image or VHDX that other tools can open.

Always work on a copy, or at least open the disk read-only. Booting or mounting a disk with write access changes it, and if anything goes wrong there is no way back.

Case 2: the descriptor is missing or damaged

A common situation after a copy or a datastore problem: the -flat.vmdk is there, but the small descriptor is gone, so ESXi and other tools do not recognise the disk. The data is untouched. The descriptor can be recreated by creating a new virtual disk of exactly the same size and type, then editing its descriptor so that the extent line points to the existing -flat file. The new, empty data file is deleted.

The size must match to the sector. If you do not know it, the size of the -flat file in bytes divided by 512 gives the number of sectors the descriptor needs.

Case 3: a snapshot chain is broken

When a delta disk or its descriptor is lost, or the CIDs no longer match after a failed consolidation, the VM refuses to start with errors about the parent disk being modified. Do not run consolidation or delete snapshots before taking a copy of every file in the VM's folder: consolidation writes into the base disk, and if it fails halfway it can leave the chain worse than before.

If only the newest delta is damaged, the data up to the previous snapshot is still in the parent files, and the chain can be opened at that point. Fixing CIDs by hand works when you know exactly which file belongs where; when you do not, opening the chain with a tool that checks it first is safer.

Case 4: the VMDK is corrupted or partly encrypted

When the data file itself is damaged, mounting fails or shows an empty or unreadable drive. Because a -flat.vmdk is a plain image of the disk, the file system inside it (NTFS, ext4, XFS) can be found and read even when the partition table or the first part of the disk is destroyed. Files are recovered from the file system's own records, and where those are lost, by their content.

This is also how ransomware-encrypted VMDKs are recovered. ESXi ransomware usually encrypts large VMDK files only in parts, because encrypting hundreds of gigabytes completely takes too long. The guest file system and databases in the untouched parts can be rebuilt, even when the file has a new extension such as .akira or .lockbit.

Our AS VMware Recovery software does this on your own computer: its free edition opens VMDK files and snapshot chains, rebuilds missing descriptors, scans for lost partitions and file systems and previews every recoverable file before you buy a licence.

When the VMDK itself is gone

If the VMDK files were deleted from the datastore, or the datastore no longer mounts, the recovery happens one level lower, on the VMFS or vSAN storage. Stop writing to that datastore immediately: new virtual machines, snapshots or Storage vMotion can overwrite the space where the deleted disk still lies. Image the LUN or disks first, then recover from the image.

Questions and answers

How do I open a VMDK file without VMware?

On Linux, qemu-nbd or guestmount can mount it, and qemu-img can convert it to a raw image or VHDX. On Windows, recovery software that reads VMDK files directly can open it and copy files out without installing VMware.

Can I recover a -flat.vmdk without its descriptor file?

Yes. The data is all in the -flat file. A new descriptor of exactly the same size can be created and pointed at it, or recovery software can read the -flat file directly as a disk image.

Can files be recovered from a ransomware-encrypted VMDK?

Often. ESXi ransomware usually encrypts large VMDK files only in parts, and the guest file system and data in the untouched parts can be rebuilt, whatever the new extension is.

Should I consolidate snapshots before recovering?

Not before copying every file of the VM. Consolidation writes into the base disk, and a failed consolidation can damage the chain further.

VMware data recovery services →

Facing this problem? Contact us now.

We have already solved 656+ ransomware and data recovery cases: encrypted and corrupted SQL Server, Oracle and MySQL databases, Tally, Busy and Marg ERP data, Veeam backups, VMware and Hyper-V virtual machines, RAID and NAS. Send us the details and we tell you what we can recover.

  • ✓ Free assessment before you pay anything
  • ✓ No data, no charge
  • ✓ NDA on request

Email: info [at] asittech.com · Mon–Fri, 9:00–18:00 IST

Call 24/7Emergency