Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mcandre
Created November 18, 2021 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcandre/16e464f9c1e03624c3aa7a371bbb8d7d to your computer and use it in GitHub Desktop.
Save mcandre/16e464f9c1e03624c3aa7a371bbb8d7d to your computer and use it in GitHub Desktop.
Shrink WSL
  1. Backup any critical data.
  2. Launch an administrative PowerShell session.
  3. Change directory like cd "C:\Users\andrew\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState"
  4. Run optimize-vhd -Path ext4.vhdx -Mode full
  5. Wait a few minutes for the process to complete.
  6. Relaunch WSL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment