Before shrinking a WSL2 virtual disk, you need to ensure that WSL2 is not running.
You can check if it’s running with the command wsl.exe --list --verbose
in PowerShell:
PS C:\Users\valorin> wsl.exe --list --verbose
NAME STATE VERSION
var cover = document.createElement("div"); | |
let css = ` | |
position: fixed; | |
pointer-events: none; | |
top: 0; | |
left: 0; | |
width: 100vw; | |
height: 100vh; | |
background-color: white; | |
mix-blend-mode: difference; |
Over time, WSL2 distributions and Docker images can consume significant disk space. Even after deleting files, the allocated virtual disk (VHDX) does not automatically shrink. This guide explains how to manually reclaim disk space by optimizing the virtual disk.
On Windows 11, WSL2 distributions store their virtual disks in the following location: