Enabling trimming.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2024 16:09:29 +0200
changeset 2580 6f1bb96dc0d2
parent 2579 eb3795b72117
child 2581 f6613ff608d4
Enabling trimming.
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\\<USER>\\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).