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

Kali Linux release 2/22/2018 through Store, WslRegisterDistribution fails with error 0x80070057 #3054

Closed
PhMajerus opened this issue Mar 26, 2018 · 58 comments

Comments

@PhMajerus
Copy link

PhMajerus commented Mar 26, 2018

Windows 10.0.16299.334 Pro x64 en-us (current public release build with current cumulative update KB4089848 at time of issue).
Kali Linux installed through the Store on original release date, no problem observed (but not used much).
Other distributions (Ubuntu and Debian) working fine.
Today Kali Linux got updated through the Store, to version 1.1.2.0 released on 2/22/2018.

After update, launching the Kali Linux instance shows the following:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070057
Error: 0x80070057 The parameter is incorrect.

kalifail

Uninstalling and reinstalling Kali Linux package works.

@WSLUser
Copy link

WSLUser commented Mar 26, 2018

I think you'll need to address this with the Kali Linux team as they are responsible for the appx. Probably an update in response to the update to the launcher that is now open-source. FWIW, I had no issues with the update but I don't have a clean image either.
Edit: the page I linked is actually not the official one. Removed from post. See below for link.

@laoshancun
Copy link

image
got this too.

@ioxplo
Copy link

ioxplo commented Mar 27, 2018

hi I am having the same issue. anyone has any idea on how to fix this? thanks so much

@Biswa96
Copy link

Biswa96 commented Mar 27, 2018

Whn I extract the kali.exe and install.tar.gz from Appx package, Kali installs rootfs successfully.

@ioxplo
Copy link

ioxplo commented Mar 27, 2018

Hi @Biswa96, where can you get the Appx package which contains kali.exe and install.tar.gz? Thanks

@TooYoungTooSimp
Copy link

Same issue
image

@bardware
Copy link

Whn I extract the kali.exe and install.tar.gz

What do you do with these files after extracting?

@kevin-valerio
Copy link

screenshot_1

Same here...

@benhillis
Copy link
Member

Would it be possible to collect logs while attempting the install?

https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-detailed-logs

@USTC-HuangZA
Copy link

Same issue

@godmodenewbie
Copy link

same issue, but when trying to run "bash" command from cmd, it works.
screenshot 26

@Biswa96
Copy link

Biswa96 commented Mar 28, 2018

Has anyone tried to uninstall the Kali Linux package fully from Windows Store and reinstall?
The distro name has been changed in latest version.

@kyuuketsukikurai
Copy link

Running kali.exe fixed it for me.

@bardware
Copy link

fixed it for me.

Running kali.exe actually brought the errormessage from the above screenshots.

@benhillis
Copy link
Member

If somebody that is hitting the issue could collect logs it would be helpful in getting this fixed.

https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-detailed-logs

@zikhan
Copy link

zikhan commented Mar 28, 2018

I just started getting the problem today. I'm scared to uninstall since I have some private keys on the instance for an ssh server that doesn't have username login.
image

I did notice when I run the wsl.exe, kali will run since it's the only distro on the system. Edit: WSL is just an alias for bash.exe like @godmodenewbie showed
image

Here are some logs:
LinuxLogs.zip

@benhillis
Copy link
Member

Thanks, I have identified the issue and will work with Kali to get this fixed.

@WSLUser
Copy link

WSLUser commented Mar 28, 2018

So the bare image for WSL stems from the link I had referenced above but it appears the official page is https://github.com/offensive-security/Kali-WSL-chroot where it shows in the main page:

Kali Linux Windows App for WSL chroot builder script.

So we should probably file Kali issues there instead. I edited my post above to remove the link.

@matte1006
Copy link

same problem after the update

@thecmac
Copy link

thecmac commented Mar 29, 2018

Any update on this? I have installed metasploit, and would like to preserve my config without re-installing...

any advice welcome.

@NetanelBrauner
Copy link

Same issue for me.
Works when running kali.exe as administrator (not directly "run as" but via another program that run as administrator) any ideas?

@benhillis
Copy link
Member

Unfortunately the updates version of the kali app uses a different distribution identifier than the previous version. This is causing WSL to think that the app is not installed, and when the install is attempted it fails because the root file system already exists. The easiest way to rectify this issue will be to select Reset from Kali App Settings or uninstall and reinstall the app.

If you'd like to back up any information from your previous install you can use wslconfig.exe and wsl.exe:

C:\Users\benhill>wslconfig.exe /list
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
kali-rolling
openSUSE-42

