How to Update from WSL to WSL 2 in Windows 10
WSL 2 (Windows Subsystem for Linux 2) is a new version of the architecture in WSL that changes how Linux distributions interact with Windows. WSL 2 has the primary goals of increasing file system performance and adding full system call compatibility. Each Linux distribution can run as WSL 1 or as WSL 2, and can be switched between at any time. WSL 2 is a major overhaul of the underlying architecture and uses virtualization technology and a Linux kernel to enable its new features.
WSL 2 uses the latest and greatest in virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). However, WSL 2 is not a traditional VM experience. Learn more about the WSL 2 architecture.
Comparing features
Feature WSL 1 WSL 2 Integration between Windows and Linux ✅ ✅ Fast boot times ✅ ✅ Small resource foot print ✅ ✅ Runs with current versions of VMWare and VirtualBox ✅ ✅ Managed VM ❌ ✅ Full Linux Kernel ❌ ✅ Full system call compatibility ❌ ✅ Performance across OS file systems ✅ ❌
WSL 2 is only available in 64-bit Windows 10 version 1903 build 18362.1049 or higher, OR Windows 10 version 2004 build 19041 or higher for ARM64 systems.
See also:
- Manual installation steps for older versions of WSL | Microsoft Docs
- Install WSL and update to WSL 2 | Microsoft Docs
- What's New in WSL 2? | Microsoft Docs
- Comparing WSL 1 and WSL 2 | Microsoft Docs
- WSL 2 FAQs | Microsoft Docs
- WSL 2 Support is coming to Windows 10 Versions 1903 and 1909 | Windows Command Line Blog
- WSL 2 will be generally available in Windows 10, version 2004 | Windows Command Line Blog
This tutorial will show you how to update from Windows Subsystem for Linux (WSL) to WSL 2 in Windows 10.
The process of updating from WSL to WSL 2 involves the following steps:
- Enable WSL
- Enable Virtual Machine Platform
- Set WSL 2 as default
- Install a distro
You must be signed in as an administrator to update from WSL to WSL 2.
Here's How:
1 Open an elevated PowerShell.
2 Copy and paste the command below into the elevated PowerShell, and press Enter to enable the WSL optional feature. (see screenshot below)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
3 Copy and paste the command below into the elevated PowerShell, and press Enter to enable the Virtual Machine Platform optional feature. (see screenshot below)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
4 Restart the computer to apply.
5 Open an elevated PowerShell.
6 Copy and paste the command below into the elevated PowerShell, and press Enter to set WSL 2 as the default version used when installing new Linux distributions. (see screenshot below)
wsl --set-default-version 2
You might see this message after running the command above:
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel.
If you do, please follow the link (https://aka.ms/wsl2kernel) and install the MSI from that page on Microsoft's documentation to install a Linux kernel on your machine for WSL 2 to use. Once you have the kernel installed, please run thewsl --set-default-version 2
command again and it should complete successfully without showing the message.The update from WSL 1 to WSL 2 may take several minutes to complete depending on the size of your targeted distribution. If you are running an older (legacy) installation of WSL 1 from Windows 10 Anniversary Update or Creators Update, you may encounter an update error. If you do, follow these instructions to uninstall and remove any legacy distributions.
7 You can now install and setup WSL distro apps from the Microsoft Store that will use WSL 2 by default.
The following links will open the Microsoft store page for each distribution:
That's it,
Shawn
Related Tutorials
- How to Enable or Disable Windows Subsystem for Linux (WSL) in Windows 10
- How to Install Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to Set Linux Distribution version to WSL 1 or WSL 2 in Windows 10