|
1 | | ---- |
2 | | -title: Install WSL 2 |
3 | | -description: Installation instructions for WSL 2 |
4 | | -keywords: BashOnWindows, bash, wsl, wsl2, windows, windows subsystem for linux, windowssubsystem, ubuntu, debian, suse, windows 10, install |
5 | | -ms.date: 05/30/2019 |
6 | | -ms.topic: article |
7 | | -ms.assetid: 7afaeacf-435a-4e58-bff0-a9f0d75b8a51 |
8 | | -ms.custom: seodec18 |
9 | | ---- |
10 | | - |
11 | | -# Installation Instructions for WSL 2 |
12 | | - |
13 | | -To install and start using WSL 2 complete the following steps: |
14 | | - |
15 | | -> WSL 2 is only available in Windows 10 builds 18917 or higher |
16 | | -
|
17 | | -- Ensure that you have WSL installed (you can find instructions to do so [here](./install-win10.md)) and that you are running Windows 10 **build 18917** or higher |
18 | | - - To make sure you are using build 18917 or higher please join [the Windows Insider Program](https://insider.windows.com/en-us/) and select the 'Fast' ring. |
19 | | - - You can check your Windows version by opening Command Prompt and running the `ver` command. |
20 | | -- Enable the 'Virtual Machine Platform' optional component |
21 | | -- Set a distro to be backed by WSL 2 using the command line |
22 | | -- Verify what versions of WSL your distros are using |
23 | | - |
24 | | -## Enable the 'Virtual Machine Platform' optional component and make sure WSL is enabled |
25 | | - |
26 | | -Open PowerShell as an Administrator and run: |
27 | | - |
28 | | -```powershell |
29 | | -Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux |
30 | | -Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform |
31 | | -``` |
32 | | - |
33 | | -This will make sure that both the Virtual Machine Platform and Windows Subsystem for Linux optional components are installed. After you've run these commands you'll need to restart your computer. |
34 | | - |
35 | | -## Set a distro to be backed by WSL 2 using the command line |
36 | | - |
37 | | -In PowerShell run: |
38 | | - |
39 | | -`wsl --set-version <Distro> 2` |
40 | | - |
41 | | -and make sure to replace `<Distro>` with the actual name of your distro. (You can find these with the command: `wsl -l`). You can change back to WSL 1 at anytime by running the same command as above but replacing the '2' with a '1'. |
42 | | - |
43 | | -Additionally, if you want to make WSL 2 your default architecture you can do so with this command: |
44 | | - |
45 | | -`wsl --set-default-version 2` |
46 | | - |
47 | | -This will make any new distro that you install be initialized as a WSL 2 distro. |
48 | | - |
49 | | -## Finish with verifying what versions of WSL your distro are using |
50 | | - |
51 | | -To verify what versions of WSL each distro is using use the following command (only available in Windows Build 18917 or higher): |
52 | | - |
53 | | -`wsl --list --verbose` or `wsl -l -v` |
54 | | - |
55 | | -The distro that you've chosen above should now display a '2' under the 'version' column. Now that you're finished feel free to start using your WSL 2 distro! |
56 | | - |
57 | | -## Troubleshooting: |
58 | | - |
59 | | -Below are related errors and suggested fixes when installing WSL 2. Please refer to the [WSL troubleshooting page](troubleshooting.md) for other general WSL errors and their solutions. |
60 | | - |
61 | | -* **Installation failed with error 0x80070003 or error 0x80370102** |
62 | | - * Please make sure that virtualization is enabled inside of your computer's BIOS. The instructions on how to do this will vary from computer to computer, and will most likely be under CPU related options. |
63 | | - |
64 | | -* **Error when trying to upgrade: `Invalid command line option: wsl --set-version Ubuntu 2`** |
65 | | - * Please make sure that you have the Windows Subsystem for Linux enabled, and that you're using Windows Build version 18917 or higher. To enable WSL run this command in a Powershell prompt with admin privileges: `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`. You can find the full WSL install instructions [here](./install-win10.md). |
66 | | - |
67 | | -* **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.** |
| 1 | +--- |
| 2 | +title: Install WSL 2 |
| 3 | +description: Installation instructions for WSL 2 |
| 4 | +keywords: BashOnWindows, bash, wsl, wsl2, windows, windows subsystem for linux, windowssubsystem, ubuntu, debian, suse, windows 10, install |
| 5 | +ms.date: 05/30/2019 |
| 6 | +ms.topic: article |
| 7 | +ms.assetid: 7afaeacf-435a-4e58-bff0-a9f0d75b8a51 |
| 8 | +ms.custom: seodec18 |
| 9 | +--- |
| 10 | + |
| 11 | +# Installation Instructions for WSL 2 |
| 12 | + |
| 13 | +To install and start using WSL 2 complete the following steps: |
| 14 | + |
| 15 | +> WSL 2 is only available in Windows 10 builds 18917 or higher |
| 16 | +
|
| 17 | +- Ensure that you have WSL installed (you can find instructions to do so [here](./install-win10.md)) and that you are running Windows 10 **build 18917** or higher |
| 18 | + - To make sure you are using build 18917 or higher please join [the Windows Insider Program](https://insider.windows.com/en-us/) and select the 'Fast' ring. |
| 19 | + - You can check your Windows version by opening Command Prompt and running the `ver` command. |
| 20 | +- Enable the 'Virtual Machine Platform' optional component |
| 21 | +- Set a distro to be backed by WSL 2 using the command line |
| 22 | +- Verify what versions of WSL your distros are using |
| 23 | + |
| 24 | +## Enable the 'Virtual Machine Platform' optional component and make sure WSL is enabled |
| 25 | + |
| 26 | +To enable the 'Virtual Machine Platform' component open PowerShell as an administrator and run the command below. If you are installing WSL for the first time then select 'No' when prompted for a restart, as you will need to restart your machine anyway after installing the 'Windows Subsystem for Linux' optional component. |
| 27 | + |
| 28 | +```powershell |
| 29 | +Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform |
| 30 | +``` |
| 31 | + |
| 32 | +You will also need to make sure that the Windows Subsystem for Linux optional component is enabled. You can do this by running the following command from a PowerShell window with administrator privileges: |
| 33 | + |
| 34 | +```powershell |
| 35 | +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux |
| 36 | +``` |
| 37 | + |
| 38 | +Please restart your machine to finish installing both components. |
| 39 | + |
| 40 | + |
| 41 | +## Set a distro to be backed by WSL 2 using the command line |
| 42 | + |
| 43 | +In PowerShell run: |
| 44 | + |
| 45 | +`wsl --set-version <Distro> 2` |
| 46 | + |
| 47 | +and make sure to replace `<Distro>` with the actual name of your distro. (You can find these with the command: `wsl -l`). You can change back to WSL 1 at anytime by running the same command as above but replacing the '2' with a '1'. |
| 48 | + |
| 49 | +Additionally, if you want to make WSL 2 your default architecture you can do so with this command: |
| 50 | + |
| 51 | +`wsl --set-default-version 2` |
| 52 | + |
| 53 | +This will make any new distro that you install be initialized as a WSL 2 distro. |
| 54 | + |
| 55 | +## Finish with verifying what versions of WSL your distro are using |
| 56 | + |
| 57 | +To verify what versions of WSL each distro is using use the following command (only available in Windows Build 18917 or higher): |
| 58 | + |
| 59 | +`wsl --list --verbose` or `wsl -l -v` |
| 60 | + |
| 61 | +The distro that you've chosen above should now display a '2' under the 'version' column. Now that you're finished feel free to start using your WSL 2 distro! |
| 62 | + |
| 63 | +## Troubleshooting: |
| 64 | + |
| 65 | +Below are related errors and suggested fixes when installing WSL 2. Please refer to the [WSL troubleshooting page](troubleshooting.md) for other general WSL errors and their solutions. |
| 66 | + |
| 67 | +* **Installation failed with error 0x80070003 or error 0x80370102** |
| 68 | + * Please make sure that virtualization is enabled inside of your computer's BIOS. The instructions on how to do this will vary from computer to computer, and will most likely be under CPU related options. |
| 69 | + |
| 70 | +* **Error when trying to upgrade: `Invalid command line option: wsl --set-version Ubuntu 2`** |
| 71 | + * Please make sure that you have the Windows Subsystem for Linux enabled, and that you're using Windows Build version 18917 or higher. To enable WSL run this command in a Powershell prompt with admin privileges: `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`. You can find the full WSL install instructions [here](./install-win10.md). |
| 72 | + |
| 73 | +* **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.** |
68 | 74 | * Please check [WSL Github thread #4103](https://github.com/microsoft/WSL/issues/4103) where this issue is being tracked for updated information. |
0 commit comments