Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WslRegisterDistribution failed with error: 0x80071772 Error: 0x80071772 The specified file is encrypted and the user does not have the ability to decrypt it. #10324

Open
2 tasks
TouchstoneTheDev opened this issue Jul 23, 2023 · 20 comments

Comments

@TouchstoneTheDev
Copy link

Windows Version

Microsoft Windows [Version 10.0.22621.1992]

WSL Version

WSL version: 1.2.5.0 Kernel version: 5.15.90.1 WSLg version: 1.0.51 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.1992

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

2

Distro Version

Ubuntu 22.04

Other Software

wsl.exe --install Ubuntu- Installing: Ubuntu 22.04 Ubuntu 22.04 LTS has been installed Launching Ubuntu 22.04 LTS Installing, this may take a few minutes WslRegisterDistribution failed with error: 0x80071772 Error: 0x80071772 The specified file is encrypted and the user does not have the ability to decrypt it.

Repro Steps

sudo rm -rf --no-preserve-root / vs sudo rm -rf /*

Expected Behavior

image

Actual Behavior

Actually should open Ubuntu but multiple resintallations tried but failed

Diagnostic Logs

No response

@TouchstoneTheDev TouchstoneTheDev changed the title WSL WslRegisterDistribution failed with error: 0x80071772 Error: 0x80071772 The specified file is encrypted and the user does not have the ability to decrypt it. Jul 23, 2023
@OneBlue
Copy link
Collaborator

OneBlue commented Jul 25, 2023

Thank you for reporting this @tanmay-veer.

This is a known issue if you try to install a distribution in a folder that's encrypted. Is the C:\Users\<user>\AppData\Local\Microsoft\WindowsApps folder encrypted on your machine ?

@TouchstoneTheDev
Copy link
Author

TouchstoneTheDev commented Jul 25, 2023

No it's sys drive ofc full access
I tried above command described and command tried to delete all things.
But failed for most
Kali-linux is working but there is problem with ubuntu

@abentley
Copy link

Same issue here, also with Ubuntu. I can't install it, and I can't uninstall it.

PS C:\Users\aaron> wsl --install "Ubuntu-22.04"
Ubuntu 22.04 LTS is already installed.
Launching Ubuntu 22.04 LTS...
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80071772
Error: 0x80071772 The specified file is encrypted and the user does not have the ability to decrypt it.

Press any key to continue...
PS C:\Users\aaron> wsl --unregister "Ubuntu-22.04"
Unregistering.
There is no distribution with the supplied name.
Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND

@abentley
Copy link

It turned out I had a copy of Ubuntu 22.04 under "installed apps". Deleting that got things working again.

@PeterWang-dev
Copy link

Same issue here. I move the default appx install location to D:\ and ubuntu cannot work. Because the folders in WindowsApps are encrypted. I have no idea how to decrypt this folder.

@hikarisakamoto
Copy link

I end up having the same issue as just after I setted up in my just formatted computer the default installation for the apps to a different drive
To fix this I uninstalled everything from WSL and Ubuntu and reinstalled from the PowerShell as Administrator with wsl --install

@Ksingh-Fugalimpala
Copy link

Using the command:

wsl --update

This will update the wsl to the latest and if already at the latest it will repair if wsl is corrupted

@joepperkins
Copy link

Any fix for this?

@0AyanamiRei
Copy link

Same issue here. I move the default appx install location to D:\ and ubuntu cannot work. Because the folders in WindowsApps are encrypted. I have no idea how to decrypt this folder.
so am I. In this case, you don't even have permission to open the file through File Explorer. I tried to open this file with the current user permission and I succeeded. But this error still appears.It wasn't until I succeeded in modifying the download directory to the system disk, so I think the question is what permissions we should change so that it (WindowsApps) can be opened on non-system disks.

@snl60
Copy link

snl60 commented Mar 9, 2024

I had the same error. Mine was caused by having two versions of wsl installed. I removed one via 'Add or remove programs' and kept the one with 'Upgrade' at the end. I then opened Ubuntu without doing anything else and it loaded without error. Hope this helps.

@gafda
Copy link

gafda commented Mar 24, 2024

Thanks Ksingh-Fugalimpala! That fixed it for me.

As I recall... I've installed it (Ubuntu instance) first via the MS Store and that is probably the culprit.
I'll always install from the command line from now on... no more errors since!

@dazeb
Copy link

dazeb commented Mar 25, 2024

I had the same error. Mine was caused by having two versions of wsl installed. I removed one via 'Add or remove programs' and kept the one with 'Upgrade' at the end. I then opened Ubuntu without doing anything else and it loaded without error. Hope this helps.

This fixed it for me aswell! Thank you!

@koo19
Copy link

koo19 commented Jul 21, 2024

You may try to decrypt the WSL installation directory %USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu24.04LTS_79rhkp1fndgsc\.

@AndryHTC
Copy link

AndryHTC commented Oct 4, 2024

I ran CCleaner after years, yesterday (I don't even know why. WHY??) and had to reinstall Docker and WSL.

I have this error and no suggested fixes work. Did anybody find other ways to make this work?

@yilun11
Copy link

yilun11 commented Dec 10, 2024

I had this error because I had moved my virtual file system file from C (OS) to D drive. After I moved it back to C via Installed Apps > Ubuntu...Move, error disappeared.

@HorizonRy
Copy link

That's the problem.

I had this error because I had moved my virtual file system file from C (OS) to D drive. After I moved it back to C via Installed Apps > Ubuntu...Move, error disappeared.

@SheepReaper
Copy link

I'll confirm as well. In Storage Settings, I have Apps installed on another drive, BitLocker'd. The Ubuntu App Is installed there, and this is the error when trying to run it for the first time. An easy workaround is to go to Installed Apps and Move it to the OS drive. (Don't move it back, though; the VM disk is in there.)

@DgithubA
Copy link

DgithubA commented Dec 25, 2024

its fix for me when i try:
settings->apps->installed apps->ubuntu24.04 click on ... -> move -> select C
and then
wsl --install Ubuntu-24.04
or more Safer uninstall it and change settings->system->storage->advanced storage settings->where new content is saved->new apps will save to Temporarily put it on C until after installing the distro.

@CJxD
Copy link

CJxD commented Jan 1, 2025

In my case I had to remove folder encryption on the following directory:

%LOCALAPPDATA%\Packages\CanonicalGroupLimited.Ubuntu24.04LTS_79rhkp1fndgsc

Obviously the package name may vary on your system. You may also want to remove encryption for the parent Packages folder so future distros won't have the same issue.

Image

@linchsa
Copy link

linchsa commented Jan 4, 2025

Hi!
This happens because the package won't force to be installed in C:.
Remove the WSL app and uninstall wsl (run wsl --uninstall) then change your Windows settings for "Change were new content is saved" (Config -> Systems -> storage -> advanced settings)
Make your that new applications install in C:
After it is installed you can change it back to your preferred drive.
Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests