Understanding disk space using WSL2

Complete novice here, so please tell me if this should be posted in a different forum. If the answer is already available online, I haven't been able to find it in my searches.

I set up Ubuntu 20.04 using WSL2 per the official Windows instructions. I did this because I needed to build and run a Docker container, and the instructions recommended following the WSL2 link.

After doing this, I see in the Ubuntu command prompt that the allotted disk space is 250 GB. I don't see this 250 GB allocation reflected anywhere in Windows. It previously said I had 317 GB free, and it still says that after a couple restarts. Is Windows secretly hiding 250 GB from me now, because it has been allocated to WSL? Do I really only have 67 GB free? Thank you


The virtual disk that WSL2 uses (ext4.vhdx) is what is known as "sparse". In other words, it appears to the underlying OS as its maximum available size, but it only takes up as much space on the host (Windows) disk as it currently needs.

You can find this file in Windows in %userprofile%\AppData\Local\Packages\Canonical..\LocalState\ext4.vhdx.

Note that space, once consumed, is not automatically released. For instance, creating a 1GB file in WSL/Ubuntu will grow the size of the virtual disk image by 1GB. Deleting that file, though, will not recover the space in Windows (but will in Ubuntu).

There are ways to manually shrink it if needed to reclaim space on the Windows drive.