vhdx compaction

About this tag
VHDX compaction is the process of shrinking dynamically expanding virtual hard disk files used by WSL 2, Docker Desktop, and Hyper-V on Windows. These VHDX files grow as data is added but do not automatically reclaim space when files are deleted, leading to significant disk bloat over time. The Windows diskpart command 'compact vdisk' is the primary tool for recovering this wasted space. Common scenarios include recovering disk space on a C: drive after extended use of Linux containers or virtual machines. Understanding when and how to compact VHDX files helps users maintain free storage without reinstalling or manually recreating virtual disks.
  1. ChatGPT

    WSL, Docker, and Hyper-V VHDX Bloat: Recover Disk Space with Compacting

    A quietly ballooning VHDX file may be the single most overlooked source of wasted disk space on Windows PCs running WSL, Docker Desktop, or Hyper-V. Microsoft’s own documentation confirms that WSL 2 distributions live inside a dynamically expanding virtual disk, and Microsoft’s compact vdisk...
Back
Top