A Comprehensive Guide to Installing and Using WSL (Windows Subsystem for Linux) on Windows 10
This article explains the shortcomings of Windows command‑line tools, introduces the Windows Subsystem for Linux (WSL), provides step‑by‑step instructions for installing WSL 1 and optional Linux distributions, shows how to improve the terminal experience, and details useful wsl.exe commands and system interoperability.
The Windows command line has historically lagged behind Unix‑like environments, making development on Windows less convenient for many front‑end engineers who rely on powerful CLI tools.
WSL (Windows Subsystem for Linux) is a compatibility layer that allows native Linux binaries to run on Windows 10, offering a full command‑line environment, file‑system interop, and, in WSL 2, an actual Linux kernel for better performance.
Installing WSL
WSL requires Windows 10 build 16215 or later; WSL 2 needs build 18917 and the Insider Fast channel. After enabling the feature, you can restart and verify your Windows version with winver .
Enable the feature via the UI (Settings → Apps → Optional Features) or with PowerShell as an administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
After a reboot, you can install a Linux distribution.
Installing a Linux Distribution
You can obtain distributions from the Microsoft Store or manually download .appx packages (e.g., Ubuntu, Debian, Kali, openSUSE). After renaming the .appx to .zip, extract it, locate the executable, and run it to complete the initial user setup.
Improving the Command‑Line Experience
Replace the default shell with zsh and set it as default:
sudo apt-get install -y zsh
chsh -s /bin/zsh
Install oh‑my‑zsh for configuration:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Consider using Windows terminal emulators such as cmder or Hyper for richer UI and Unicode support.
WSL Command‑Line Utilities
The primary command is wsl , which replaces both wsl.exe and wslconfig.exe . Useful invocations include:
wsl
wsl -d <DistributionName>
wsl -l
wsl -l --running
wsl ls -laSystem Interoperability
All Windows drives are mounted under /mnt/ in Linux, with varying permissions (e.g., Ubuntu uses 777). Linux files can be accessed from Windows via \\wsl$\Ubuntu-18.04 , though direct editing is discouraged.
Enabling WSL 2
Insiders can enable the Virtual Machine Platform feature:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Then set a distribution to version 2:
wsl --set-version <Distro> 2
WSL 2 offers faster performance and broader compatibility, but it is still pending for non‑Insider users.
For further reading, see the linked resources at the end of the article.
360 Tech Engineering
Official tech channel of 360, building the most professional technology aggregation platform for the brand.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.