Skip to content

RedsOrb/WSL-installation-Guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 

Repository files navigation

πŸš€ How to Install WSL (Windows Subsystem for Linux)

WSL lets you run a Linux environment directly on Windows without a virtual machine or dual boot. Perfect for developers who need Linux tools on Windows.


🌟 Features

  • Run Linux on Windows – No separate machine or VM needed.
  • Fast Performance – Near-native speed using the Windows kernel.
  • Linux Tools – Access Bash, Git, Python, and more.
  • GUI Support – Run Linux GUI apps with GPU acceleration (WSL 2).
  • File Sharing – Seamlessly access files between Windows and Linux.
  • Docker & AI – Ideal for Docker, TensorFlow, and other tools.

πŸ”’ WSL Versions

1️⃣ WSL 1

  • Compatibility layer for Linux system calls.
  • Faster file access for Windows files.
  • Limited Linux feature support.

2️⃣ WSL 2

  • Real Linux kernel in a lightweight VM.
  • Full Linux system call compatibility (supports Docker, GPU, etc.).
  • Slightly slower file access to Windows folders.

πŸ› οΈ Installation Guide

Step 1: Enable WSL

Run this in PowerShell (Admin) or CMD:

wsl --install

This installs WSL 2 with Ubuntu as the default distro.

Step 2: Check Available Distros

wsl --list --online

Step 3: Install a Linux Distro

To install a specific distro (e.g., Debian or Kali Linux):

wsl --install -d <DistroName>

Step 4: Set WSL Version

Ensure your distro uses WSL 2:

wsl --set-version <DistroName> 2

Step 5: Open WSL

Simply type:

wsl

Step 6: Install a Desktop GUI

To install a desktop GUI like GNOME or XFCE4, follow these steps:

Install GNOME Desktop

  1. Update your package list:
    sudo apt update
  2. Install GNOME Desktop:
    sudo apt install ubuntu-gnome-desktop -y

Install XFCE4 and LightDM

  1. Update your package list:
    sudo apt update
  2. Install XFCE4 and LightDM:
    sudo apt install xfce4 lightdm -y
  3. During installation, you may be prompted to select a display manager. Choose lightdm.

Start the GUI

To start the GUI, run:

sudo service lightdm start

Run GUI via Remote Desktop Connection

To access the GUI using Remote Desktop Connection:

  1. Install an RDP server in your WSL environment:
    sudo apt install xrdp -y
  2. Start the RDP server:
    sudo service xrdp start
  3. Find your WSL IP address:
    hostname -I
  4. Open the Remote Desktop Connection app on Windows and enter the IP address from the previous step.
  5. Log in using your WSL username and password.

❌ Uninstalling WSL

To remove WSL completely:

wsl --unregister <DistroName>

Example:

wsl --unregister Ubuntu

πŸ’‘ Common Use Cases

  • πŸ’» Web Development – Run Linux-based servers, databases, and tools.
  • 🐍 AI & Machine Learning – Use TensorFlow, PyTorch, Jupyter Notebook.
  • 🐳 Docker & Containers – Fully supported on WSL 2.
  • βš™οΈ System Administration – Manage servers and run Linux scripts.