WSL2 and Docker silently consume Windows C drive space and never auto-release it
Windows developers using WSL2 or Docker Desktop often face unexplained disk space loss because both tools store data in virtual disk files (ext4.vhdx or docker_data.vhdx) that grow automatically but never shrink on their own. Deleting containers, running docker system prune, or removing WSL projects does not reclaim space on the Windows C drive, as the freed gigabytes remain trapped inside the virtual disk file. A related Microsoft WSL GitHub issue has been open since 2019 and has accumulated over a thousand reactions, indicating the problem is widespread among developers. Users can manually reclaim space by fully shutting down WSL and Docker, then compressing the .vhdx file using either the Optimize-VHD PowerShell command (Windows Pro/Enterprise) or diskpart (Windows Home). Beyond virtual disks, dev machines also quietly accumulate space from forgotten node_modules folders, build caches, and IDE data that standard Windows storage tools do not clearly flag for cleanup.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in