# HG changeset patch # User Oleksandr Gavenko # Date 1707574169 -7200 # Node ID 6f1bb96dc0d2b514d54e8402fa1c92acadf63e4c # Parent eb3795b7211718ab4caa3450c9c228a3f28f930e Enabling trimming. diff -r eb3795b72117 -r 6f1bb96dc0d2 wsl.rst --- a/wsl.rst Thu Feb 08 16:28:59 2024 +0200 +++ b/wsl.rst Sat Feb 10 16:09:29 2024 +0200 @@ -176,3 +176,18 @@ [wsl2] kernel=C:\\Users\\\\vmlinux +Enabling trimming +================= + +:: + + wsl --manage $NAME --set-sparse true + wsl --manage $NAME --set-sparse false + +or in ``.wslconfig``:: + + [experimental] + sparseVhd=true + +https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/#automatic-disk-space-clean-up-set-sparse-vhd + Automatic disk space clean up (Set sparse VHD).