C:\Users\JohnSmith\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx Method 1: Via PowerShell (Easiest) Open PowerShell as Administrator and run:
C:\Users\[YourUserName]\AppData\Local\Packages\[DistroPackageName]\LocalState\ext4.vhdx wsl distro location
Where is my WSL Distro Actually Stored? (And How to Move It) wsl distro location
Here is exactly where to find them and how to move them. For a distro installed from the Microsoft Store (like Ubuntu, Debian, or Kali), the default path is: wsl distro location
# In Windows PowerShell (Admin) Optimize-VHD -Path D:\wsl\Ubuntu\ext4.vhdx -Mode Full Now you can keep your C: drive breathing room while your Linux environment lives happily on a larger SSD or HDD. Have questions or another WSL tip? Drop a comment below!
# Find the block device df -h / wsl.exe --list --verbose
Get-ChildItem "C:\Users\$env:USERNAME\AppData\Local\Packages" -Filter "*ext4.vhdx" -Recurse -ErrorAction SilentlyContinue Inside your WSL distro, run: