WSL2 will be generally available in Windows 10, version 2004

Craig Loewen

Craig

WSL2 will soon be officially available as part of Windows 10, version 2004! As we get ready for general availability, we want to share one additional change: updating how the Linux kernel inside of WSL2 is installed and serviced on your machine. We’ve heard lots of community feedback that the install experience could be streamlined, and we’re taking the first step towards this by improving the servicing model of the Linux kernel. We’ve removed the Linux kernel from the Windows OS image and instead will be delivering it to your machine via Windows Update, the same way that 3rd party drivers (like graphics, or touchpad drivers) are installed and updated on your machine today. This change will give you more agility and flexibility over Linux kernel updates in WSL2. Read on to learn more about how you’ll see this in the user experience.

How will I notice this change?

Our end goal is for this change to be seamless, where your Linux kernel is kept up to date without you needing to think about it. By default this will be handled entirely by Windows, just like regular updates on your machine. Inside of the initial release of Windows 10, version 2004, and in the latest Windows Insiders slow ring preview build you will temporarily need to manually install the Linux kernel, and will receive an update in a few months that will add automatic install and servicing capabilities. We made this change now and will have a patch later to ensure that all users in the initial general release of WSL2 will be serviced via this dynamic model, and no one will be left in a middle state using the prior system.

Automatic install and updates

If you’ve ever gone to your Windows settings, and clicked ‘Check for Updates’ you might have seen some other items being updated like Windows Defender malware definitions, or a new touchpad driver, etc. The Linux kernel in WSL2 will now be serviced in this same method, which means you’ll get the latest kernel version independently of consuming an update to your Windows image. You can manually check for new kernel updates by clicking the ‘Check for Updates’ button, or you can let Windows keep you up to date just like normal.

Image wsl1

If you’re installing WSL for the first time, we’ll check for updates and install the Linux kernel for you during the WSL install process.

Temporary experience of manually installing the Linux kernel in Windows 10, version 2004 and Windows Insiders slow ring

After updating to Windows 10 build 19041.153, when you run any of the following commands:

  • wsl (If a WSL2 distro is your default distro)
  • wsl --set-version <Distro> 2, – wsl --set-default-version 2
  • wsl --import and wsl --export targeting WSL2

You’ll see a one-time message instructing you to update your kernel. It will instruct you to go to the link: https://aka.ms/wsl2kernel.

Command Prompt showing WSL

Once there, follow the instructions to download the MSI package, run it to install your Linux kernel, and you’ll be finished and ready to use WSL2. When automatic install and update of the Linux kernel is added you’ll start getting automatic updates to your kernel right away.

Future plans and where to learn more

We’re excited for the release of WSL2, and to keep working on the WSL install experience. If you’d like to learn more about WSL2, check out our latest overview video WSL2: Code faster on the Windows Subsystem for Linux. Please stay tuned for more updates from us soon!

As always you can reach members of the WSL team that are on Twitter, or me personally @craigaloewen on Twitter if you have any general questions. For technical issues please file an issue on the WSL Github Repo. We always love hearing your feedback, thank you for helping make WSL amazing, and we’ll see you with the next update soon!

Updates:

  • 3/13/2020 – Thank you to our WSL distro partners: Canonical, Debian, openSUSE, Kali Linux, and Pengwin for adding a change to their distro launcher to help support this experience!
  • 3/13/2020 – Added link to WSL2 explanation video

31 comments

