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

Unable to upgrade WSL 1 - WSL 2 #5749

Closed
ksolo opened this issue Aug 12, 2020 · 31 comments
Closed

Unable to upgrade WSL 1 - WSL 2 #5749

ksolo opened this issue Aug 12, 2020 · 31 comments

Comments

@ksolo
Copy link

ksolo commented Aug 12, 2020

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Your Distribution version: [On Debian or Ubuntu run `lsb_release -r` in WSL]
Whether the issue is on WSL 2 and/or WSL 1: [run `cat /proc/version` in WSL]

Windows - Version10.0.19041 Build 19041
WSL - Linux version 4.4.0-19041-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #1-Microsoft Fri Dec 06 14:06:00 PST 2019

Virtualization is enabled via BIOS

Steps to reproduce

$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Deployment Image Servicing and Management tool
Version: 10.0.19041.329

Image Version: 10.0.19041.450

Enabling feature(s)
[==========================100.0%==========================]

Then restart the the machine

After restart open new power shell as admin

 wsl --set-default-version 2
Error: 0x1bc
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

I'm not sure what to do to reset the wsl environment I had it working with wsl 1.

@1josh13
Copy link

1josh13 commented Aug 13, 2020

I have the same error, I tried removing WSL, restarting, re-enabling WSL from nothing, upgrade to 2, same error again.

@MojoVampire
Copy link

Same error. I had WSL on my old machine, decided to start fresh on my new laptop (never used WSL at all on it), got the same error, at the same step.

@Itssuso17
Copy link

Itssuso17 commented Aug 13, 2020

