How to install or reinstall Windows Subsystem for Linux

The Windows 10 Creators Update brought Ubuntu 16.04 in Windows Subsystem for Linux to general Windows users. Windows Subsystem for Linux makes Windows far more 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.

Install Windows Subsystem for Linux

  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.

How to Reinstall Windows Subsystem for Linux

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). From WindowsCommand Prompt:

lxrun /uninstall

lxrun /install

Reference

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

Error: 0x80040154

especially if you’ve just upgraded to a new Windows Build, be sure that under #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.