This guide is written for complete beginners who have never used Linux before.
WSL (Windows Subsystem for Linux) allows you to run a real Linux operating system inside Windows without installing a virtual machine or dual booting.
It gives Windows users access to Linux commands, programming tools, package managers, Node.js, Git, Docker, Python, C/C++, and many other developer tools.
Linux is the most popular operating system among software developers.
Anyone can view, modify, and improve Linux because its source code is publicly available.
Unlike many commercial operating systems, Linux is completely free.
Linux gives you complete control over your computer.
- Install only what you need
- Customize everything
- Better performance
- Better security
Millions of developers use Linux.
Whenever you face an error, chances are someone has already solved it.
Useful websites:
- Stack Overflow
- GitHub
- Linux Documentation
Linux powers
- Amazon AWS
- Netflix
- Android
- Super Computers
- Servers
- Cloud Infrastructure
Learning Linux is almost mandatory for modern software development.
Linux is the parent operating system.
Different organizations create their own versions called Distributions (Distros).
Popular ones include:
| Distro | Mostly Used For |
|---|---|
| Ubuntu | Web Development |
| Kali Linux | Cyber Security & Penetration Testing |
| Fedora | Desktop & Enterprise Development |
| Parrot OS | Ethical Hacking |
| Debian | Stable Servers |
| Arch Linux | Advanced Users |
For this course we will use:
because it is beginner friendly and widely supported.
Without WSL:
Windows β Install everything separately.
With WSL:
Windows + Linux together.
You get:
- Linux Terminal
- Ubuntu
- Bash
- Package Manager
- SSH
- Git
- Node.js
- Python
- Docker support
- C/C++
without leaving Windows.
Remove unnecessary software from Windows.
Open
Control Panel
or
Settings β Apps
Uninstall software you no longer use.
This frees storage before installing development tools.
Install Windows Terminal Preview
Open
Microsoft Store
Search
Windows Terminal Preview
Install it.
Why?
Because Windows Terminal provides
- Multiple tabs
- Better fonts
- Better Linux support
- Faster terminal
Enable WSL Features
Open Start Menu
Search
PowerShell
Right Click
Run as Administrator
Run the following command.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartWhat this does:
- Enables Linux support inside Windows.
Now enable Virtual Machine Platform.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartThis installs the virtualization layer required for WSL2.
Restart your computer.
Download WSL Update Package
Download:
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
Install it normally.
Enable Virtual Machine Platform
Open PowerShell (Admin)
Run
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatformRestart again if asked.
Install Ubuntu
Open PowerShell
Run
wsl --installWhat it does:
- Downloads WSL
- Downloads Ubuntu
- Configures Linux automatically
Install Ubuntu 24.04
wsl --install -d Ubuntu-24.04Set WSL2 as default.
wsl --set-default-version 2Check installed distributions.
wsl --list --verboseExample output
NAME STATE VERSION
Ubuntu-24.04 Running 2
Version should be 2.
Open Ubuntu
Search
Ubuntu
Open it.
Wait around
2-3 minutes
The first launch installs Ubuntu.
Eventually it asks
Enter new UNIX username:
Example
suhail
Then
New Password:
Type your password.
Password will NOT be visible while typing.
Retype the password.
Done.
Keep both the username and password the same.
Example
Username
suhail
Password
suhail
This makes it easier for beginners.
Verify Ubuntu Setup
Every time Ubuntu opens, you should see something similar to
suhail@DESKTOP-XXXX:~$
Your username appears in green.
If Ubuntu never asked for username/password during setup, something likely went wrong and you should reinstall Ubuntu.
Configure Windows Terminal
Open
Windows Terminal Preview
Click
βΌ
then
Settings
Set
Ubuntu 24.04
Set
Windows Terminal Preview
Click
Save
Now every new terminal opens directly into Ubuntu.
You can now install developer tools.
Linux installs software using a package manager.
Ubuntu uses
APT
sudo apt updateWhat it does:
- Connects to Ubuntu servers
- Downloads the latest list of available software
- Does not install anything
- Simply refreshes the package database
Think of it like refreshing the App Store before downloading an app.
Example output
Hit:1 http://archive.ubuntu.com
Reading package lists...
Done
sudo apt upgradeWhat it does:
- Checks for updates to software already installed on your computer
- Downloads newer versions
- Installs security patches
- Updates libraries
Example
Node
Git
Python
Libraries
all get updated if newer versions exist.
Instead of running both separately, developers usually run:
sudo apt update && sudo apt upgradeThe && operator means:
Run the second command only if the first command succeeds.
So this:
sudo apt update && sudo apt upgrademeans:
- Refresh package list.
- If successful, update installed software.
This is one of the most common Linux commands.
sudo
stands for
Super User DO
It temporarily gives administrator (root) permissions.
Some tasks require elevated permissions, such as:
- Installing software
- Updating packages
- Changing system files
When you run a command with sudo, Ubuntu will ask for your password.
Example:
sudo apt updateEnter your password (it will not be shown as you type) and press Enter.
apt stands for Advanced Package Tool.
It is Ubuntu's package manager and is used to:
- Install software
- Update software
- Remove software
- Search for software
Examples:
sudo apt install gitsudo apt remove gitapt search nodejsNVM = Node Version Manager
It lets you install multiple versions of Node.js and switch between them easily.
Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bashcurldownloads data from the internet.-o-sends the downloaded script to the terminal.|(pipe) passes that output to another command.bashexecutes the downloaded installation script.
Close the terminal.
Open it again.
This reloads your shell configuration so the nvm command becomes available.
Install Node.js 22
nvm install 22NVM downloads and installs Node.js version 22.
Verify Node.js
node -vExample output
v22.x.x
Verify npm
npm -vExample
10.x.x
If both commands display version numbers, Node.js and npm are installed successfully.
Install iTerm2.
Open Terminal.
Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bashInstall Node
nvm install 22Restart Terminal.
Check
node -vnpm -vDownload Visual Studio Code.
Install it.
Open VS Code.
Install the following:
- WSL (Ubuntu users)
- Prettier
- Auto Close Tag
- JavaScript (ES6) Code Snippets
- VSCode Icons
- Live Server / Live Preview
- Path IntelliSense
- Prettify JSON
Open
Settings
Go to
Themes
Choose any color theme you like.
Update packages
sudo apt updateInstall GCC
sudo apt install build-essentialIt is a package that installs the essential tools required to compile C and C++ programs, including:
- GCC (GNU Compiler Collection)
- G++
- Make
- Standard libraries
Check the compiler version
gcc --versionNote: The correct command is
gcc --version(two hyphens), notgcc -version.
Create a C program
nano hello.cPaste
#include<stdio.h>
int main()
{
printf("Hello World");
return 0;
}Save the file and exit.
Compile the program
gcc hello.cThis creates an executable named a.out.
Run it
./a.outExpected output
Hello World
Install Apple's developer tools:
xcode-select --installVerify the compiler:
clang --versionOpen VS Code.
Press:
Ctrl + Cmd + P
Type:
Shell Command:
Install 'code' command in PATH
Select it.
Open iTerm2 and run:
code .This opens the current folder in VS Code.
Open VS Code.
Click the Remote Explorer icon on the left sidebar.
Select:
Ubuntu 24.04
Click the arrow to connect.
When connected successfully, you'll see Ubuntu 24.04 displayed in blue at the bottom-left of the VS Code window.
| Command | Purpose |
|---|---|
pwd |
Show current directory |
ls |
List files and folders |
ls -la |
Show all files (including hidden) with details |
cd folder |
Enter a directory |
cd .. |
Go back one directory |
mkdir test |
Create a new folder |
touch file.txt |
Create an empty file |
rm file.txt |
Delete a file |
rm -r folder |
Delete a folder recursively |
clear |
Clear the terminal screen |
history |
Show previously executed commands |
whoami |
Display the current username |
exit |
Close the terminal |
code . |
Open the current folder in VS Code |
You now have a complete Linux development environment with:
- β WSL2 installed
- β Ubuntu 24.04 configured
- β Windows Terminal set up
- β Node.js and npm installed using NVM
- β Visual Studio Code configured
- β GCC compiler installed
- β VS Code connected to WSL
- β Basic Linux commands learned
You're now ready to start building software using a professional Linux-based development workflow.