WSL 1 is fantastic, but lacks some of the features (namely fstab
mounting) that WSL 2 brings to the table. WSL and WSL 2 are a bit confusing to set up because of the lack of centralization; “Go to the Windows Features panel, then download this random EXE from a browser…”.
There are multiple ways to go about conducting this, but here’s the simplest way to set up both versions.
Install WSL 1
Open PowerShell as administrator (Shortcut: Windows + x, then hit a, then Alt + y).
Put these two commands into the PowerShell window:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Hit enter a few times.
Once the commands are done running, restart your computer. Yes, you’re still forced to restart Windows in 2022 for feature additions.
Now, you must choose a distro. I prefer Debian. The other installations are the same process, so choose whatever. You have two options depending on your Windows 10 version:
- Windows Store download (the easiest)
- Internet download ->
Add-AppxPackage
import (for Windows 10 LTSC users)
Windows Store Method
Just type the distro you want into the search bar – like Ubuntu – and hit the installation button. When that’s done, open the distro EXE you downloaded from the MS store and go through the installation process. You can find it by hitting the Start button and typing the distro name.
Internet Download
Skip this step if you’ve already done the Windows Store Method.
Click one of these distro links:
That should be all of the officially supported ones hosted by Microsoft.
After the download, open a PowerShell window as administrator once again. Then, navigate to the directory you downloaded the appx file at (probably your downloads directory), then run the following command (note: the file name will be different depending on your distro):
Add-AppxPackage Debian.appx
Then, run the newly installed EXE on your system. If you installed Debian, run the Debian program, if you installed Ubuntu, run the Ubuntu program, and so on. Go through the setup process until your new user is created.
That’s WSL 1 + distro installation complete. Now we can convert this WSL 1 distro to WSL 2 to get those oh-so-fantastic features.
WSL 2 Installation
Open a PowerShell window as administrator once again. Run the following command (note: the file name will be different depending on your distro):
wsl --set-version Debian 2
This will take a minute, but once it’s done, you’ll have WSL 2. Easy as that.