Repository navigation
Description
Environment
- WSL version: 3.0.3.0
- Kernel version: 6.18.54.1-1
- WSLg version: 1.0.79
- Windows version: 10.0.22631.5335
- Distribution: Ubuntu-20.04, WSL 2
Description
My Ubuntu distribution works normally, but I cannot compact its VHDX after deleting approximately 15 GiB of caches.
The VHDX has the Archive, Encrypted attributes. cipher /c reports “Application Protected” (displayed as 应用程序受保护 on my Chinese Windows installation). The file is not sparse.
Both WSL’s built-in compaction command and DiskPart fail because the file cannot be decrypted.
Steps to reproduce
-
Delete caches inside Ubuntu. The filesystem usage reported by
df -h /decreases from approximately 71 GiB to 56 GiB. -
Run:
wsl -d Ubuntu-20.04 -u root -- fstrim -v /
Output:
/: 949.6 GiB (1019659313152 bytes) trimmed -
Shut down WSL:
wsl --shutdown -
Attempt compaction:
wsl --manage Ubuntu-20.04 --compact
Actual behavior
The command fails with:
正在进行压缩,这可能需要几分钟时间。
指定的文件已加密,而且用户没有能力解密。
错误代码: Wsl/Service/0x80071772
English translation of the error message:
The specified file is encrypted and the user does not have the ability to decrypt it.
The VHDX file size remains 80,354,476,032 bytes (approximately 74.84 GiB). C: has approximately 5.2 GiB free.
Expected behavior
WSL should compact the distribution’s VHDX, or provide actionable guidance for handling an Application Protected VHDX without losing the existing distribution.
File information
Path:
C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx
Get-Item output:
Attributes : Archive, Encrypted
Length : 80354476032
cipher /c output, translated:
New files added to this directory will not be encrypted.
E ext4.vhdx
Compatibility Level:
Application Protected
fsutil sparse queryflag reports that the file is not sparse.
Other troubleshooting
I also tried DiskPart from an elevated terminal after shutting down WSL:
select vdisk file="<full path to ext4.vhdx>"
compact vdisk
Selecting the VHDX succeeded, but compaction failed with the same encryption/decryption error.
I have not attempted to decrypt the file, change its permissions, or modify its sparse attributes.
Questions
- What could cause this distribution’s VHDX to be marked “Application Protected”?
- Is there a supported way to resolve the encryption access error and compact the existing VHDX in place?
- Could removing this protection prevent WSL from mounting the distribution?
- What diagnostic logs would help investigate this issue?
I would prefer to preserve the existing distribution without exporting and re-importing it. Available space on my internal drives is limited.
Activity
github-actions commentedon Oct 21, 2026
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done.
If this is a networking issue, please use
.\collect-wsl-logs.ps1 -LogProfile networkinginstead, following the instructions in Collect WSL logs for networking issuesOnce completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.