Hello guys. I tried to install Kali Linux on my laptop (thanks to Microsoft Store), I thought "it will be easier". But isn't
I have had many problems, but finally I have the system installed. The problem is that I have version 1 and I need version 2. When i connect to remote system, I log in with my account on Kali Linux, but the screen keeps on black. I think that it is because off the WSL version. I went to the microsoft page and download the lastest version (https://aka.ms/wsl2kernel). But when I start it, it doesn't work.

HERE THE ERROR ========> The installer encountered an unexpected error while installing this package. This may indicate a problem with this package. The error code is 2502.

I didn't mention that I checked the box on Windows Features =====> WSL

@1josh13
Copy link

1josh13 commented Aug 13, 2020

Hello guys. I tried to install Kali Linux on my laptop (thanks to Microsoft Store), I thought "it will be easier". But isn't

Im not sure but this issue is open for another issue, I would recommend opening another issue.

@Itssuso17
Copy link

A lot of issues... What did you mean? Another task? haha

@1josh13
Copy link

1josh13 commented Aug 13, 2020

A lot of issues... What did you mean? Another task? haha

I'm saying the issue that we are discussing is not related to your issue and you shouldn't post unrelated issues in this thread.

@richtong
Copy link

Yikes I have the same problem. Googling does not reveal anything more than this issue. Same configuration. haad WSL1 installed as well

Virtualization is enabled in BIOS and ran that dism command
Windows 2004 OS Build 1904.450

I have Windows Home on this machine, but the FAQ indicates that is supported
https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq

Help!

@fatclimber1
Copy link

For Window 10 (bulid 19042.450)

PS C:\wsl\Ubuntu2004> wsl --set-default-version 2
Error: 0x1bc
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
PS C:\wsl\Ubuntu2004> wsl --list --verbose

NAME            STATE           VERSION

* Ubuntu-20.04    Stopped         1

please refer the MS links and upgrade the WSL kernel then rerun the wsl set-version command should be fine !
https://docs.microsoft.com/ja-jp/windows/wsl/wsl2-kernel

Glad to be heard and feedback
-Eric

@richtong
Copy link

richtong commented Aug 13, 2020 via email

@MojoVampire
Copy link

MojoVampire commented Aug 13, 2020

@richtong: I got the same message without the error code, but when I went and installed Alpine Linux for WSL, it properly set it up as version 2, so I think it worked just fine. My problem is solved. For those who don't want to manually fix the URL locale, the U.S. English version of Eric's link is https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel

@licanhua
Copy link
Collaborator

Error: 0x1bc here means: WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel. I think your display language or local setting is not English, and that's why you see the error code other than message itself.

It's easy to verify if kernel exists by command dir %SystemRoot%\system32\lxss\tools\kernel. If kernel doesn't exist, please install it by https://aka.ms/wsl2kernel
If you download and installed the .msi successfully, but you still didn't see kernel file in %SystemRoot%\system32\lxss\tools. It's possible that you didn't install the .msi with admin. Uninstall it and reinstall it admin permission.

Although wsl --set-default-version 2 with this error, actually the default version is changed to 2 already. When you install the distro from store, it will see it's version 2. Of course, because kernel is missing, you still not able to launch the distro and complete the setup process.

@1josh13
Copy link

1josh13 commented Aug 14, 2020

Error: 0x1bc here means: WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel. I think your display language or local setting is not English, and that's why you see the error code other than message itself.

It's easy to verify if kernel exists by command dir %SystemRoot%\system32\lxss\tools\kernel. If kernel doesn't exist, please install it by https://aka.ms/wsl2kernel
If you download and installed the .msi successfully, but you still didn't see kernel file in %SystemRoot%\system32\lxss\tools. It's possible that you didn't install the .msi with admin. Uninstall it and reinstall it admin permission.

Although wsl --set-default-version 2 with this error, actually the default version is changed to 2 already. When you install the distro from store, it will see it's version 2. Of course, because kernel is missing, you still not able to launch the distro and complete the setup process.

Installing the kernel worked for me, thanks! Maybe implement that as an error message or at least on the WSL website as an error code that is documented (hence why I chimed in on this post since there was no other documentation for it)

Thanks @licanhua

@ksolo
Copy link
Author

ksolo commented Aug 14, 2020

The kernel install also worked. Thank you! closing this ticket now.

@ksolo ksolo closed this as completed Aug 14, 2020
@licanhua
Copy link
Collaborator

Agree it's not well documented. This is a bug and I think it is fixed in newest Windows.
I created PR 835 to update the document.

@TanveshT
Copy link

TanveshT commented Aug 14, 2020

@licanhua Is there a way to check the WSL version just to confirm?

Edit: Got it wsl -l -v

@vanillamice
Copy link

Tried re-installing the kernal,it just gives me this message "This update only appiles to machines with the windows subsystem for linux" even tho i have wsl 1 and it's functional.

@vservin
Copy link

vservin commented Aug 26, 2020

I already have installed ubuntu wsl 1 and I wanted to upgrade, so attempting to enter wsl --set-default-version 2 was showing:

> wsl --set-default-version 2
Error: 0x1bc
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

I attempted upgrading the kernel from https://docs.microsoft.com/en-gb/windows/wsl/wsl2-kernel but the output changed to

> wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

basically the same with no error code.
The fix
I ran the recommended command but for a specific distro like this:

> wsl --set-version ubuntu 2
Conversion in progress, this may take a few minutes...

I hope this helps!

@ANORAK-MATTFLY
Copy link

I already have installed ubuntu wsl 1 and I wanted to upgrade, so attempting to enter wsl --set-default-version 2 was showing:

> wsl --set-default-version 2
Error: 0x1bc
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

I attempted upgrading the kernel from https://docs.microsoft.com/en-gb/windows/wsl/wsl2-kernel but the outup changed to

> wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

basically the same with no error code.
The fix
I ran the recommended command but for a specific distro like this:

> wsl --set-version ubuntu 2
Conversion in progress, this may take a few minutes...

I hope this helps!

Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

@MrOzwaldMan
Copy link

I am using kali Linux what do I put instead of ubuntu

@vservin
Copy link

vservin commented Oct 19, 2020

I am using kali Linux what do I put instead of ubuntu

The distro name for Kali is kali-linux so the command should be

> wsl --set-version kali-linux 2

@jrarturo
Copy link

jrarturo commented Dec 3, 2020

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Your Distribution version: [On Debian or Ubuntu run `lsb_release -r` in WSL]
Whether the issue is on WSL 2 and/or WSL 1: [run `cat /proc/version` in WSL]

Windows - Version10.0.19041 Build 19041
WSL - Linux version 4.4.0-19041-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #1-Microsoft Fri Dec 06 14:06:00 PST 2019

Virtualization is enabled via BIOS

Steps to reproduce

$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Deployment Image Servicing and Management tool
Version: 10.0.19041.329

Image Version: 10.0.19041.450

Enabling feature(s)
[==========================100.0%==========================]

Then restart the the machine

After restart open new power shell as admin

 wsl --set-default-version 2
Error: 0x1bc
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

I'm not sure what to do to reset the wsl environment I had it working with wsl 1.

I have the same problem, here's my solution:

check if you have one or more versions: On command prompt wls -l -v
image
Now convert all versions to wsl 2: On command prompt wsl --set-version <NAME> 2
image

That works for me.

image

See ya.

@nagarajcruze
Copy link

@1josh13 the kernel file exists but stil i'm getting this issue( The file path specified does not exisit). Any fixes?
Screenshot 2020-12-14 133650

@licanhua
Copy link
Collaborator

@nagarajcruze Please create new issue and submit logs. This is a generic error and most of time, it's missing kernel. It's hard to know what's the root cause without log since you already have kernel.

@nagarajcruze
Copy link

@licanhua how to take logs?

@licanhua
Copy link
Collaborator

@nagarajcruze
Copy link

@licanhua this link doesn't seems to show ways to generate logs, instead just to screen record?

@val089
Copy link

val089 commented Feb 2, 2021

For information on key differences with WSL 2 please visit https://aka.ms/wsl2

I downloaded new Ubuntu version from Microsoft Store and installed. That helped me. Please look guide below. ;)
https://codefellows.github.io/setup-guide/windows/

