Skip to content

Mission 90 · Day 0 · ~20 min (uncounted)

Set up your DevOps lab: WSL2 + Ubuntu 24.04

Day 0 doesn't count against the 90 and takes about twenty minutes. You'll end with a real Linux workstation — the exact environment every command in the path was written and run against, so nothing later is "well, it works on my machine".

Windows — WSL2 + Ubuntu 24.04

The primary path — the exact environment every command in this program was written and run against. Five steps, about twenty minutes.

1. Install WSL2 + Ubuntu 24.04

WSL2 (Windows Subsystem for Linux, version 2) runs a genuine Linux kernel inside a lightweight VM on Windows — not an emulator. One command installs both WSL2 and Ubuntu 24.04 LTS. Open the Start menu, type "PowerShell", right-click and choose Run as administrator, then run:

Windows PowerShell (Admin)
# Run in an ADMIN PowerShell or Windows Terminal, then reboot when prompted.
wsl --install -d Ubuntu-24.04

# Expected (abridged):
# Installing: Windows Subsystem for Linux
# Installing: Ubuntu 24.04 LTS
# Ubuntu 24.04 LTS has been installed.
# The requested operation is successful. Changes will not be
# effective until the system is rebooted.

When it asks, reboot Windows. After the restart, Ubuntu finishes installing on its own and opens a terminal window.

2. Create your Ubuntu user

On its very first launch, Ubuntu asks you to create a Linux username and password. This account is a member of the sudo group, so it can run administrative commands with sudo. Pick a simple lowercase username — it is separate from your Windows login.

Ubuntu — first launch
# The first launch creates your Linux user. The password is INVISIBLE as you
# type it — that silence is normal, not a frozen terminal.
Enter new UNIX username: pushkar
New password:
Retype new password:
passwd: password updated successfully
Installation successful!

3. Confirm systemd is your init system

systemd is the init system that starts and supervises services on modern Linux — you'll manage services with it all through Phase 1. Ubuntu 24.04 on WSL2 enables it by default; confirm it's actually running:

Ubuntu
# Ask systemd how the boot went. Ubuntu 24.04 on WSL2 ships with systemd
# enabled, so you should get an answer here — not an error.
systemctl is-system-running

# Output:
# running        <- systemd is up ("degraded" is fine too: an optional
#                   unit failed, systemd itself is healthy)

If instead you see "System has not been booted with systemd as init system (PID 1)", turn it on and restart the WSL VM:

Ubuntu — only if systemd is off
# ONLY if the command above printed "System has not been booted with systemd
# as init system (PID 1)". Turn systemd on, then restart the WSL VM.
sudo nano /etc/wsl.conf

# Add exactly these two lines, then save (Ctrl+O, Enter) and exit (Ctrl+X):
# [boot]
# systemd=true

# Back in Windows PowerShell, fully restart the VM, then reopen Ubuntu:
# wsl --shutdown

4. Update the system

A fresh image is already a little behind. Pull the current package index and apply every available update so you start from a known-good, patched base:

Ubuntu
# Refresh the package index, then install every security & bug-fix update.
# -y answers "yes" so the upgrade runs unattended.
sudo apt update && sudo apt upgrade -y

# Output (abridged — your counts will differ; a fresh image usually has updates):
# Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
# Reading package lists... Done
# Building dependency tree... Done
# Calculating upgrade... Done
# 12 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

5. Verify your lab

Two quick checks prove you're on the right OS and the right kernel. The -microsoft-standard-WSL2 suffix on the kernel version is the tell-tale sign you're inside WSL2 and not a bare Ubuntu install:

Ubuntu
# 1. Which Ubuntu is this? Expect 24.04, codename "noble".
lsb_release -a

# Output (abridged):
# No LSB modules are available.
# Distributor ID: Ubuntu
# Description:    Ubuntu 24.04.1 LTS
# Release:        24.04
# Codename:       noble

# 2. Which kernel? The -microsoft-standard-WSL2 suffix proves this is WSL2.
uname -r

# Output:
# 5.15.167.4-microsoft-standard-WSL2

See Ubuntu 24.04 and a -microsoft-standard-WSL2 kernel? Your lab is ready.

macOS — Homebrew + Multipass

Your Mac's own Terminal uses Homebrew and launchd, not apt and systemd — the two package managers and init systems this program is built on. Multipass, Canonical's own VM manager, gives you a genuine Ubuntu 24.04 machine instead of trying to approximate one with Mac-native tools.

1. Install Homebrew (if you don't have it)

macOS Terminal
# Skip this if `brew --version` already prints something.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Follow the printed "Next steps" to add brew to your shell PATH, then confirm:
brew --version

# Representative output:
# Homebrew 4.4.0

2. Install Multipass and launch Ubuntu 24.04

macOS Terminal
# Multipass is Canonical's own lightweight Ubuntu VM manager for Mac and
# Windows — it distributes as a Homebrew cask.
brew install --cask multipass

# Launch a real Ubuntu 24.04 VM (sized comfortably for this program's labs):
multipass launch 24.04 --name devops-lab --cpus 2 --memory 4G --disk 20G

# Drop into a shell inside it — this is your terminal for every day from here on:
multipass shell devops-lab

# Representative output:
# Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-1015-aws x86_64)
# ubuntu@devops-lab:~$

From here, everything in this program — every apt command, every systemctl check — works exactly like WSL2's Ubuntu, because this Multipass VM is Ubuntu 24.04. Run those commands inside multipass shell devops-lab, never in your Mac's own Terminal directly.

3. Leaving and coming back

macOS Terminal
# Later, to leave and come back without re-launching the whole VM:
exit                              # back to your Mac's own terminal
multipass stop devops-lab         # pause it (frees your Mac's RAM/CPU)
multipass start devops-lab        # resume it
multipass shell devops-lab        # shell back in

Linux — you already have a terminal

If you're on Ubuntu 24.04, you're already the target environment — confirm your version and update, then go straight to Day 1:

Terminal
# Confirm your version — most labs assume Ubuntu/Debian's apt, so if you're
# already on Ubuntu 24.04 you can go straight to Day 1 after this.
lsb_release -a

# Then apply the same update every WSL2/Multipass learner runs:
sudo apt update && sudo apt upgrade -y

No install — Codespaces or Cloud Shell

Not near a computer you can install anything on? Two free, browser-only options give you a real Linux terminal with zero setup.

GitHub Codespaces

On any GitHub repository (or a fresh blank one), click Code → Codespaces → Create codespace. You get a browser-based VS Code with an integrated terminal running in an Ubuntu-based container — no local install at all.

Google Cloud Shell

Free with any Google account at shell.cloud.google.com. Gives you an ephemeral Debian-based VM with a terminal — still apt-based, close enough for the program's early days.

Honest caveat for Day 10 (systemd)

Docker-based environments like Codespaces run a single foreground process, not a full init system — there is no systemd as PID 1:

Inside a Codespace
# Inside a Codespace or other Docker-based dev container, systemd is NOT
# PID 1 — the container runs a single foreground process, not a full init
# system. This command (which Day 10 relies on) will look different here:
systemctl is-system-running

# Representative output inside a container:
# System has not been booted with systemd as init system (PID 1). Can't operate.

The concepts in Day 10 still apply, but you won't be able to run every command exactly as written. If you want the full hands-on lab that day, WSL2 or Multipass (above) both give you a real init system.

Next

Day 1 — What DevOps actually is

Your terminal is live. Take your first step onto the loop with your first six commands.