Sparewise

WSL is using too much disk space on Windows

Short answer: each WSL distribution lives in one virtual disk file, ext4.vhdx. It grows as you add files in Linux, but it does not shrink when you delete them, so Windows never gets that space back by itself.

Where the disk is

By hand

  1. Clean up inside Linux first (old build output, ~/.cache).
  2. Shut WSL down: wsl --shutdown
  3. Let the disk give space back by itself from now on: wsl --manage <distro> --set-sparse true (recent WSL versions). The older ways, Optimize-VHD or diskpart's compact vdisk, need administrator rights.

With Sparewise

Sparewise does this safely

Download for Windows

Free · No admin rights · No telemetry · Everything it moves can be put back