Setup a Linux Dev Environment on Windows 10

Also published at Dev.to.

Largely sourced from the official Microsoft docs.

Win 10 Build Requirement

You must be running Windows 10 build 1904 or higher (run ver from cmd.exe to check).

A Fresh WSL Install

From PowerShell with Admin access (right click PowerShell or a PowerShell shortcut and Run as Administrator)

  1. Enable WSL, run: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  2. Enable "Virtual Machine Platform", run: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  3. Download and install WSL 2 Linux kernel from Microsoft
  4. Restart Windows for good measure.
  5. Set default WSL to v2, run: wsl --set-default-version 2
  6. Download your favorite Linux distro from the Microsoft Store (Yes, really. I searched for and installed "Ubuntu".)
  7. Launch and set up Linux by running wsl

And you're off to the races! From here, I'm able to install Node.js, Typescript, Yarn, etc.

Upgrading from WSL 1

Instructions a work in progress...

  1. Update to WSL 2
  2. Set v2 as default WSL
  3. List existing distros
  4. Upgrade existing distro
  5. Remove unwanted ("Legacy") distro with --unregister

over 1 year ago

Taylor Beseda