3 homepage: https://docs.microsoft.com/en-us/windows/wsl/wsl2-index
5 WSL2 (Windows Subsystem for Linux 2) runs a true Linux kernel via Hyper-V emulation.
10 > WSL 2 uses `VirtualMachinePlatform` and Hyper-V to run a full Linux kernel
11 > with 100% syscall compatibility.
13 After installing WSL and **Rebooting** you will be able to install Linux
14 variants from the Windows 10 Store:
16 - [Ubuntu Linux 20.04](https://www.microsoft.com/store/apps/9n6svws3rx71)
17 - [Alpine WSL](https://www.microsoft.com/store/apps/9p804crf0395)
19 ### Admin Privileges Required
21 It is not possible to install WSL without Admin privileges.
23 You _will_ need to allow the installer to run as Admin when asked.
27 You will not be able to use WSL without rebooting.
29 ### How to Install Linux Bash
31 You can download Linux from the Windows Store, or from the Command Line:
34 curl.exe -L -o Ubuntu_2004_x64.appx https://aka.ms/wslubuntu2004
35 powershell Add-AppxPackage Ubuntu_2004_x64.appx
38 See also <https://docs.microsoft.com/en-us/windows/wsl/install-manual>.
40 ### How to Switch Between WSL 1 and WSL 2
42 Despite the name, WSL 2 is neither a "better" version of nor a replacement for
43 WSL 1. Rather WSL 1 uses a syscall wrapper (much like WINE) whereas WSL 2 uses
44 Hyper-V virtualization.
46 After rebooting you can set WSL 2 as the default:
49 wsl --set-default-version 2
52 You can list your existing WSL Linuxes:
58 And you can switch between using WSL and WSL 2 without an issues:
61 wsl --set-version Ubuntu 2
64 See also <https://docs.microsoft.com/en-us/windows/wsl/wsl2-index>.
66 ### Raw PowerShell Install Commands
68 If you'd like to install manually, or create your own script, this is how we do
73 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
75 # Install VirtualMachinePlatform
76 dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
78 # Download and Install WSL Update (contains Microsoft Linux kernel)
79 & curl.exe -f -o wsl_update_x64.msi "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi"
80 powershell -Command "Start-Process msiexec -Wait -ArgumentList '/a wsl_update_x64.msi /qb TARGETDIR=""$env:TEMP""'"
81 Copy-Item -Path "$env:TEMP\System32\lxss" -Destination "C:\System32" -Recurse
84 See also <https://github.com/microsoft/WSL/issues/5014>
88 WSL2 may not work properly if you are already running Windows inside of a
89 Virtual Machine, especially if MacOS or Linux is the VM Host.
93 - https://docs.microsoft.com/en-us/windows/wsl/install-win10
94 - https://github.com/microsoft/WSL/issues/5014
95 - https://docs.microsoft.com/en-us/windows/wsl/wsl2-index
96 - https://aka.ms/wsl2kernel
97 - https://docs.microsoft.com/en-us/windows/wsl/install-manual