In short
A Hyper-V host is a Windows server, usually joined to the domain. Ransomware running on it encrypts VHDX, AVHDX and configuration files like any other file, and often only partially. Because VHDX files have a well-defined structure (header, region table, BAT, metadata, payload blocks), partially encrypted virtual disks can often be at least partly reconstructed, provided nobody has merged, compacted or repaired anything since the attack.
The situation in three sentences
On a Hyper-V host, ransomware encrypts the virtual machine files – VHDX, AVHDX, configuration – just like any other file on a Windows server. Whether the data comes back depends less on the ransomware brand than on which parts of the files were encrypted and what happened to them afterwards. Most avoidable data loss happens in the first few hours: merged checkpoints, "repaired" volumes and reinstalled hosts.
This page covers data recovery on Hyper-V. For an overview across all systems, see ransomware data recovery. If the attack is still in progress, start with ransomware emergency.
Why Hyper-V is hit differently from ESXi
Hyper-V and VMware ESXi are often lumped together, but for data recovery the differences matter. Attack paths and hardening for ESXi are covered in ransomware on VMware ESXi; this page focuses on what is different about Hyper-V.
The host is a Windows server
ESXi ships its own minimal hypervisor OS, and attackers need dedicated Linux encryptors for it. A Hyper-V host, by contrast, is a full Windows Server installation. Any Windows ransomware with administrator rights runs there. That is convenient for attackers: the same encryptor that hits the file servers also hits the VM files on the host.
CISA explicitly lists Hyper-V, alongside VMware ESXi, among the hypervisors historically targeted by the Akira group.
Domain membership makes AD the master key
Many Hyper-V hosts – and practically every failover cluster – are domain members. Microsoft documents that the Domain Admins group is, by default, a member of the local Administrators group on every computer that joins the domain.
Different file systems, different files
Instead of VMFS and VMDK, you are dealing with NTFS or ReFS and VHDX:
| File | Contents | Default location per Microsoft |
|---|---|---|
.vhdx | virtual hard disk | [3]">…\Hyper-V\Virtual Hard Disks |
.avhdx | differencing disk of a checkpoint | [3]">same as VHDX |
.vmcx | VM configuration (binary) | [3]">…\Hyper-V\Virtual Machines |
.vmrs, .vmgs | runtime and guest state (binary) | [3]">…\Hyper-V\Virtual Machines |
In practice, VM files rarely sit in the default location; they live on dedicated data volumes or Cluster Shared Volumes.
Cluster Shared Volumes: one volume, many hosts
In a Hyper-V cluster, VHDX files usually sit on Cluster Shared Volumes (CSV). Several nodes have simultaneous read-write access to the same LUN, formatted as NTFS or ReFS and presented on every node under C:\ClusterStorage.
Encryption on the host or inside the guest
Two basic patterns lead to entirely different recovery paths:
- Host-side: The ransomware runs on the Hyper-V host and encrypts the VHDX containers themselves. VMs no longer start, and Hyper-V reports damaged or unrecognised files.
- Guest-side: The ransomware runs inside one or more VMs. The VHDX file is formally intact and the VM boots, but the files inside the guest are encrypted. Recovery is then a question of the guest file system, not the VHDX format.
Often both happen: first encryption inside the guests, then on the host.
Typical damage patterns
| Damage pattern | How to recognise it | First assessment |
|---|---|---|
| VHDX fully encrypted | New extension, no recognisable structures anywhere in the file | Very limited without a key; check for decryptors, look for older copies |
| VHDX partially or intermittently encrypted | Encrypted sections alternate with readable data | Often good starting points for reconstruction |
| Only the beginning of the file hit | Header region unreadable, rest of the file shows structures | Frequently recoverable, see below |
| AVHDX chain broken | VM reports a missing or mismatched parent disk | Chain must be rebuilt on copies |
| Only VM configuration encrypted | .vmcx/.vmrs unreadable, VHDX files intact | Usually the best case: recreate the VM with the existing disks |
| CSV or volume damaged | Volume will not mount, shows as RAW, errors in Failover Cluster Manager | File system reconstruction comes first |
| Replica, checkpoints, backups deleted | Recovery points missing, backup repository empty or encrypted | Search for deleted regions at storage level |
| Guest-side encryption | VM boots, files inside the guest encrypted | Analyse the guest file system, check older checkpoints |
Partial encryption is not an edge case. CISA describes Akira as encrypting fully or partially depending on file type and size, with a parameter that sets the percentage.
First steps after the attack
Order matters. Keep it short:
- Isolate, don't clean up. Disconnect hosts and clusters from the rest of the network, especially from user networks and the internet.
[13] Whether to power down is a call for incident response: shutting down stops the encryption, but destroys evidence held in memory. - Disconnect backup systems immediately. Take backup servers and repositories off the production network and check whether they are affected. According to CISA, Akira has exploited vulnerabilities in Veeam Backup & Replication for initial access.
[9] For the backup side, see Veeam after ransomware. - Document the state. List VMs with host, path and status; file extensions; ransom notes; screenshots from Hyper-V Manager and Failover Cluster Manager.
- Take copies before anything is repaired. Sector-level images of the drives or LUNs – at the very least, copies of all VHDX, AVHDX, VMCX and VMRS files on separate storage. From then on, only work on copies.
- Treat credentials as compromised. With domain-joined hosts, that includes the domain itself, which is a job for incident response.
What not to do now
- Do not delete, apply or merge checkpoints. Checkpoints are stored as AVHDX files next to the VHDX. Deleting a checkpoint makes Hyper-V merge the AVHDX into the VHDX and then delete the AVHDX.
[2] With encrypted files, that writes encrypted content into the parent disk. Microsoft also states that AVHDX files should never be deleted directly. [2] - No Edit Disk, no compact, no merge.
Optimize-VHDreclaims unused blocks and rearranges the remaining ones.[11] What looks "unused" to the tool may be exactly the region you need on a damaged VHDX. - Do not attach original VHDX files with write access. Per the specification, opening a VHDX for writing updates its headers before any other part of the file is changed, and a pending log is replayed on open.
[1] Even double-clicking the file in Explorer can write to it. - No chkdsk on CSV or data volumes. chkdsk with
/for/rfixes errors by changing the volume.[12] On ReFS, the file system itself removes corrupt data from the namespace when no alternate copy exists. [5] Images first, then analysis. - Do not boot VMs from encrypted disks. A boot attempt writes to the header, the log and – if the guest comes up – the guest file system.
- Do not reinstall the host over the data volumes. Reinstalling or reformatting data and CSV volumes overwrites file system metadata and free space where originals may still sit.
- No third-party recovery scripts on originals. A tool written for one damage pattern can do harm with another.
How a VHDX is built – and why it matters for recovery
VHDX is an openly specified format.
Header section
The first 1 MB of a VHDX is the header section. It holds five 64 KB items: a file type identifier (signature "vhdxfile"), two headers at 64 KB and 128 KB, and two copies of the region table at 192 KB and 256 KB.
Region table, BAT and metadata
The region table points to the block allocation table (BAT) and the metadata region.
Log
Metadata changes go through a log implemented as a ring buffer. After a power failure, it is replayed on the next open; payload data explicitly does not go through the log.
Payload blocks
Apart from the header section, every structure can sit anywhere in the file on a 1 MB boundary.
What this means in practice
- Only the start of the file is encrypted: The structure signatures ("head", "regi", "metadata") and the location of the BAT and payload can often be found in the unencrypted remainder. Header and region table are then rebuilt, and the virtual disk becomes readable again.
- BAT encrypted, payload intact: Often solvable for fixed VHDX files. For dynamic VHDX files, blocks have to be put back in order using guest file system structures. Laborious, but not hopeless.
- Intermittent encryption: The encrypted sections are gone. The guest file system (usually NTFS, ext4 or XFS for Linux guests) is reconstructed around the gaps. Files that sit entirely in unencrypted regions can often be recovered in full.
- Databases inside the guest: SQL Server or Exchange databases are made up of pages. If many pages sit in unencrypted regions, tables can be partly extracted. More on this: databases after ransomware.
AVHDX chains
An AVHDX is a differencing disk: it only contains changed blocks and points to its parent.
Damage pattern and reconstruction path
| Starting point | Reconstruction path | Limits |
|---|---|---|
Only .vmcx/.vmrs encrypted | Recreate the VM with the existing VHDX files – on copies and only in a cleaned environment | Settings and runtime state are lost |
| VHDX header section encrypted | Rebuild header and region table from surviving structures | Only works if BAT and metadata are intact |
| BAT encrypted | Fixed VHDX: read payload directly; dynamic VHDX: rebuild block mapping via the guest file system | Laborious for dynamic disks, gaps possible |
| Intermittently encrypted | Reconstruct the guest file system around encrypted sections | Files inside encrypted sections are missing |
| AVHDX chain broken | Relink the chain on copies, analyse older states | Most recent changes may be lost |
| VHDX fully encrypted | Check for decryptors, search for deleted older versions and backup remnants at volume level | Usually unrecoverable without a key or older copy |
| CSV/volume damaged | Image the LUN, reconstruct NTFS or ReFS metadata, then analyse the VHDX | Overwritten regions are lost |
| Encrypted inside the guest | Analyse the guest file system, check shadow copies and older checkpoints | Depends on family and behaviour inside the guest |
To find out whether a decryptor exists for the specific family, see ransomware decryption. The basics of RAID, SAN and file systems underneath the VMs are explained in ransomware on servers, NAS, RAID and VMware.
Putting checkpoints, Replica and backups in perspective
Checkpoints are not backups. Microsoft points out that a standard checkpoint is not a full backup.
Hyper-V Replica keeps an offline copy of the VM on a second host, synchronises asynchronously every 30 seconds, 5 or 15 minutes, and can retain up to 24 hourly recovery points.
Backups of whole VMs must include .vmcx, .vmgs and .vmrs alongside the disks.
Which route fits your situation?
Hyper-V, Proxmox or ESXi?
If you run several platforms or plan to migrate after the incident, here are the counterparts:
- Proxmox after ransomware – qcow2, ZFS and LVM-thin instead of VHDX and NTFS/ReFS
- Ransomware on VMware ESXi – attack paths, immediate actions and hardening for vSphere
- Veeam backups after ransomware – when the backups of your Hyper-V VMs are affected too
Migrating straight after an attack is no substitute for cleaning up: as long as the entry point is unknown, the new platform is just as exposed as the old one.
Data recovery and incident response
On Hyper-V, the two tasks are tightly intertwined. Because the host belongs to the domain, incident response decides when hosts, clusters and AD can be trusted again. Data recovery works in parallel on images of the volumes and VHDX files. Images taken early serve both sides; see forensic evidence preservation for guidance.
DATA REVERSE reconstructs virtual systems, including VHD, VHDX and AVHDX files;
Data recovery by system
- NAS Encrypted by Ransomware: Data Recovery for NAS Systems
- QNAP NAS Encrypted by Ransomware: Data Recovery and First Steps
- Synology NAS Encrypted by Ransomware: Data Recovery and First Steps
- Veeam Backups Encrypted or Deleted by Ransomware: What Can Still Be Recovered
- Proxmox VE after Ransomware: Recovering VMs, ZFS and Backups
- Recovering SQL Server, Exchange & Databases After Ransomware
- DATEV Data Encrypted by Ransomware: Recovery and First Steps
- Ransomware on VMware ESXi: Attack Paths, First Response and Recovery
- Ransomware on Servers, NAS, RAID or VMware: What Can Be Recovered?
Frequently asked questions
Are encrypted VHDX files lost for good?
Not necessarily. Many ransomware families only encrypt parts of large files, such as the beginning or individual sections. If payload blocks of a VHDX remain unencrypted, the guest file system, databases and individual files can often be fully or partly reconstructed. With complete encryption and no key, the chances are much lower.
Can I delete or merge checkpoints after the attack?
No. When a checkpoint is deleted, Hyper-V merges the AVHDX file into its parent VHDX, writing to the parent. If either file is encrypted or damaged, this can overwrite recoverable regions. Leave checkpoints alone until copies have been secured.
Can I just mount an encrypted VHDX to see what is still readable?
Not the original. According to the VHDX specification, opening a file for write access updates its headers first, and a pending log may be replayed. Checks belong on a copy that is attached read-only.
Does Hyper-V Replica help after a ransomware attack?
Sometimes. Replica keeps an offline copy of the VM on a second host and can retain up to 24 hourly recovery points. Changes inside the VM, including encryption in the guest, are replicated like any other write, though. If the replica host is in the same domain, it may also have been compromised.
How is this different from an attack on VMware ESXi?
ESXi is a dedicated hypervisor OS with VMFS datastores and requires its own Linux-based encryptors. A Hyper-V host is a Windows server, so ordinary Windows ransomware with administrator rights is enough to encrypt VHDX files on NTFS, ReFS or CSV volumes. Recovery therefore works on different structures.
Should I run chkdsk on the Cluster Shared Volume?
Not before imaging it. chkdsk with repair switches changes file system metadata and can drop references to damaged regions. On a volume holding encrypted VHDX files, create an image first and only ever repair copies.
When should I involve DATA REVERSE?
When VHDX or AVHDX files are encrypted and there is no clean backup, when backups or replica copies are affected too, or when the underlying volume, RAID or SAN is damaged. The process starts with an analysis of images before any reconstruction path is chosen.
Related ransomware profiles
- Akira
.akira - Lockbit 3.0
.lockbit - BlackBasta
.basta
Read next
Sources and further reading
- [1]Microsoft Open Specifications – [MS-VHDX]: Virtual Hard Disk v2 (VHDX) File Format learn.microsoft.com
- [2]Microsoft Learn – Hyper-V: Using checkpoints learn.microsoft.com
- [3]Microsoft Learn – Upgrade virtual machine version in Hyper-V (VM file types) learn.microsoft.com
- [4]Microsoft Learn – Cluster Shared Volumes overview learn.microsoft.com
- [5]Microsoft Learn – Resilient File System (ReFS) overview learn.microsoft.com
- [6]Microsoft Learn – Hyper-V Replica overview learn.microsoft.com
- [7]Microsoft Learn – Hyper-V Backup Approaches learn.microsoft.com
- [8]Microsoft Learn – Active Directory Security Groups learn.microsoft.com
- [9]CISA – AA24-109A: #StopRansomware: Akira Ransomware cisa.gov
- [10]Huntress – Hardening the Hypervisor: Practical Defenses Against Ransomware Targeting ESXi huntress.com
- [11]Microsoft Learn – Optimize-VHD (Hyper-V PowerShell) learn.microsoft.com
- [12]Microsoft Learn – chkdsk learn.microsoft.com
- [13]CISA – #StopRansomware Guide cisa.gov
- [14]DATA REVERSE – Data recovery for virtual systems (in German) datareverse-datenrettung.de