Hyper-V After Ransomware: Recovering Encrypted VHDX Files and VMs

Ransomware Reverse Editorial TeamLast technical review:

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.[9] Researchers at Huntress also report attackers misusing Hyper-V management utilities to change VM settings and undermine security features.[10]

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.[8] Whoever controls Active Directory is therefore an administrator on every domain-joined Hyper-V host, no Hyper-V vulnerability required. How attackers take over AD and how to win it back is covered in ransomware and Active Directory.

Different file systems, different files

Instead of VMFS and VMDK, you are dealing with NTFS or ReFS and VHDX:

FileContentsDefault location per Microsoft[3]
.vhdxvirtual hard disk[3]">…\Hyper-V\Virtual Hard Disks
.avhdxdifferencing disk of a checkpoint[3]">same as VHDX
.vmcxVM configuration (binary)[3]">…\Hyper-V\Virtual Machines
.vmrs, .vmgsruntime 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.[4] For ransomware, this means a single compromised node can reach every VM on the CSV – including those currently running on other nodes.

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 patternHow to recognise itFirst assessment
VHDX fully encryptedNew extension, no recognisable structures anywhere in the fileVery limited without a key; check for decryptors, look for older copies
VHDX partially or intermittently encryptedEncrypted sections alternate with readable dataOften good starting points for reconstruction
Only the beginning of the file hitHeader region unreadable, rest of the file shows structuresFrequently recoverable, see below
AVHDX chain brokenVM reports a missing or mismatched parent diskChain must be rebuilt on copies
Only VM configuration encrypted.vmcx/.vmrs unreadable, VHDX files intactUsually the best case: recreate the VM with the existing disks
CSV or volume damagedVolume will not mount, shows as RAW, errors in Failover Cluster ManagerFile system reconstruction comes first
Replica, checkpoints, backups deletedRecovery points missing, backup repository empty or encryptedSearch for deleted regions at storage level
Guest-side encryptionVM boots, files inside the guest encryptedAnalyse 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.[9] With files of tens or hundreds of gigabytes, much of the payload often stays untouched.

Not every file is fully encryptedFully encrypted: Content cannot be rebuilt without the key – backup or decryptor needed. File header only: Content survives; the header can often be rebuilt. Intermittent (every n-th block): Large files such as VMDKs or databases are often partly usable. Interrupted: The unencrypted remainder can be used directly. encryptednot encryptedFully encryptedContent cannot be rebuilt without thekey – backup or decryptor neededFile header onlyContent survives; the header can oftenbe rebuiltIntermittent (every n-thblock)Large files such as VMDKs or databasesare often partly usableInterruptedThe unencrypted remainder can be useddirectly © 2026 ransomware-reverse.de
Not every file is fully encryptedFully encrypted: Content cannot be rebuilt without the key – backup or decryptor needed. File header only: Content survives; the header can often be rebuilt. Intermittent (every n-th block): Large files such as VMDKs or databases are often partly usable. Interrupted: The unencrypted remainder can be used directly. encryptednot encryptedFully encryptedContent cannot be rebuilt without the key – backup ordecryptor neededFile header onlyContent survives; the header can often be rebuiltIntermittent (every n-th block)Large files such as VMDKs or databases are often partlyusableInterruptedThe unencrypted remainder can be used directly © 2026 ransomware-reverse.de
Not every file is fully encrypted. Many ransomware families encrypt only parts of large files to save time. Which pattern applies depends on family and configuration and only shows in an analysis of disk images.

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-VHD reclaims 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 /f or /r fixes 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.[1] Its structure is the reason partially encrypted virtual disks can often be reconstructed.

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.[1] Only one header is active at a time, determined by sequence number and checksum.[1]

Region table, BAT and metadata

The region table points to the block allocation table (BAT) and the metadata region.[1] The BAT is an array of 64-bit entries recording, for every block of the virtual disk, whether it exists and where in the file it sits.[1] Block size ranges from 1 MB to 256 MB.[1] The metadata region holds the disk size, sector sizes and, for differencing disks, the reference to the parent file, among other items.[1]

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.[1]

