Home Enable Linux Bash Shell in Windows 10
Post
Cancel

Enable Linux Bash Shell in Windows 10

Table of Contents

Microsoft introduced Windows Subsystem for Linux (WSL), a free, optional feature of Windows 10 that allows Linux programs to run on Windows. It provides you with a Windows version of the bash shell and a compatibility layer that permits many Linux programs to run natively on your Windows machine. WSL is available only in 64-bit versions of Windows 10 from version 1607. It is also available in Windows Server 2019.

  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. Type the following command to enable the Linux subsystem and press Enter:
    1
    2
    3
    4
    
     Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart -OutVariable results
     if ($Results.RestartNeeded -eq $true) {
     Restart-Computer -Force
     }
    
  4. Open Start
  5. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  6. Type the following command to select the download folder and press Enter:
    1
    
     Set-Location $env:UserProfile\Downloads
    
  7. Type one of the the following command to download Ubuntu and press Enter:

    • Ubuntu 16.04: https://aka.ms/wsl-ubuntu-1604
      1
      
        Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu1604.appx -UseBasicParsing
      
    • Ubuntu 18.04: https://aka.ms/wsl-ubuntu-1804
      1
      
        Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu1804.appx -UseBasicParsing
      
    • Debian: https://aka.ms/wsl-debian-gnulinux
      1
      
        Invoke-WebRequest -Uri https://aka.ms/wsl-debian-gnulinux -OutFile Debian.appx -UseBasicParsing
      
    • openSUSE: https://aka.ms/wsl-opensuse-42
      1
      
        Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile openSUSE.appx -UseBasicParsing
      
    • SLES: https://aka.ms/wsl-sles-12
      1
      
        Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile SLES.appx -UseBasicParsing
      
  8. Type the following command to view the actual name of the installer and press Enter:
    1
    
     Get-ChildItem
    

    Type the following command to install Ubuntu version 16.04 and press Enter:

    1
    
     Add-AppxPackage .\APP-NAME.appx
    

    This example installs the Ubuntu distro on Windows 10:

    1
    
     Add-AppxPackage .\Ubuntu1804.appx
    
  9. Open Start
  10. Search for the recently distribution Linux distribution (for example, Ubuntu), click the top result to launch the experience.
  11. Create a username for the Linux distro and press Enter.
  12. Specify a password for the distro and press Enter.
  13. Repeat the password and press Enter to confirm.

After you complete the steps, you can start using Ubuntu or any other distro as you would on a full installation of Linux without a graphical interface.

https://docs.microsoft.com/en-us/windows/wsl/install-win10
This post is licensed under CC BY-SA 4.0 by David Marker