- Assure you have the latest Windows 10 release.
- Open PowerShell as administrator.
- Run this command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Restart when prompted.
- Download your choice of WSL from the Windows Store, e.g. Ubuntu
- Click on Ubuntu from the Start window to install it.
- Enter new username and password.
- End.
Detailed explanation:
1- First, assure that your Windows 10 is up to date
You can do this by clicking on
WIN + i,
and then select
Update & Security,
then press
Check for Updates.
2- Now, open PowerShell as an administrator
The easiest way is to open PowerShell is to press the
WIN +
x key combination. From there you can select to open PowerShell as an administrator.
3- Enable the Windows optional feature shown below
At the PowerShell terminal type the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Reference:
docs.microsoft.com
4- Restart the computer when prompted
Let it run. Then, restart the computer when the restart message is displayed in the terminal.
5- Download Ubuntu from the Windows Store
After the computer starts, log in and visit the Windows Store to download Ubuntu or other Linux distros if available.
The download is
free, but you still need to log into your Microsoft account to download Ubuntu.
6- Open Ubuntu
To start Ubuntu, open the Windows Start window and click on the Ubuntu icon.
Installation will start.
7- Create a terminal user account
Next, you will be asked to create a username and enter a password. This is the main Ubuntu user, but you can add other users later.
You'll find more about users in the following URL:
docs.microsoft.com
8- Enjoy it
When the installation ends, you may play with it or just write
exit to close the Bash terminal.
Next time you want to use Bash, click on the Ubuntu icon again.
I hope this helps,
Tony de Araujo
Further research and updates
a) Running Ubuntu shell from within PowerShell
Once WSL is installed, you can also access the Linux shell by typing
wsl ENTER from within PowerShell.
To exit, type
exit ENTER.
b) Upgrading to WSL 2
At the time of this post, WSL 2 is only available with Windows build 18917 or higher.
Unless you have joined the Windows Insider Program, you will not have this Windows version yet.
To verify which Windows build you currently have, press the key combination
WIN i.
Then, click
System, and at the bottom, select
About.
You will see your current Windows version and build number in there.
If your build is 18917 or higher, read the instructions in the following official URL to install WSL 2 . You can use both versions WSl and WSL 2 in your system and toggle from one to the other.
c) Visual Studio Code users
If you use Visual Studio Code, you may want to visit the following VSC page for some tips on how to use the Windows Subsystem for Linux (WSL) as your full-time development environment right from VS Code:
Best of luck,