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)
- Enable WSL, run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Enable "Virtual Machine Platform", run:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Download and install WSL 2 Linux kernel from Microsoft
- Restart Windows for good measure.
- Set default WSL to v2, run:
wsl --set-default-version 2
- Download your favorite Linux distro from the Microsoft Store (Yes, really. I searched for and installed "Ubuntu".)
- 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...
- Update to WSL 2
- Set v2 as default WSL
- List existing distros
- Upgrade existing distro
- Remove unwanted ("Legacy") distro with --unregister
Top comments (3)
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.
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.
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.