WSL icon indicating copy to clipboard operation
WSL copied to clipboard

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

Open TouchstoneTheDev opened this issue 2 years ago • 24 comments

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 avatar Jul 23 '23 19:07 TouchstoneTheDev

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 ?

OneBlue avatar Jul 25 '23 21:07 OneBlue

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

TouchstoneTheDev avatar Jul 25 '23 21:07 TouchstoneTheDev

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 avatar Sep 30 '23 14:09 abentley

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

abentley avatar Sep 30 '23 14:09 abentley

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.

PeterWang-dev avatar Oct 16 '23 11:10 PeterWang-dev

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

hikarisakamoto avatar Nov 15 '23 19:11 hikarisakamoto

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

Ksingh-Fugalimpala avatar Jan 31 '24 22:01 Ksingh-Fugalimpala

Any fix for this?

joepperkins avatar Feb 23 '24 02:02 joepperkins

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.

0AyanamiRei avatar Mar 08 '24 08:03 0AyanamiRei

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.

snl60 avatar Mar 09 '24 01:03 snl60

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!

gafda avatar Mar 24 '24 11:03 gafda

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!

dazeb avatar Mar 25 '24 20:03 dazeb

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

koo19 avatar Jul 21 '24 15:07 koo19

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?

AndryHTC avatar Oct 04 '24 13:10 AndryHTC

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.

yilun11 avatar Dec 10 '24 08:12 yilun11

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.

HorizonRy avatar Dec 19 '24 01:12 HorizonRy

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.)

SheepReaper avatar Dec 20 '24 18:12 SheepReaper

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.

DgithubA avatar Dec 25 '24 23:12 DgithubA

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

CJxD avatar Jan 01 '25 15:01 CJxD

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!

linchsa avatar Jan 04 '25 21:01 linchsa

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!

Yeah, This works :)

Sec-ctrl avatar Jan 30 '25 18:01 Sec-ctrl

I spent two days troubleshooting the problem, and finally saw your post and restored the installation path to C: drive and solved it in two minutes -_-

Whiskey-Taste avatar Feb 05 '25 22:02 Whiskey-Taste

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

Thank you, I managed to install Ubuntu with your tip

gafmendes avatar Apr 24 '25 21:04 gafmendes

It worked for me by doing wsl --install again

AmroAlqashat avatar May 23 '25 09:05 AmroAlqashat

In my case it was only the antivirus that prevented me from running it (Windows 11)

sangeloz avatar Jun 21 '25 17:06 sangeloz