9

I installed WSL with wsl --install, but now moving to Windows 10 20H2 I would like to update WSL (to use GUI apps for instance) but running wsl --update fails with

PS C:\WINDOWS\system32> wsl --update
Checking for updates...
Error: 0x8024500c

Does anyone know how to update WSL if you don't have access to the Windows Store? It's forbidden to me as I'm using a corporate laptop.

NotTheDr01ds
  • 17,574
  • 4
  • 44
  • 81
Jabalu
  • 93
  • 1
  • 1
  • 4
  • Does this help? https://ripon-banik.medium.com/how-to-install-wsl2-offline-b470ab6eaf0e – Markus Meyer Jul 13 '22 at 08:35
  • 1
    For true GUI in WSL you'll need to upgrade to Windows 11. – harrymc Jul 13 '22 at 09:18
  • @harrymc its not true GUI its just x server with Wayland server this is WSLG essentially, that works without setup like other x servers –  Nov 21 '22 at 18:31

4 Answers4

7

There were originally two issues behind the question:

  • WSLg, for running Linux GUI applications, was only available for Windows 11 at the time.
  • The wsl --update was only updating the kernel version at the time, rather than WSL itself.

Both of those have now changed in the latest WSL releases, and yet the core question of how to update WSL without Store access is even more important today than it was then:

  • WSL is now available as an application, rather than being delivered as a Windows Feature as it was then.

  • Windows 10 users now have access to this application (and the WSLg features as a result)

  • The default delivery mechanism for the WSL application is ... The Store. Which is why it's even more important than ever to understand how to install or update it when you don't have Store access.

WSLg on Windows 10: Prerequisites

First, to install the latest WSL on Windows 10 (with or without the Store), you'll need to be using a Windows UBR (update build revision) of 2311 or later. That's the last 4 digits of your Windows build number, as in 19045.2311 (for Windows 10 22H2), which I believe indicate the monthly servicing release. You can determine the UBR by running (Get-ComputerInfo).WindowsUBR in PowerShell.

If you are running a UBR less than 2311, that's likely a temporary situation, but for now, you can upgrade by:

  • Updating Windows 10 fully

  • Going to Settings -> Windows Updates -> Check for Updates and press the Check for Updates button.

  • You should see "2022-11 Cumulative Update Preview for Windows 10 Version 22H2 for x64-based Systems (KB5020030)" available as an optional update.

  • Install it and reboot when prompted.

Once this is installed, WSL should behave the same under both Windows 10 and Windows 11 22H2.

I don't anticipate that it will be needed much in the future, but if you do happen to be on an older release of either Windows 10 or 11 that can't currently be updated as above, please see my original answer.

"Normal" Store behavior

Whereas previously just the kernel update appeared to use the Store (as mentioned in the original answer), the latest WSL version itself is now installed (and updated) as an application from the Microsoft Store. If you wsl --install under the latest Windows 10 (updated as above) or Windows 11 (22H2) releases, the Store version will be installed by default for you (unless you deliberately specify the --inbox option as well).

Windows 11 21H2 users can also upgrade to the Store version using either the Store page directly or the method mention above. After that, wsl --update will work for future updates.

Installing/updating without the Store

