Wsl Distro Location | ^hot^

If you’ve installed WSL (Windows Subsystem for Linux) and started filling up your $HOME directory with projects, you might suddenly realize your C: drive is shrinking. By default, WSL stores its virtual hard disks ( .vhdx files) on your Windows drive.

Where is my WSL Distro Actually Stored? (And How to Move It)

# 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! 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:

C:\Users\JohnSmith\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx Method 1: Via PowerShell (Easiest) Open PowerShell as Administrator and run: If you’ve installed WSL (Windows Subsystem for Linux)

# 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: (And How to Move It) # In Windows

C:\Users\[YourUserName]\AppData\Local\Packages\[DistroPackageName]\LocalState\ext4.vhdx