C:\Users\benhill>wslconfig.exe /setdefault kali-rolling

C:\Users\benhill>wsl.exe
ben@BENHILL-DELL:/mnt/c/Users/benhill$ <back up files to somewhere in DrvFs>

@diveyez
Copy link

diveyez commented Mar 30, 2018

wslconfig.exe /setdefault kali-rolling
bash
cd

DONE, Everything is where you left it.

@diveyez
Copy link

diveyez commented Mar 30, 2018

benhillis, why back it up? Just set the default to kali and type bash...
This wont impact others neither as you can launch them by name.

@benhillis
Copy link
Member

Because Kali.exe won't work until you reinstall it reset.

@diveyez
Copy link

diveyez commented Mar 30, 2018

Its working fine for me. Even with The DE/GUI working.
I dont know why nobody figured out that, you can just do what I said.

@diveyez
Copy link

diveyez commented Mar 30, 2018

Also, I realize there is an issue with using proxy/vpn in the WSL that I believe you commented on before.
nano /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
search google.com
ctrl+x
y enter
ping google, or anything you need. This is how I use openvpn with it.

@ioxplo
Copy link

ioxplo commented Apr 4, 2018

I did what @Izumiko mentioned

move rootfs folder to somewhere else
reset kali app
launch kali, wait it installing
delete the newly installed rootfs and move the old one back

with @bityob info to move the rootfs from
C:\Users\<username>\AppData\Local\Packages\KaliLinux<randomchars>\LocalState\rootfs

and Kali works again with installed packages still intact

@JamesDMurray
Copy link

JamesDMurray commented Apr 8, 2018

IMPORTANT: You must move the rootfs folder out of the C:\Users<username>\AppData\Local\Packages\KaliLinux\LocalState folder for safe keeping because everything in the LocalState folder will be deleted when you reset Kali in the Windows Store. If you simply rename the rootfs folder (e.g., rootfs.sav) in place it will be deleted by the reset and you will loose your packages and content.

@laoshancun
Copy link

mark it!!!

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x800703fa
Error: 0x800703fa ???????????????????????

Press any key to continue...

@bkr32
Copy link

bkr32 commented May 13, 2018

revisiting this issue after months with a whole new problem

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x800703fa
Error: 0x800703fa Illegal operation attempted on a registry key that has been marked for deletion.

Press any key to continue...

@traveling-trash-panda
Copy link

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8007019e
Error: 0x800703fa Illegal operation attempted on a registry key that has been marked for deletion.

Press any key to continue...

Tried all the suggested remedies and none of them have worked, anyone else getting this error?

@bkr32
Copy link

bkr32 commented May 14, 2018

@SquatchRage a reboot fixed it for me

@gabrieldemarmiesse
Copy link

My bad, I'll remove that comment to avoid confusing people.

@qpanapuk
Copy link

qpanapuk commented Jun 6, 2018

BAD ENGLISH

  1. go there => https://docs.microsoft.com/en-us/windows/wsl/install-win10
  2. copy there => Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  3. run as administrator PowerShell
  4. Paste it (2) and press Y and Enter
  5. Wait until the computer reboots
  6. Run Kali Linux again
  7. Profit

@hleach
Copy link

hleach commented Jun 12, 2018

In my case the LxssManager service was set to manual and needed to be started up after every reboot. The startup type could not be set in services.msc (even as admin).

I had to manually set the the registry key here:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager

Start = 2

@benhillis
Copy link
Member

Closing out since issue is resolved.

@firewave
Copy link

Happened again today with the update to 1.1.4. Same error as in the initial comment. All other WSL distributions still work and it is still shown as registered and can still access it by changing the default and using wsl.exe.

@benhillis
Copy link
Member

Looks like the distribution name got changed again. I'll follow up with the Kali dev that owns the package.

@31i73-73aM
Copy link

I tried to start Kali Linux on my Windows PC and here is the problem:

Installation, it may take a few minutes ...
WslRegisterDistribution Failed with Error: 0x80070057
Error: 0x80070057 The parameter is incorrect.

Another solution to overcome this problem that worked on my pc:

1- Go to C:\Program Files\WindowsApps\KaliLinux_1.1.4.0_x64 __ *
2- Click kali.exe to launch it
3- In the open console type: apt-get update
apt-get dist-upgrade
apt-get upgrade
apt-get install kali-linux-all
or
apt-get install kali-linux-full
4- Type exit
5- click on the magnifying glass search kali then launch it.
6- kali starts normally.

The problem is now solved

See You

