VMX vs VMDK: VMware File Roles, Structure, and Recovery — VMDK vs VMX and VMware VMX vs VMDK VMware Explained
In VMware, two files define every virtual machine: the VMX and the VMDK. The VMX file is a small text configuration file that stores the VM’s hardware settings — CPUs, memory, NICs, and disk mappings. The VMDK file is the virtual disk itself, containing the operating system, applications, and user data. Lose the VMX and the VM cannot start; lose the VMDK and the VM has no data to run. This article explains the differences between VMX and VMDK files, their roles in VMware environments, and how to recover them when they are deleted, corrupted, or locked.
What Is a VMDK File? The Virtual Disk Core of VMware VMs
VMDK File Definition and Purpose
The VMDK file is the virtual disk of a VMware VM. It stores the guest operating system, installed applications, and all user data. While the VMX defines how the VM runs, the VMDK defines what the VM runs. Without a valid VMDK, a VM can power on but has no usable storage or OS to boot from.
What a VMDK File Contains
A VMDK file includes:
- Guest OS installation (Windows, Linux, BSD, etc.)
- Application binaries and configuration files
- User data such as documents, databases, and logs
- Swap/paging files used by the guest OS
- Snapshot delta chains that track incremental changes to the base disk
- Metadata descriptors defining disk geometry, block size, and allocation type
VMDK File Format: Descriptor + Flat Disk
Every VMDK is composed of two parts:
- Descriptor file (.vmdk) — a small text file describing disk size, geometry, provisioning type (thin/thick), and references to the actual data file.
- Flat or sparse disk file — the large binary file that contains the VM’s data blocks.
When snapshots are taken, VMware creates additional delta VMDKs that chain back to the base disk, allowing rollback or point‑in‑time recovery.
VMDK File Naming and Location
VMDK files reside in the same VM directory as the VMX file:/vmfs/volumes/[datastore]/[VMname]/[VMname].vmdk
Large disks may split into multiple files, such as VMname-flat.vmdk or VMname-s001.vmdk. Sizes range from a few MB for test VMs to multiple TB for production workloads.
Operational Importance
- VMX vs VMDK: The VMX is the brain (configuration), while the VMDK is the body (data). Losing the VMX prevents startup; losing the VMDK destroys the VM’s content.
- Recovery priority: If both are lost, recovering the VMDK is usually more critical, since it contains irreplaceable user and application data. The VMX can often be rebuilt manually, but the VMDK must be restored from backup or specialized recovery tools.
What Is a VMDK File? The Virtual Hard Drive of a VMware VM
VMDK File Definition and Purpose
A VMDK (Virtual Machine Disk Format) file is the virtual hard drive of a VMware VM. It contains the operating system, application binaries, configuration files, and all user data — essentially everything that would reside on a physical disk. The VMDK is typically the largest file in a VM’s directory, sized to match the virtual disk allocation defined in the VMX. Without it, the VM has no storage to boot from or run workloads.
The Two‑File VMDK Structure: Descriptor and Flat
Every VMDK on ESXi consists of two paired files:
- VMname.vmdk — Descriptor file: A small, text‑based file that defines disk geometry, size, and provisioning type (thin, thick eager‑zeroed, thick lazy‑zeroed). It points to the backing flat file. This is where confusion often arises in the vmdk vs vmx file discussion: the descriptor
.vmdkis text‑based like a VMX file, but its role is disk metadata, not VM configuration. - VMname‑flat.vmdk — Flat file: A large binary file containing the raw disk data. This is where the VM’s OS, applications, and user data live. On ESXi, the flat file matches the size of the allocated virtual disk.
VMDK Provisioning Types
VMware supports three provisioning modes for VMDKs:
- Thin provisioning: Disk space is allocated on demand as data is written. Starts small and grows up to the defined maximum. Ideal for storage efficiency.
- Thick lazy‑zeroed: Full disk space is reserved at creation, but blocks are zeroed only when first written. Faster to create, moderate performance.
- Thick eager‑zeroed: Full disk space is reserved and zeroed at creation. Provides the best write performance but takes longest to provision. Required for VMware Fault Tolerance.
VMDK Variants: Snapshots, Split Disks, and RDMs
- Snapshot VMDKs (VMname‑000001.vmdk): Delta files created when a snapshot is taken. The base disk becomes read‑only, and all writes go to the delta. Multiple snapshots create chains of delta VMDKs.
- Split VMDKs: Disks divided into 2 GB chunks (
VMname‑s001.vmdk,VMname‑s002.vmdk). Common in VMware Workstation for file system compatibility; rare on ESXi unless imported. - RDM (Raw Device Mapping): A special VMDK descriptor that maps a SAN LUN directly to the VM, bypassing VMFS for near‑native performance. Used in advanced storage scenarios.
VMX vs VMDK: Head-to-Head File Comparison
📊 Comparison Table: VMX vs VMDK File
| Attribute | VMX File | VMDK File |
|---|---|---|
| Role | VM configuration | VM virtual hard drive |
| File format | Plain text (key-value pairs) | Binary (flat) + text (descriptor) |
| Typical size | A few kilobytes | Gigabytes to terabytes |
| Contains | Hardware settings, resource allocation, hardware version, network config, disk references | Operating system, application data, user files |
| Editable by text editor | Yes — with caution | Descriptor: yes. Flat file: no |
| Required to start VM | Yes — ESXi reads VMX at power-on | Yes — VM cannot run without disk data |
| Recoverable if deleted | Yes — can be recreated via New VM Wizard with existing VMDK | Yes — with VMFS recovery tools |
| Critical when missing | VM fails to register or start | VM starts but cannot access data |
| Platform | VMware ESXi, vSphere, Workstation, Fusion | VMware ESXi, vSphere, Workstation, Fusion, KVM (via conversion) |
Interdependence: VMX References VMDK, VMDK Requires VMX to Run
The VMX file contains the path reference to each VMDK attached to the VM. When ESXi initializes the VM, it reads the VMX to determine which VMDK to mount and on which virtual controller. If the VMX is missing, ESXi cannot register the VM — it disappears from inventory. If the VMDK reference is removed from the VMX, the VM will boot but the guest OS will throw a “disk not found” error because no virtual disk is attached. The two files are tightly coupled: the VMX provides the instructions, the VMDK provides the content, and neither can function fully without the other.
VMware VMX vs VMDK: Which File Is More Critical?
The VMware VMX vs VMDK distinction comes down to configuration versus data. The VMX is the operational blueprint, while the VMDK is the storage container. Losing the VMX means losing VM registration and configuration — disruptive, but recoverable. Administrators can rebuild a VMX by creating a new VM with the same settings, pointing it to the existing VMDK, and then restoring or editing the configuration. Losing the VMDK, however, means losing the VM’s operating system, applications, and user data. Unlike the VMX, the VMDK cannot be recreated; it must be recovered from backup or specialized recovery tools. In practice, the VMDK is the more critical file because it holds irreplaceable data, while the VMX is essential but replaceable.
VMware VMX vs VMDK VMware: The Complete VM Directory — All Supporting File Types
📊 Full VMware VM Directory: File Types Reference Table
| File Extension | Name | Role | Size | Critical? |
|---|---|---|---|---|
| .vmx | VM Configuration | Defines all VM hardware and settings | Kilobytes | Yes |
| -flat.vmdk | Flat Disk Data | Raw binary data of virtual hard drive | GB to TB | Yes |
| .vmdk | VMDK Descriptor | Disk geometry, provisioning type, pointer to flat file | Kilobytes | Yes |
| .nvram | BIOS/UEFI Settings | Stores firmware settings, boot order | ~8 KB | Regenerated at power-on if missing |
| .vmsd | Snapshot Metadata | Tracks snapshot hierarchy and names | Kilobytes | Yes (if snapshots exist) |
| .vmsn | Snapshot State | Stores full VM state at snapshot creation | Varies | Yes (for rollback) |
| .vmss | Suspended State | RAM contents of a suspended VM | Equals RAM | Yes (while suspended) |
| .vswp | VM Swap | Guest memory swap during host contention | Equals RAM | Deleted at power-off |
| .vmxf | Supplemental Config | Workstation team metadata; ESXi compatibility only | Kilobytes | No |
| .log / vmware.log | Activity Log | VM operational log; up to 6 retained | Small | No (deletable when off) |
| .lck | Lock File | Prevents concurrent VMX access | Tiny | Remove if stale after host crash |
| -000001.vmdk | Snapshot Delta | Captures disk changes since snapshot | Varies | Yes (if snapshots exist) |
| .ctk | Change Tracking | Tracks changed blocks for incremental backups | Varies | No (regenerated) |
What Happens When VMX or VMDK Files Are Lost, Corrupted, or Deleted
Corrupted VMX: Symptoms and Immediate Impact
A corrupted or missing VMX file causes the VM to disappear from vSphere inventory. The VM cannot register or power on because ESXi has no configuration blueprint to follow. Typical error messages include:
- “The file specified is not a virtual disk”
- “Unable to access file”
Despite these errors, the VMDK and all user data remain intact on the datastore. The damage is limited to configuration loss. Administrators can often rebuild the VMX by creating a new VM with identical settings and pointing it to the existing VMDK.
Corrupted or Deleted VMDK: The Data Loss Scenario
A missing or corrupted VMDK flat file is a true data loss event. Even if the VMX is intact, the VM cannot boot because the guest OS has no disk to load. Common causes include:
- Accidental deletion from the datastore browser
- Failed storage migration or vMotion
- Snapshot chain corruption (parent VMDK modified after a child delta was created)
- VMFS datastore going offline due to storage controller failure
- LUN reassignment breaking datastore paths
In these cases, recovery requires restoring the VMDK from backup or using specialized VMFS recovery tools.
Snapshot Chain Corruption: The VMX and VMDK Intersection
One of the most disruptive scenarios occurs at the VMX–VMDK boundary during snapshot operations. When creating a new VM and selecting an existing VMDK, the wizard only presents the base VMDK — not the snapshot delta files. If a VM with active snapshots has its VMX rebuilt without accounting for the full snapshot chain, the delta VMDKs become disconnected.
The result is the error:
“The parent virtual disk has been modified since the child was created.”
Here, the base VMDK appears intact, but the snapshot chain is broken. All data written since the last base snapshot becomes inaccessible unless targeted recovery is performed. This highlights how VMX and VMDK files are interdependent: the VMX must correctly reference the snapshot hierarchy, and the VMDKs must remain consistent to preserve data integrity.
Recovering VMX and VMDK Files with DiskInternals VMFS Recovery™
Why Standard Recovery Tools Fail on VMFS
VMFS (VMware File System) is VMware’s proprietary clustered filesystem. Unlike NTFS, ext4, or FAT32, VMFS uses unique metadata structures to manage multi‑host access and virtual disk chains. Standard recovery tools cannot parse VMFS layouts, interpret VMDK descriptor files, or reconstruct snapshot hierarchies. As a result, attempting recovery with generic tools often produces incomplete or unusable files. Effective recovery of VMX or VMDK files from a damaged or offline VMFS datastore requires a solution purpose‑built for VMware environments.
DiskInternals VMFS Recovery™: Purpose‑Built for VMware File Recovery
DiskInternals VMFS Recovery™ is designed specifically to handle VMware file recovery scenarios. Its capabilities include:
- Mounting VMDK files without ESXi — critical when the hypervisor is unavailable and only raw storage remains.
- Recovering deleted VMX configuration files — restoring VM registration and startup capability.
- Reconstructing VMFS volumes with damaged metadata — rebuilding access paths to VM files.
- Supporting both local and remote recovery — works with locally attached VMware disks or remote ESXi servers via IP and credentials.
Workflow:
- 1. Connect to the VMFS volume.
- 2. Run a full scan to detect recoverable VMX, VMDK, and supporting files.
- 3. Browse the results and preview file integrity.
- 4. Extract recovered files to a safe destination.
- 5. Re‑register the VM in vSphere using the restored VMX and VMDK.
When to Use DiskInternals VMFS Recovery™
VMFS Recovery is applicable in scenarios such as:
- Accidental deletion of a VMDK from the datastore browser.
- VMFS volume going offline after storage controller failure or LUN reassignment.
- ESXi host crash leaving stale lock files that block VM startup.
- VMX corruption or deletion causing a VM to vanish from inventory.
- Snapshot chain breakage making delta VMDKs inaccessible.
- Failed migration between ESXi versions or from ESXi to KVM leaving orphaned VMDK files.
In all these cases, the flat VMDK data typically survives on disk. The challenge is accessing it — and the path to recovery is a tool that speaks VMFS natively.
Ready to get your data back?
To start recovering your data, documents, databases, images, videos, and other files, press the FREE DOWNLOAD button below to get the latest version of DiskInternals VMFS Recovery® and begin the step-by-step recovery process. You can preview all recovered files absolutely for FREE. To check the current prices, please press the Get Prices button. If you need any assistance, please feel free to contact Technical Support. The team is here to help you get your data back!
Practical Administration: Working with VMX and VMDK Files
Rebuilding a Lost VMX File Without Data Loss
Step‑by‑step process:
- 1. Remove the damaged VM from vCenter inventory (important: do not delete files from datastore).
- 2. Launch the New Virtual Machine Wizard and select Use an existing virtual disk.
- 3. Point to the intact VMDK descriptor file to attach the existing virtual disk.
- 4. Reconfigure hardware settings to match the original VM — CPU, memory, NICs, hardware version.
- 5. Complete the wizard; ESXi generates a new VMX file automatically.
- 6. Register the VM and verify it powers on correctly.
Throughout this process, the VMDK data remains untouched — only the VMX is rebuilt.
Editing a VMX File Safely: Rules and Best Practices
- Always power off the VM before editing the VMX directly.
- Make a backup copy of the VMX before any manual change.
- Edit only parameters you fully understand — incorrect entries can prevent VM registration.
- After editing, either re‑add the VM to inventory or respond to the Reload VM Configuration prompt if ESXi detects changes.
- Automate VMX backups: a daily compressed archive of all VMX files across an ESXi host takes seconds and provides instant recovery for configuration loss.
Converting and Migrating VMDK Files
Use VMware Converter or vmkfstools (ESXi CLI) to:
- Convert between thin and thick provisioning.
- Upgrade disk versions for hardware compatibility.
- Export to OVA/OVF for cross‑platform migration.
For KVM environments, use qemu‑img convert to import VMware VMDKs.
Always verify the descriptor file after migration — ensure path references and provisioning type match the new environment.
A mismatched descriptor is a common cause of “Not a virtual disk” errors after migration.
FAQ
What is the difference between a VMX and a VMDK file?
A VMX file is the configuration file of a VMware virtual machine, storing hardware settings like CPU, memory, NICs, and disk mappings. A VMDK file is the virtual disk, containing the operating system, applications, and user data. The VMX is small, text‑based, and editable, while the VMDK is large, binary, and represents the VM’s storage. Losing a VMX prevents the VM from registering or starting, but the data remains intact; losing a VMDK means actual data loss. In short, the VMX is the blueprint, and the VMDK is the content.Can a VM run without its VMX file?
No, a VM cannot run without its VMX file. The VMX is the configuration file that tells ESXi or Workstation how to allocate CPU, memory, network adapters, and which VMDK disks to attach. Without it, the hypervisor has no blueprint to start the VM, so it will not appear in inventory or be able to power on. The VMDK may still exist with all the data, but it cannot be used until a valid VMX points to it. In practice, administrators rebuild the VMX by creating a new VM and attaching the existing VMDK.Can a VM run without its VMDK file?
A VM can technically register and power on without a VMDK file, but it will not have a usable operating system or storage to boot from. In this state, the VM behaves like a machine with no hard drive attached. The guest OS will immediately throw disk errors or fail to start because there is no virtual disk mapped. Administrators sometimes create VMs without VMDKs for testing, ISO boot, or attaching external storage later. For normal workloads, however, a VM requires at least one valid VMDK to function properly.Can I edit a VMX file while the VM is running?
No, you should not edit a VMX file while the VM is running. The VMX is only read by ESXi at power‑on, so changes made mid‑operation are not applied until the VM restarts. Editing it live can trigger a “Reload VM Configuration” prompt, which disrupts production workloads. The safe practice is to power off the VM, back up the VMX, then make changes. This ensures ESXi reads the updated configuration cleanly at the next boot.How do I recover a deleted VMDK file from a VMFS datastore?
To recover a deleted VMDK file from a VMFS datastore, you need a VMware‑aware recovery tool because standard file recovery utilities cannot parse VMFS. The most reliable option is DiskInternals VMFS Recovery™, which can scan VMFS volumes, reconstruct metadata, and restore deleted VMDK files.What happens to the VMDK when I take a VMware snapshot?
When you take a VMware snapshot, the base VMDK becomes read‑only and a new delta VMDK file is created to capture all subsequent changes. This allows you to preserve the VM’s state at a specific point in time while continuing to run and modify the system.How do I rebuild a VMX file without losing VMDK data?
To rebuild a VMX file without losing VMDK data, first remove the damaged VM from vCenter inventory but do not delete its files from the datastore. Next, create a new VM using the New Virtual Machine Wizard and select “Use an existing virtual disk”, pointing to the intact VMDK descriptor file. Configure the VM’s hardware settings (CPU, memory, NICs, hardware version) to match the original. Once the wizard completes, ESXi generates a fresh VMX file that references the existing VMDK. Finally, register the VM and verify it powers on — the VMDK data remains untouched throughout the process.
