Installing the Linux Subsystem on Windows 10 (WSL)

Overview

WSL provides a Linux-compatible kernel interface developed by Microsoft (containing no Linux kernel code), which can then run a GNU user space on top of it, such as that of Ubuntu, openSUSE, SUSE Linux Enterprise Server, Debian and Kali Linux. Such a user space might contain a Bash shell and command language, with native GNU/Linux command-line tools (sed, awk, etc.), programming language interpreters (Ruby, Python, etc.), and even graphical applications (using a X11 server at the host side).

Turn on the subsystem in PowerShell

Before installing any Linux distros for WSL, you must ensure that the “Windows Subsystem for Linux” optional feature is enabled:

Open PowerShell as Administrator and run:


Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Press Y, then Enter to restart your computer when prompted. Your PC will restart instantly, so be sure to save any work beforehand.

Install your Linux Distribution of Choice

To download and install your preferred distro(s), you have three choices:

  1. Download and install from the Windows Store
  2. Download and install from the Command-Line/Script
  3. Download and manually unpack and install

Windows 10 Fall Creators Update and later: Install from the Microsoft Store

This section is for Windows build 16215 or later.

Install Linux for Windows App from Microsoft store

Open the Microsoft Store and choose your favorite Linux distribution.

https://www.microsoft.com/en-us/store/apps

Click the Get button to download the distro.


Click Install to start the installing process


Downloading Ubuntu…


Initializing a newly installed distro

Once your distro has been downloaded and installed, you’ll need to complete initialization of the new distro:

Launch a distro

To complete the initialization of your newly installed distro, launch a new instance. You can do this by clicking the “launch” button in the Windows Store app, or launching the distro from the Start menu:

Tip: You might want to pin your most frequently used distros to your Start menu, and/or to your taskbar


Setting up a new Linux user account

Once installation is complete, you will be prompted to create a new user account (and its password).

This user account is for the normal non-admin user that you’ll be logged-in as by default when launching a distro.

You can choose any username and password you wish – they have no bearing on your Windows username.

When you open a new distro instance, you won’t be prompted for your password, but if you elevate a process using sudo, you will need to enter your password, so make sure you choose a password you can easily remember!


You now have the Windows Linux Subsystem installed, providing a bash shell on your Windows 10 machine.

Update & upgrade your distro’s packages

Most distros ship with an empty/minimal package catalog. Microsoft strongly recommend regularly updating your package catalog, and upgrading your installed packages using your distro’s preferred package manager. On Debian/Ubuntu, you use apt:

sudo apt update && sudo apt upgrade


Conclusion

Windows does not automatically update or upgrade your Linux distro(s): This is a task that the Linux users prefer to control themselves.

You’re done! Enjoy using your new Linux distro on WSL!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s