Getting Started with Linux Fundamentals on Windows Using WSL
If you’re eager to dive into the world of Linux fundamentals but don’t want to deal with setting up virtualization software like VirtualBox, VMware, or Hyper-V, and you also prefer not to rely on online platforms like KillerCoda.com that require internet connectivity, don’t worry—you’re not out of options.
With a Windows operating system, you can use Windows Subsystem for Linux (WSL). This powerful feature allows you to run Linux distributions natively on your Windows PC without the need for complex setups. Let’s dive in!
What is WSL?
Windows Subsystem for Linux (WSL) is a compatibility layer that enables Windows users to run a Linux kernel and distributions directly within Windows. It provides a Linux experience without the overhead of virtualization or the need for dual-boot setups.
With WSL, you can:
Run Linux commands and tools natively.
Use Linux file systems alongside Windows.
Practice and learn Linux without leaving your familiar Windows environment.
Step 1: Install WSL on Windows
To start with WSL, follow these steps:
1. Check Your Windows Version
WSL is supported on:
Windows 10 (Version 2004 or later).
Windows 11.
To check your Windows version:
Press
Win + R
, typewinver
, and press Enter.Ensure your version meets the requirements.
2. Enable WSL
Open PowerShell as Administrator.
Run the following command to enable WSL and install the latest version (WSL 2):
wsl --install
This command Installs WSL, sets WSL 2 as the default version, and installs the default Linux distribution (Ubuntu).
Restart your computer if prompted.
- Verify Installation
Once your PC restarts, verify WSL is installed by running:
wsl --list --verbose
Step 2: Choose and Install a Linux Distribution
By default, the Ubuntu Linux distribution is installed. However, WSL supports various Linux distributions, allowing you to choose the one you prefer.
Available Linux Distributions for WSL
Here are some popular distributions you can install:
Ubuntu: A beginner-friendly and widely-used distro.
Debian: Known for its stability.
Kali Linux: Great for penetration testing and cybersecurity.
Fedora: A cutting-edge distro with the latest features.
OpenSUSE: A solid choice for both servers and desktops.
Alpine Linux: A lightweight and minimalistic option.
To view all available distributions:
wsl --list --online
Install a Specific Distro
For example, to install Debian:
wsl --install -d Ubuntu
Step 3: Launch Your Linux Distribution
After installing a distribution:
Open the Start Menu and search for your Linux distribution (e.g., Ubuntu). Click to launch it. On the first launch: The system will complete the installation. You’ll be prompted to create a username and password for the Linux environment.
Once completed, you’re ready to start using Linux on Windows!
Step 4: Basic Linux Commands for Beginners
Here are some fundamental commands to get you started:
Navigation
ls
– List files and directories.cd <directory>
– Change directory.pwd
– Print the current working directory.
File Management
touch <file>
– Create a new file.mkdir <directory>
– Create a new directory.rm <file>
– Remove a file.cp <source> <destination>
– Copy files.mv <source> <destination>
– Move or rename files.
System Commands
uname -a
– Display system information.whoami
– Display the current user.man <command>
– Access the manual for a command.
Text Editors
Use simple text editors like nano
to edit files:
nano <file>
Why WSL is Perfect for Beginners
No Complex Setup: Avoid virtualization headaches; install and run Linux within minutes.
Low Resource Usage: No need to allocate extra RAM or storage like with virtual machines.
Seamless Integration: Access Linux files from Windows and vice versa.
Offline Learning: Unlike online platforms, WSL works entirely offline after installation.
What’s Next?
With WSL installed, you can:
Learn more Linux commands.
Explore scripting with Bash.
Install software using Linux package managers like
apt
,yum
, orzypper
.
For example, install Git on Ubuntu:
sudo apt update
sudo apt install git
Conclusion
With WSL, learning Linux has never been easier. It’s the perfect tool for Windows users who want to step into the Linux world without additional hardware or software overhead. So fire up your Windows machine, install WSL, and start your Linux journey today!
Happy Learning!
~ Phemmy
Subscribe to my newsletter
Read articles from oluwafemi akinfenwa directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by