DEV Community

Taylor Beseda
Taylor Beseda

Posted on

Setup a Linux Dev Environment on Windows 10

Also published at my CollectedNotes.

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

Top comments (3)

habereder profile image
Raphael Habereder • Edited

Would you say the 1904 update is stable enough to roll out to a Dev machine?

I'm playing with the thought to migrate to wsl2, but it not being GA as of yet, I'm kind of hesitant to put a Dev machine (especially of the surface line) into the fast ring/insider preview.

tbeseda profile image
Taylor Beseda

Raphael, I've had a good experience on the "Slow Ring" of the Insider program. Currently on 19041.329. I use my machine mostly for dev and gaming. Though, it's not a Surface.

habereder profile image
Raphael Habereder

Thank you kindly for the reply. Guess I'll give it a shot on a non-essential system first, before I try to migrate my surface. I really don't want to brick this wonderful piece of tech but the last few big W10 updates had really stupid bugs..
WSL2 just promises too much productivity for me to wait another half year for GA.