@firewave
Copy link

@31i73-73aM I have no idea how that can even work as the error occurs when you try to run kali.exe

@benhillis There was a 1.1.5 update today which probably fixed the problem but broke it again for me. As none of the suggested workaround worked for me it took me hours to get this working again and probably will again now. There really need to be some proper safe guards for this...

@nnuemad
Copy link

nnuemad commented Dec 28, 2018

need WSL on in windows and all work.

@Raymar242
Copy link

Raymar242 commented Feb 3, 2019

Windows 10.0.16299.334 Pro x64 en-us (current public release build with current cumulative update KB4089848 at time of issue).
Kali Linux installed through the Store on original release date, no problem observed (but not used much).
Other distributions (Ubuntu and Debian) working fine.
Today Kali Linux got updated through the Store, to version 1.1.2.0 released on 2/22/2018.

After update, launching the Kali Linux instance shows the following:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070057
Error: 0x80070057 The parameter is incorrect.

kalifail

Uninstalling and reinstalling Kali Linux package works.

tu problema es no haber iniciado powershell como administrador con esto solucionas el problema

you problem not is start to terminal of powershell as administrator for install
" Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux "

@m-shahbaz-kharal
Copy link

just use this command to set your WSL version to 1
wsl --set-default-version 1
then type kali, it'll install fine, then you can migrate to WSL version 2 using this command
wsl --set-default-version 2

@juniormayhe
Copy link

juniormayhe commented Dec 12, 2021

just use this command to set your WSL version to 1
wsl --set-default-version 1
then type kali, it'll install fine, then you can migrate to WSL version 2 using this command
wsl --set-default-version 2

OMG 😲, thanks for this. After so many restarts, preparing and resetting linuxs apps installed by Microsoft Store, and several dism and wsl install commands you find one useful to make kali and ubuntu Linux run under Linux subsystem. This should be in some official documentation.

I previously edited LxssManager key in registry to enable it.

@Ssri7774
Copy link

the updates version of the kali app uses a different distribution identifier than the previous version. This is causing WSL to think that the app is not installed, and when the install is attempted it fails becaus

You can backup your wsl distro using the below command from Powershell

wsl --export kali-rolling kali-rolling.tar.gz

@aadeethyeah
Copy link

I am facing this issue.
Tried uninstalling WSL and installing it again.
Gives the same error again and again

"Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.

Press any key to continue..."


Uploading Screenshot (135).png…

@Ssri7774
Copy link

Ssri7774 commented Aug 30, 2022

@aditya-digitalai

set the following registry key value to 1:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive

OR

deletE the file %USERPROFILE%.wslconfig, restart wsl and retry the distro install. It is worth to check for this before doing any in-place upgrade...

Ref: #6363

@aadeethyeah
Copy link

Tried setting the value in registry
And there is no file .wslconfig present in %USERPROFILE%.

@robinduerhager
Copy link

robinduerhager commented Nov 14, 2022

just use this command to set your WSL version to 1 wsl --set-default-version 1 then type kali, it'll install fine, then you can migrate to WSL version 2 using this command wsl --set-default-version 2

This will install kali with WSL 1. The wsl --set-default-version 2 won't upgrade the WSL 1 Kali Terminal to WSL 2 (open up a Powershell instance with wsl -l -v. You will see that your instances are running on WSL 1, even if you set the default WSL version to 2). For upgrading you'd have to use wsl --set-version Debian 2 for example. When i try to use this command, i again get the The system cannot find the path specified. error though.

@waelssi
Copy link

waelssi commented Oct 27, 2023

UPDATE 27/10/2023

Solution for all WSL errors codes
1. Press ‘Win + R’ keys on the keyboard together to open the Run dialog box and type the following into the run box: REGEDIT
Navigate to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager
On the right pane, locate Start and set the Value Data to 2.

Exit REGEDIT, and Reboot the machine.

2. Install WSL from MS Store

image

3. Run PowerShell and type

PS C:\Users\xxxx> wsl.exe --list --online
image

Choose Kali-Linux
PS C:\Users\xxxx> wsl.exe --install kali-linux
Then kali will install without any problem .. THE MAGIC WORKS

Type youre username and password

image

Installation successful! WITH NO ERROR.. ENJOY ;) 😉

image

@devfemibadmus
Copy link

Choose Kali-Linux PS C:\Users\xxxx> wsl.exe --install kali-linux Then kali will install without any problem .. THE MAGIC WORKS

image

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

No branches or pull requests