WSL: Can't update WSL2
Windows Version
Microsoft Windows [Versión 10.0.22623.1325]
WSL Version
unkown
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
unknown
Distro Version
any distro
Other Software
No response
Repro Steps
I try to run any wsl command in Power Shell or CMD.
E.g. $ wsl $ wsl --version $ wsl --update $ wsl --update --rollback etc.
Expected Behavior
It should perform the corresponding operation
Actual Behavior
I get in the terminal:
" WSL is finishing an upgrade… Update failed (exit code: 1603). Error code: Wsl/CallMsi/E_ABORT "
Diagnostic Logs
WslLogs-2023-09-21_18-15-02 (2).zip
WSL2 was working perfectly fine yesterday.
Today I got the error described in Actual Behavior. The odd thing is that I can create a new Windows account and run wsl --install and everything is fine; but as soon as I run wsl --update, I get the above error, and furthermore, I cannot use any wsl command.
The last build I had is: 22623.1 (gotten from running (gcm wsl).Version in Power Shell)
The last kernel I had is: Linux 5.10.16.3-microsoft-standard-WSL2 (gotten from running wslfetch in my Ubuntu 20.24 instance)
Also I do have the wsl component turned on and the virtual machine features. And just in case I ran again:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
from the wsl install manual
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 33
This is a known issue if you run wsl --update in a non elevated terminal. This will be fixed in the next release.
In the mean time, running this command as administrator should fix the issue.
I have discovered a fix for you administrative issue in this regards, go into regedit and navigate to
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client\then select theDEFAULTkey and take ownership via setting permissions, then delete it and re-create it.WSL should proceed to allow you to install and update. This has not bricked my PC but please do note that playing with registry values is very risky and can brick your machine. I only do this because I have specific recovery software I can use. So please be cautious.
Have a nice day! 😄
I tried various fixes and running the installed for “2.0.3.0” is the only one that worked. Manually installing the latest version (2.2.4.0 as of today) or running
wsl --updatebreaks things. So I guess I will try to stay with this version as long as possible.Fixed with 2.0.3
My issue was that I didn’t have have the lastest 21H2 and 22H2 patches. At some point microsoft threw in windows 11 upgrade as an option. This actively blocks you from updating windows to the later patches. More information on versions: https://learn.microsoft.com/en-us/windows/release-health/release-information
This following reg script will set your max upgrade level to 22H2. (To undo, its as simple as deleting/reverting the two values)
Open windows update (reopen if its already) it should look like this, notice the asterisk, except and it will want to update to windows 11.
Pause and resume windows updates. This will trigger an update search and windows 11 will not come back. Simply update as normal. It took me through a couple of update restarts. I already had the latest wsl2 installed and could use it as normal.
I have the same issue. Note that I upgraded wsl with
wsl --update --pre-releasemany times before from normal pwsh without issue. But somehow this time it didn’t work. The log “C:\Users\thegi\AppData\Local\Temp\wsl-install-logs.txt” here: wsl-install-logs.txtThen From a administrator pwsh, I tried the same command. It says updated successfully, but afterwards wsl --version still shows 2.0.0.0. Tried twice, same issue.
Then run downloaded the msi from github release and run
It showed a warning regarding WSL.lnk, but installed succesfully. And wsl --version now shows 2.0.1.0. Heres: wsllogs.txt
Okay so it turns out that ‘have you tried turning it off and back on again’ really is the right answer sometimes! 😄 After posting the above comment, I rebooted my system. Post-reboot, the WSL upgrade completed successfully, and the previously missing registry key now exists.