Skip to content
Snippets Groups Projects
wsl.md 1.87 KiB
Newer Older
  • Learn to ignore specific revisions
  • Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    
    # WSL
    
    First open Powershell as administrator and launch the following command:
    
    ```powershell
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    ```
    
    This command will install WSL on your computer. After this, you'll need to ==**reboot**==.
    
    ## Upgrade to WSL 2
    
    If you're on WSL 1 and want to upgrade to WSL 2, here is the process:
    
    1. Open an elevated powershell and paste the following command:
    
        ```powershell
        dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
        ```
    
    2. Then, enable the Virtual Machine Platform optional feature.
    
        ```powershell
        dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
        ```
    
    3. Now restart your computer to apply these features. Once it's done, open an elevated powershell again and set the default wsl version to 2
    
        ```sh
        wsl --set-default-version 2
        ```
    
    !!! warning "You might see this message after running the command above"
        WSL 2 requires an update to its kernel component.
        For information please visit [wsl2kernel](https://aka.ms/wsl2kernel).
    
    If you install the MSI from [wsl2kernel](https://aka.ms/wsl2kernel). Once you have the kernel installed, please run `wsl --set-default-version 2` again and it should complete successfully without showing the message.
    
    ## Start WSL
    
    After reboot, open the microsoft store and install the distribution of your choice, for instance: ==Ubuntu 20.04 lts==. Once it's done, open it and after a few minutes you'll be prompted for the creation of a user account.
    
    To make sure it's correctly installed and working, you can open Powershell and paste the following command :
    
    ```powershell
    wsl.exe --list --running
    ```
    
    Now you should see the name of your distribution in the list. And follow [set_up_your_environment](setup_your_environment.md#install-your-linux-distribution)