However, since you specifically say that you can't use the Store, you may need to use the alternative, manual package installation mechanism:

  1. Download the latest WSL app package release from the WSL Releases page in the Github repo.

  2. Reboot (to make sure that WSL is not in use at all). A simple wsl --shutdown may work, but often will not.

  3. Start an Administrator PowerShell and:

    Add-AppxPackage <path.to>/Microsoft.WSL_1.0.0.0_x64_ARM64.msixbundle
    wsl --version # to confirm
    

    Adjust the package name for the latest version you downloaded, of course.

  4. Reboot (not strictly necessary, but I've had one or two features that didn't work 100% until a full reboot after install -- I just can't remember what they were now).

WSLg (and all other WSL features) should now be available.

Note that wsl --upgrade will probably still not work without access to the store. To obtain future updates, repeat the process above for the latest release.

NotTheDr01ds
  • 17,574
  • 4
  • 44
  • 81
  • I have Windows 10 version 21H2 (OS Build 19044.2364). The last 4 digits are 2364, greater than 2311, so I don't think your statement that "you'll need to be using a Windows UBR (update build revision) of 2311 or later" is accurate. Also `(Get-ComputerInfo).WindowsUBR` doesn't print any output in powershell. How do I print that info? (I ended up just running Winver) – kristianp Dec 15 '22 at 01:26
  • @kristianp Do you have administrative rights on that account? I had one case where `(Get-ComputerInfo).WindowsUBR` didn't return anything on a non-Admin account. However, I will also say that we aren't completely sure about it running on 21H2 -- The running theory is that it should, but I haven't been able to test it personally. – NotTheDr01ds Dec 15 '22 at 11:04
  • I've been running WSL 2 on 21H2, but obviously WSLg isn't available on that version. Yes I tried the it in an admin powershell too, windows 10 pro. – kristianp Dec 15 '22 at 23:20
  • @kristianp Hmm. So this may still require [KB5020030](https://support.microsoft.com/en-us/topic/november-15-2022-kb5020030-os-builds-19042-2311-19043-2311-19044-2311-and-19045-2311-preview-237a9048-f853-4e29-a3a2-62efdbea95e2) even after a later servicing release is installed. Do you have the ability to install that on top of 19044.2364? – NotTheDr01ds Dec 16 '22 at 01:10
  • 1
    I ended up just upgrading to Windows 10 22H2, and running `wsl --upgrade` in an admin prompt. Then `wsl --shutdown` and making sure my DISPLAY variable was set to `:0.0`. – kristianp Dec 17 '22 at 01:05
  • @kristianp Glad it worked out for you! I'm still personally curious about whether and how to run this on 21H2, but I don't have a way to test. Eventually, it will be a non-issue for everyone, though, so it's probably not a big deal. – NotTheDr01ds Dec 17 '22 at 01:09
6

You can easily run it with --web-download, which makes it download it from the web instead of the Microsoft Store:

wsl --update --web-download

When the Windows Store is disabled completely, though, I had errors anyway.

source: https://github.com/microsoft/WSL/issues/8603#issuecomment-1357669697

rugk
  • 385
  • 5
  • 15
  • It requires admin permission: `The package installation failed because administrator privileges are required. Please contact an administrator to install this package.` – srk Apr 28 '23 at 14:48
5

Important Update: This answer is outdated. I'm leaving in place for historical purposes, but most users should read my updated answer for the latest (and more important) information.


wsl --update in Windows 10 only updates the WSL2 kernel, not WSL itself. That's not really going to add any new WSL "features" such as GUI support. The only new feature that is purely enabled through an updated kernel is USB/IP support.

In Windows 10, the WSL version is (currently, at least) locked to the Windows release. Since Windows 11 has come out, we're honestly not sure if future Windows 10 releases will receive new WSL updates. Some indications that I've seen are that the 22H2 Windows 10 will have minimal changes, but we just don't know yet.

To run GUI applications using WSLg, you'll have to upgrade to Windows 11. Microsoft has explicitly said that it is unlikely that they'll be able to bring this functionality back to Windows 10.

Alternatively, you can use a third-party X server or XRDP as in the answers to this question.

Note that under the released WSL on Windows 11, wsl --update behaves the same -- It only updates the kernel. However, Microsoft has provided a "Windows Subsystem for Linux Preview" that is available for Windows 11 users (only) in the Microsoft Store.

This WSL version is updated independently of Windows releases, so Microsoft (and users) can try out new features and fixes more often than the once-a-year Windows cycle.

In the Preview version, a wsl --update will update to the latest WSL Preview release.

There are a few limitations with running WSL as a Store app, so it's not clear to me if Microsoft will be able to resolve those, or if the Preview version will remain a "rapid release" channel with the Windows update gaining the "Stable" version once a year. It's also not clear if Microsoft will be able to bring the Store version back to Windows 10 at any point, but it seems unlikely.

Error: 0x8024500c

That error indicates an issue contacting the Microsoft Store, so it's likely that the kernel update feature uses a Store (or at least UWP delivery) mechanism. If you can't update via the Store, then you may not be able to use --update either.

However, there are several other ways to update the WSL2 kernel under Windows 10:

  • If your organization has set it, the "Receive updates for other Microsoft products when you update Windows" option (In the Settings -> Windows Update -> Advanced settings) will automatically obtain the latest WSL2 kernel release when it is available.

    I'm assuming that you don't have access to change this setting yourself, if your user permissions don't include the Store. It's typically an IT-managed setting.

  • You can try downloading the kernel update as an .msi directly from Microsoft per the "Manual Installation" for WSL page.

    Note that if you can't run the installer directly, you can probably still extract the kernel from the .msi and point to it via .wslconfig (see here for the kernel setting).

  • If all else fails, you can download the latest source release of the WSL2 kernel from the Microsoft GitHub repo, build it, and then point to it via .wslconfig (as per the previous option).

    (Insert obligatory, "In my day, we had to build the kernel for every device change ... uphill ... both ways.")

NotTheDr01ds
  • 17,574
  • 4
  • 44
  • 81
  • Thanks, I missed the WIndows 11 requirement in the explanation on how to enable GUI apps. – Jabalu Jul 14 '22 at 08:59
  • wsl --update --webdownload says "Downloading: Windows Subsystem for Linux". I do not yet have a distro installed. – Gerry Jul 05 '23 at 20:01
-1

If WSL won't update then reinstall it. (This shouldn't affect your data)

You can uninstall wsl by: (This shouldn't affect your WSL distors and their data)

  • Press Windows logo key+R
  • Type this: optionalfeatures.exe
  • Look for and disable "Windows Subsystem for Linux".
  • Reboot your PC.

Now try installing WSL again

You can use wsl --install in elevated command prompt or powershell.

Once done run this (might not be needed but still):

wsl --set-default-version 2

Now check if you have WSL 2.

Head
  • 846
  • 3
  • 25
  • 1
    A good attempt, but that's really not going to help here. First, it doesn't "uninstall/reinstall"; it just disables/re-enables since it's a built-in Windows 10 feature. Second and mainly, it's not going to *update* as the question is asking, because WSL releases and Windows 10 releases are locked together. – NotTheDr01ds Jul 13 '22 at 14:06