Leave a comment

  • Toby
    Toby

    well done to the team on getting this out. I’m excited to see it coming, thus questions, I have, three:
    1. Will the transition from WSL 1 to 2, or future kernel updates, involve wiping out the users changes to files (eg in the home dir) as currently happens with WSL 1 distro upgrades? (i.e. should I prep a backup?)
    2. Is there an expected release date for 2004? My laptop has only received 1909 in the last fortnight (was disappointed to not see WSL 2 there after the hype 😪)
    3. As there are now full kernels, is it really still a subsystem? 😋

    • Aaron Kelley
      Aaron Kelley

      (1) If you upgrade in-place your home folder should be preserved. (Use the wsl –set-version command. Do not remove and replace your downloaded distro.) You can do this with distro upgrades too. You just have to run the distro upgrade from inside of WSL, rather than clobbering and replacing your WSL distro from outside in Windows land. (I.e. I just run “do-release-upgrade” from the bash prompt in Ubuntu 16.04 and I got upgraded to Ubuntu 18.04, no issues.)
      (2) The version number is in YYMM format and points to the release window (2004 = April 2020). Wouldn’t be surprised if it is not released until May, the last few have slipped past what the version number says, but better that they take the time to get it right.
      (3) Despite the fact that it has a Linux kernel, there’s still a lot of work done in the integration between the running Linux instance and the Windows host, so this seems like a fine name to me…

  • Avatar
    Mark Blackie

    I had tried out WSL v2, but soon realized it wouldn’t work under my circumstance at that time due to WSL v2 being virtualized. This was hardware support. If I recall correctly in this particular case I was trying to use a USB to serial adapter and a USB JTAG adapter. Neither of them would work under WSL v2 due to the virtualization. Question is, as WSL v2 is close to being realized does WSL v2 handle hardware better or will I still need to revert to WSL v1 if I plan to continue using specific types of hardware that are not supported in WSL v2???

    • Toby
      Toby

      Good question here. IIRC there was a bit of work put in to make WSL 1 work correctly with serial devices as a significant percentage of people that develop do so against hardware. Would be interested in the situation in WSL 2 myself for similar reasons.

  • Avatar
    david

    Could you please make the preview builds available in Azure? I managed to get it working with the Windows 10 Pro preview and then using the latest insider iso to upgrade to the latest version. WSL 2 worked fine but pushing a test/developer version with WSL 2 already installed (or at least the latest build version) to Azure would be a lot easier 🙂

  • Avatar
    Gregg Levine

    I as well am amazed. I typically run an image of SLES12SP3 that someone put together. However…. I got my start running Slackware Linux. It’s one of the few who did not make a mistake in its startup methods.

    That being stated, how would I go about creating a custom one of that distribution? (Not to be distributed via the Store.)

    • Aaron Kelley
      Aaron Kelley

      It is up to VirtualBox to change their product so that it will work with Hyper-V enabled. VMware Workstation has the same problem but they are working on it; a compatible preview release is available now and a final release should be out later in the year.

  • Avatar
    Frank Whitlock

    With every release I have tried to upgrade my wsl 1 to 2. My windows insider machine is a virtual machine running on hyper-v. It failed again. Are virtual machines going to be supported?

    PS C:\WINDOWS\system32> wsl –set-version Ubuntu-18.04 2
    Conversion in progress, this may take a few minutes…
    For information on key differences with WSL 2 please visit https://aka.ms/wsl2
    Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.

    • Dorin Lazăr
      Dorin Lazăr

      Filesystem performance is the main reason you want to switch to WSL2. The current (stable) WSL has acceptable performance, but programming-wise, when you fetch huge trees of small files the system starts to feel it quite hard. Not so with WSL2. I tested WSL2 on the Insiders track, but I dropped the insiders track due to work related reasons, but the performance improvement is there, visible.

  • Avatar
    Praveen Madhu

    Hi One quick question,

    I have upgraded to Windows Insider and also got the latest update of Windows that dates to Nov 2019.
    I want to export my WSL to new computer but when I try to export I get “access denied” and also wsl -l -v does not work.

  • Avatar
    Krishna Prasad

    Really exited to try out the native WSL2.

    Not sure if this is the proper location for this question

    It will be great if someone can point out as to how I can access/navigate to a windows folder from SQL DB on Linux when using SSMS

    I have installed docker desktop edge with Linux containers and WSL2 as distro. I have a container with sql-2019 Linux running (WSL2-docker) and am able to SSMS installed on windows into the Linux SQL.

    I am trying to restore an existing db. I have the .bak file in my local windows folder. When I try to restore using SSMS GUI, it takes me to /var/opt/mssql/data.

    I am not sure how I can navigate to the windows folder for e.g. d:\backups\db_backup.bak

    Thanks for the great work on the WSL2

    • David Shelton
      David Shelton

      Windows is stored under /mnt/ within WSL1 and WSL2. Just like a duel boot would if windows was mounted properly. You can use standard bash commands from wsl2 to move, copy, and work with any file on windows.

      For your example cd /mnt/d/backups && w/e you want to do with db_backup.bak.

  • Geoff Maddock
    Geoff Maddock

    I tried to upgrade from wsl1 to 2, followed the steps here, but find myself stuck at this error:

    wsl –set-version Ubuntu-18.04 2
    Conversion in progress, this may take a few minutes…
    For information on key differences with WSL 2 please visit https://aka.ms/wsl2
    The requested operation could not be completed due to a virtual disk system limitation. Virtual hard disk files must be uncompressed and unencrypted and must not be sparse.
    PS C:\WINDOWS\system32>

    Any suggestions?

  • Avatar
    Boy Ferry

    It works really great, though there is an issue with the network when used with VPNs. It would be nice to have the ability to change network addresses range for WSL2 in its config. I believe that somehow routing is going through the VPN, not through NAT created on the host machine, but I’m not sure about that.