Beginning Windows 10 Anniversary Update, Windows beloved by hackers and developers again with the Windows Subsystem for Linux. Windows has a great open source experience more than ever. Plus, beginning the release of the Windows 10 2004 release, WSL 2 takes flight to everyone’s place with the real Linux kernel, not the emulated one.
I understand that Microsoft wants to deliver their WSL experiences into a delightful manner through the Microsoft Store. However, this way seems quite dangerous. Why dangerous? Because the store app does not sustain the local data. Even in Windows 10, it is just like the iOS or Android environment. You can accidentally remove or initialize your Ubuntu distro at any time.
So, I suggest you install your WSL distro manually, instead of downloading it through the Microsoft Store.
But how can you do that? It’s simple — install your WSL distro manually.
Install Your WSL Distro Manually
I will elaborate on the manual steps of the WSL installation.
First, find your favorite WSL distros on the Microsoft docs page. Microsoft provides official WSL distros docs page, not only the Microsoft Store. The reason is this page intended for server-side WSL installation. But you can use the manual installation step for your Windows 10 environment too.
Manually download Windows Subsystem for Linux (WSL) Distros
There are several scenarios in which you may not be able (or want) to, install WSL Linux distros via the Microsoft…
I will choose Ubuntu 18.04 for this guide.
Then, Open your PowerShell as an administrative mode with your favorite terminal and run the PowerShell scripts.
# Change your directory into the Download folder.
Set-Location -Path $env:USERPROFILE\Downloads# Set this variable as your distro download URL.
$TargetUri = "https://aka.ms/wsl-ubuntu-1804"# Download the file. If the BITS transfer not working, use the curl.exe or Invoke-WebRequest instead. Also, PowerShell cannot extract the archive if the file has .appx package format.
Start-BitsTransfer -Source $TargetUri -Destination .\ubuntu.zip# I'm using the directory path as 'C:\Distro', but you can change your directory path as your intention.
New-Item -Type Container -Path C:\Distro\Ubuntu# Extract the archive file.
Expand-Archive -Path .\ubuntu.zip -DestinationPath C:\Distro\Ubuntu# Remove the downloaded archive file.
Remove-Item -Path .\ubuntu.zip# Change the directory
Set-Location -Path $env:SYSTEMDRIVE\Distro\Ubuntu# Run the distro and initial setup process will begin.
If you want to use the WSL version 2 (and ensure that you have installed the latest version of Windows Insider Preview or Windows 10 2004 release), please set your default WSL version as ‘2’ before running distro.
wsl --set-default-version 2
That’s it! After installation completed, you can find your WSL distro installed firmly into your system. You can use your WSL distro independently from the Store. 😊
WSL Distro Manager
With this approach, you can set up and manage multiple distros on your computer. If you want to manage your distros in graphical interfaces, you can consider using my open-source solution, the WSL Distro Manager.
This project still under active development. All contributions welcomed. :-)
I learned some lessons from your feedback. Thank you.
- I removed the example case because it does not make sense.
- I changed the title of this article to prevent misunderstanding.