Practice & Assessment
Test your understanding of Understanding WSL2 and Why It Exists
Multiple Choice Questions
5What is the primary architectural difference between WSL1 and WSL2?
You clone a repo into /mnt/c/projects inside WSL2 and npm install runs slowly. What is the most likely cause?
Which command removes a WSL2 distro and deletes all its files permanently?
What does running apt update do inside a WSL2 Ubuntu distro?
A developer needs to access their WSL2 Ubuntu files from Windows Explorer. Which path should they use?
Coding Challenges
1WSL2 Distro Inventory Script
Write a PowerShell script that: (1) checks if WSL is installed by running wsl --version and capturing output, (2) lists all installed distros with their WSL version using wsl --list --verbose, (3) prints a warning message if any distro is running WSL version 1. Save the script as wsl-check.ps1. Input: none (reads live WSL state). Output: formatted console output showing distro names, versions, and any version-1 warnings. Time estimate: 15-20 minutes.
Mini Project
WSL2 Environment Bootstrap Script
Write a Bash script (bootstrap.sh) that runs inside WSL2 and performs the following: (1) prints the current WSL distro name and Linux kernel version using uname -r, (2) runs sudo apt update and sudo apt upgrade -y, (3) creates a ~/projects directory if it does not already exist, (4) writes a file ~/projects/README.md with the current date, distro name, and kernel version embedded in the content, (5) prints a success message listing each completed step. The script must be idempotent — running it twice should not fail or create duplicates.
