Windows Subsystem Linux (WSL) is not automatically enabled on windows. So, to start, we need to enable it!
Now that we know your computer is ready for the rest of the environment setup, we can install Windows Subsystem for Linux (WSL) and the Ubuntu Linux distribution. You'll be doing the majority of your dev work using WSL and Ubuntu, so this step is critical to complete before moving ahead.
wsl --install -d Ubuntu
and press <Enter>
Note: If you encounter an error message that says "Ubuntu required feature not installed" then try enabling VSM in your BIOS. Follow this guide to access your BIOS and get to the virtualization settings. Enable VSM and virtualization options from there. Check out this issue for reference.
You are ready to install and set up the Ubuntu operating system! Ubuntu is a Linux-based operating system and this is the application we'll use to run the remainder of the environment setup.
<Enter>
(Note: usernames may not start with a number, and may not include
capital letters)<Enter>
(Note: you will not see any text when you are typing your password.)<Enter>
(Note: store this password somewhere safe. You will need it
to be able to run commands in the future)Now, the last line in your "Ubuntu" application should say your username + "@DESKTOP" + some random numbers and letters. If you see that, continue below.
Now that we have the Windows Subsystem for Linux (WSL) enabled and we have the "Ubuntu" application installed, we can update WSL to version 2 and update the "Ubuntu" application to use WSL 2.
wsl --set-default-version 2
into the terminal and press <Enter>
(Note: you should see a message starting with "For information on key
differences…")wsl --status
into the terminal and press <Enter>
. You should see a
message including "Default Version 2", which verifies that the default
version has been set correctly.wsl --set-version Ubuntu 2
into the terminal and press <Enter>
wsl --list --verbose
into the terminal and press <Enter>
. You should
see a message including "NAME Ubuntu VERSION 2", which verifies that the
default version has been set correctly.If you saw the "Conversion complete" or "This distribution is already the requested version" message in the "Command Prompt" application, close the "Command Prompt" application and continue below.
Note: If you encounter an error message that you need to enable the Virtual Machine Platform, but you've already enabled it, you may not be able to use WSL2. However, you may still be able to use WSL1. Run
wsl --set-default-version 1
, then runwsl --set-version Ubuntu 1
. Wait for the "Conversion complete" or "This distribution is already the requested version" message in the terminal, then continue on with these instructions.
<Control>
+ <Shift>
+ X
code
and press <Enter>
If the "Visual Studio Code" application opens when you type code
in the
"Ubuntu" application, continue to the next lesson, Installing Node.js on
WSL2.