How to install or reinstall Windows Subsystem for Linux

Microsoft’s official procedure for installing Windows Subsystem for Linux.

Windows Subsystem for Linux actually makes Windows somewhat useful for those unwilling/unable to use Linux directly. You can use X11 GUI Linux apps on WSL and Anaconda Python and Spyder from WSL.

WSL Prereqs

64-bit Windows 10, Build 14393 or higher (preferably 14396 or higher)

WSL install procedure

  1. enable Developer Mode: Settings > Update and Security > For developers > Developer mode
  2. Start > Turn Windows features on or off > Windows Subsystem for Linux (beta)
  3. reboot PC
  4. from Command Prompt, type bash.
  5. a “Bash on Ubuntu on Windows” icon is created, perhaps pin it to your Start Menu for convenience.

Reinstall WSL

You might want to reinstall WSL if you’re getting errors, or want to upgrade Ubuntu versions on a new Windows Build (e.g. Ubuntu 14.04 to 16.04) Normally from Command Prompt do

lxrun /uninstall
lxrun /install

If you get Error: 0x80040154

especially if you’ve just upgraded to a new Windows Build, be sure that under Step 2 above, Windows Subsystem for Linux (beta) is still checked. If it was checked, uncheck it, reboot, and check it again, then try to reinstall WSL again.