Kleaner PRO

Professional care for Windows 7/10/11.

Made with care for performance.

Follow us
Products
  • Kleaner PRO
  • Store
  • Activation portal
  • What's new in Kleaner PRO
  • More products — coming soon
Resources
  • Features
  • FAQ
  • Compare tools
  • Knowledge Base
  • Blog
  • Download
  • Kleaner SafeCheck
  • Storage planner
Legal
  • License agreement
  • Terms of service
  • Privacy policy
  • Refund policy
[email protected]Telegram support @Vladimlrovlch
© 2026 Kleaner PRO · kleaner.pro. All rights reserved.
Payments
ЮMoneyVisaMastercardМИРPayPalWebMoneyUseGatewayBitcoinEthereumUSDT
Kleaner PRO
FeaturesSmart CarePricingFAQKnowledge BaseBlogDownload
Services▾
Kleaner SafeCheckLocal SHA-256 · VirusTotal report lookupStorage plannerFree Windows storage tool
Activate
FeaturesSmart CarePricingFAQKnowledge BaseBlogDownload
ServicesKleaner SafeCheck · SHA-256Storage planner
Activate
BuyBuy license
Blog →5 min read2024-08-20· Kleaner PRO Team

Docker Desktop and WSL2: Taming the Ever-Growing VHDX

You deleted half your images and Docker gave you back exactly nothing: the virtual disk on C: still sits at 80 GB. That's by design — dynamic VHDX files grow on demand and never shrink on their own, so the fix is a two-step routine: clean inside Docker first, compact the container second.

Where the gigabytes actually hide

Docker Desktop on WSL2 keeps everything — images, containers, volumes, build cache — in special WSL distros, each stored as a single dynamic VHDX file on C:. Every pull adds layers, every build adds cache, and deleting any of it only frees space inside the Linux filesystem: the host file stays at its high-water mark. Your own Ubuntu or Debian distro plays the same trick with its own ext4.vhdx, and none of this shows up in a "biggest folders" hunt, because to Windows it's all a few opaque files.

  • docker-desktop-data (older Docker) or docker_data.vhdx (newer): the main 30–80 GB culprit under %LOCALAPPDATA%\Docker\wsl — images, containers, volumes, build cache
  • docker-desktop: the smaller system distro that runs the Docker engine itself
  • Your own WSL2 distros: one ext4.vhdx each under %LOCALAPPDATA%\Packages\...\LocalState
  • Build cache: docker builder keeps intermediate layers even after you delete the final image
  • Dangling images and stopped containers: orphaned layers from interrupted builds and pulls
  • Anonymous volumes: created quietly per build by compose files, surviving even docker image prune

Clean inside first — shrinking a dirty disk is wasted work

Compacting a VHDX still full of dead images just produces a smaller file that grows right back, so the order of operations matters. Start inside: docker system df shows what images, containers, volumes and cache actually hold, and the numbers are usually a surprise. docker system prune -a removes unused images and stopped containers, --volumes adds orphaned volumes — make sure you're not deleting database data you actually wanted. docker builder prune then clears the build cache that repeated rebuilds love to bloat; only when docker system df reports a number you accept is it worth touching the host file.

Then shrink the disk: three supported ways

Run wsl --shutdown first, or the file is locked by running containers and distros. On recent WSL builds, wsl --manage <distro> --set-sparse true marks the VHDX sparse so Windows can reclaim free blocks; on older setups the reliable route is export and import — wsl --export to a .tar, wsl --unregister, wsl --import into a fresh folder — which rebuilds the file at the real data size. Docker Desktop can also move the whole disk image to another drive under Settings > Resources > Advanced, and it migrates the data for you — the honest fix when C: is simply too small for your work. And cap the growth while you're there: the same settings page has a disk-size limit, and a monthly docker system df habit keeps you under it.

Questions and Answers

Why is Docker Desktop taking so much disk space?

Docker stores every image, layer, volume and build-cache entry in a dynamic VHDX that grows on demand and never shrinks by itself. Run docker system df to see the breakdown, prune what you don't need, then compact or export/import the disk.

How do I shrink the WSL2 Docker VHDX file?

Run wsl --shutdown first, then set the disk sparse with wsl --manage <distro> --set-sparse true, or export the distro to a .tar, unregister it and import it back — the fresh VHDX matches your real data size.

Know what is included before you buy.

The one-time 30-minute trial covers core tools. PRO-labelled features stay locked until a paid license is activated.

Download for WindowsBuy license

Read next

What Is VHDX: Virtual Disks That Eat Real Space→WSL1 vs WSL2: Same Penguin, Two Very Different Storage Bills→Why Your C: Drive Keeps Filling Up No Matter What→12 Ways to Free Space on C: Without Deleting Anything Important→

Write to us: [email protected]

English
EnglishРусскийУкраїнськаDeutschEspañolFrançaisPortuguês (BR)PolskiItalianoTürkçe日本語简体中文