Payload blocks

Apart from the header section, every structure can sit anywhere in the file on a 1 MB boundary.[1] In a fixed VHDX, payload is usually laid out contiguously. In a dynamic VHDX, the virtual disk is spread across the file in blocks, and only the BAT knows the correct order.

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.[1] On open, Hyper-V checks that an identifier of the parent (its DataWriteGuid) matches the stored reference.[1] If the parent VHDX is modified – by mounting, a boot attempt or a merge – that link can break. For recovery, a chain is actually an advantage: an older AVHDX or the base VHDX may be unencrypted if the ransomware only hit the most recent file.

Damage pattern and reconstruction path

Starting pointReconstruction pathLimits
Only .vmcx/.vmrs encryptedRecreate the VM with the existing VHDX files – on copies and only in a cleaned environmentSettings and runtime state are lost
VHDX header section encryptedRebuild header and region table from surviving structuresOnly works if BAT and metadata are intact
BAT encryptedFixed VHDX: read payload directly; dynamic VHDX: rebuild block mapping via the guest file systemLaborious for dynamic disks, gaps possible
Intermittently encryptedReconstruct the guest file system around encrypted sectionsFiles inside encrypted sections are missing
AVHDX chain brokenRelink the chain on copies, analyse older statesMost recent changes may be lost
VHDX fully encryptedCheck for decryptors, search for deleted older versions and backup remnants at volume levelUsually unrecoverable without a key or older copy
CSV/volume damagedImage the LUN, reconstruct NTFS or ReFS metadata, then analyse the VHDXOverwritten regions are lost
Encrypted inside the guestAnalyse the guest file system, check shadow copies and older checkpointsDepends 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.[2] Checkpoints sit on the same volume and are just as reachable for an attacker with admin rights as the VHDX itself.

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.[6] Encryption inside the guest is replicated like any other write. What helps then are recovery points from before the attack. With domain-joined hosts, Replica uses Kerberos authentication;[6] a replica host in the same domain is within reach of attackers holding domain rights.

Backups of whole VMs must include .vmcx, .vmgs and .vmrs alongside the disks.[7] Whether backups are clean and complete is covered in backup recovery after ransomware; how to make them tamper-proof is explained in immutable backup.

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:

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;[14] details are on the page DATA REVERSE data recovery for virtual systems (in German) (external link). If the volume itself is damaged, DATA REVERSE file system recovery (in German) (external link) comes in; for hardware or RAID damage on the host, see DATA REVERSE server data recovery (in German) (external link).

Data recovery by system

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

Read next

Sources and further reading

  1. [1]Microsoft Open Specifications – [MS-VHDX]: Virtual Hard Disk v2 (VHDX) File Format learn.microsoft.com
  2. [2]Microsoft Learn – Hyper-V: Using checkpoints learn.microsoft.com
  3. [3]Microsoft Learn – Upgrade virtual machine version in Hyper-V (VM file types) learn.microsoft.com
  4. [4]Microsoft Learn – Cluster Shared Volumes overview learn.microsoft.com
  5. [5]Microsoft Learn – Resilient File System (ReFS) overview learn.microsoft.com
  6. [6]Microsoft Learn – Hyper-V Replica overview learn.microsoft.com
  7. [7]Microsoft Learn – Hyper-V Backup Approaches learn.microsoft.com
  8. [8]Microsoft Learn – Active Directory Security Groups learn.microsoft.com
  9. [9]CISA – AA24-109A: #StopRansomware: Akira Ransomware cisa.gov
  10. [10]Huntress – Hardening the Hypervisor: Practical Defenses Against Ransomware Targeting ESXi huntress.com
  11. [11]Microsoft Learn – Optimize-VHD (Hyper-V PowerShell) learn.microsoft.com
  12. [12]Microsoft Learn – chkdsk learn.microsoft.com
  13. [13]CISA – #StopRansomware Guide cisa.gov
  14. [14]DATA REVERSE – Data recovery for virtual systems (in German) datareverse-datenrettung.de