@Alexie81
Copy link

Hello !
It's clear: a team of incompetents who don't know how to make a virtual machine and a linux on windows properly.
At least, why don't you answer the questions ?!
If you can answer my question, I withdraw my comment:
I installed wsl kernel, but when I tell him where it is, he can't find it:

dir% SystemRoot% \ system32 \ lxss \ tools \ kernel
dir: Cannot find path 'C: \ WINDOWS \ system32 \% SystemRoot% \ system32 \ lxss \ tools \ kernel' because it does not exist.
At line: 1 char: 1
+ dir% SystemRoot% \ system32 \ lxss \ tools \ kernel
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo: ObjectNotFound: (C: \ WINDOWS \ syst ... ss \ tools \ kernel: String) [Get-ChildItem], ItemNotFound
   Exception
    + FullyQualifiedErrorId: PathNotFound, Microsoft.PowerShell.Commands.GetChildItemCommand

and I follow all the steps, but when I give wsl --set-default-version 2, I no longer have kali-linux installed. Why is this happening ?
And I want to remind you that you may think me wrong: I HAVE ACTIVATED EVERYTHING NECESSARY !!!!!!!!!!!

@mastery-shital-pacharne
Copy link

wsl --set-version Ubuntu-20.04 2
wsl --set-version Ubuntu-18.04 2

just check which version you are installing on
and it will work

@nagarajcruze
Copy link

@mastery-shital-pacharne Thanks for the help but I did a reset to my laptop and fixed it.

@zeekus
Copy link

zeekus commented Dec 21, 2022

OS: Windows 11
Summary: This problem seems to come back with Windows 11.

Fixing WSL 1 and Upgrading to WSL 2

It seems if you start with installing a Linux distro in WSL 1 (the default), you need to do some extra steps to clean up.

To get things to work: - Download the kernel update libraries from the Microsoft website:
https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

After this step, WSL should start working.
Access Bash and update WSL and the distro to WSL v2:

wsl --set-default-version 2
wsl --set-version <distro_name> 2

To verify that the upgrade was successful, run the following command:

wsl --list -v

You should see the distro listed with a version of 2.

Note: If you prefer to start with a fresh install of Windows and upgrade to WSL v2, that is also an option.

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