Timeline
Timeline
2025-12-29
init
This article introduces specific methods for compressing the virtual disk space of WSL distributions, detailing the steps to find the distribution's disk file path and use the diskpart tool to perform disk compression operations after closing WSL.
.vhdxDisk path of the file
Replace distribution-name with the one seen viawsl -l -vthe name of the distribution seen
1 | wsl -l -v |
Compress the disk
Close WSL before compressing
1 | wsl --shutdown |
Then enter diskpart
1 | diskpart |
A new command line window will pop up. Enter the following content in sequence, replacing the value of file with the path obtained in the previous step
1 | # Select the target disk file |
