💿 Lesson 1.3: Installing Ubuntu
Three ways to get Ubuntu running on your machine — pick the one that fits your situation.
🎯 Learning Objectives
- Choose the right installation method for your needs
- Install Ubuntu in a VirtualBox virtual machine
- Install Ubuntu via WSL on Windows 10/11
- Use the macOS Terminal for a native Unix experience
- Understand the dual-boot option for a full native install
Estimated Time: 45 minutes (plus installation time)
📑 In This Lesson
Pick Your Method
There are three common ways to run Ubuntu. Each has trade-offs:
| Method | Best For | Pros | Cons |
|---|---|---|---|
| VirtualBox | Learning safely on any OS | No risk to your system, easy to reset, full desktop | Slower, needs 4+ GB RAM to spare |
| WSL | Windows users who want terminal access | Fast, lightweight, integrates with Windows | No graphical desktop by default, Windows-only |
| Mac Terminal | Mac users following along | Already installed, native Unix, most commands work | Not actual Linux (some tools differ), no apt |
| Dual Boot | Full native performance | Full speed, full desktop, real hardware access | Riskier setup, must reboot to switch OS |
graphical desktop?"} B -->|No| H{"On Mac?"} H -->|Yes| I{"Want actual
Ubuntu?"} H -->|No| D["VirtualBox"] I -->|"Yes"| D I -->|"No, terminal is fine"| J["Mac Terminal"] C -->|"Yes"| E{"Want full
performance?"} C -->|"No, terminal is fine"| F["WSL"] E -->|"Yes"| G["Dual Boot"] E -->|"No, VM is OK"| D style A fill:#3b82f6,stroke:#1e40af,color:#fff style D fill:#22c55e,stroke:#166534,color:#fff style F fill:#6366f1,stroke:#4338ca,color:#fff style G fill:#f59e0b,stroke:#b45309,color:#fff style J fill:#a855f7,stroke:#7c3aed,color:#fff
✅ Our Recommendation
If you're on Windows 10/11, start with WSL — it's the fastest way to get a Linux terminal. If you're on a Mac, the built-in Terminal already gives you a Unix shell — most commands in this course work out of the box (we'll note differences where they exist). If you want the full graphical Ubuntu desktop experience on any platform, use VirtualBox.
Download Ubuntu
For VirtualBox and dual-boot installs, you'll need the Ubuntu ISO image:
- Go to ubuntu.com/download/desktop
- Download the latest LTS version (e.g., Ubuntu 24.04 LTS)
- The file will be about 5 GB — a
.isofile
💡 LTS vs. Non-LTS
Always pick the LTS (Long Term Support) version unless you have a specific reason not to. LTS releases are supported for 5 years with security updates and are more stable than the 6-month releases.
For WSL, you don't need to download anything manually — Ubuntu installs directly from the Microsoft Store or command line.
Option A: VirtualBox
VirtualBox lets you run Ubuntu inside a window on your current operating system. It's like a computer within your computer.
Step 1: Install VirtualBox
- Download VirtualBox from virtualbox.org
- Install it like any other application
- On Windows, you may need to enable Virtualization in your BIOS (usually called VT-x or AMD-V)
⚠️ BIOS Virtualization
If VirtualBox gives you errors about virtualization, you'll need to enter your BIOS/UEFI settings (usually by pressing F2, F12, or DEL during boot) and enable Intel VT-x or AMD-V. The exact menu varies by motherboard manufacturer.
Step 2: Create a Virtual Machine
- Open VirtualBox and click New
- Name:
Ubuntu - Type: Linux, Version: Ubuntu (64-bit)
- Memory: 4096 MB (4 GB minimum, 8 GB if you can spare it)
- Hard disk: Create a virtual hard disk now, 25 GB or more, VDI format, dynamically allocated
Step 3: Mount the ISO and Install
- Select your new VM and click Settings → Storage
- Click the empty disk icon under Controller: IDE
- Click the small disk icon on the right and choose Choose a disk file
- Select the Ubuntu ISO you downloaded
- Click OK, then Start
- The Ubuntu installer will boot — follow the on-screen prompts
- Choose "Erase disk and install Ubuntu" — don't worry, this only affects the virtual disk, not your real hard drive
- Set your username and password, then wait for installation to complete
- Restart when prompted (VirtualBox will eject the ISO automatically)
Step 4: Install Guest Additions (Recommended)
After Ubuntu boots, install VirtualBox Guest Additions for better performance:
# Update packages first
sudo apt update && sudo apt upgrade -y
# Install Guest Additions dependencies
sudo apt install -y build-essential dkms linux-headers-$(uname -r)
# Then: VirtualBox menu → Devices → Insert Guest Additions CD
# Run the installer from the mounted CD
sudo /media/$USER/VBox_GAs_*/VBoxLinuxAdditions.run
# Reboot
sudo reboot
Guest Additions enables fullscreen mode, shared clipboard, shared folders, and better graphics.
Option B: WSL (Windows Subsystem for Linux)
WSL lets you run a real Linux terminal directly inside Windows — no virtual machine, no rebooting. It's fast and lightweight.
💡 Requirements
WSL requires Windows 10 version 2004+ or Windows 11. Most modern Windows PCs already meet this requirement.
Step 1: Install WSL
Open PowerShell as Administrator (right-click the Start button → Terminal (Admin)) and run:
# This single command installs WSL + Ubuntu
wsl --install
This installs WSL 2 and Ubuntu as the default distribution. Restart your computer when prompted.
Step 2: Set Up Your User
After restarting, Ubuntu will launch automatically (or search for "Ubuntu" in the Start menu). It will ask you to create a username and password:
Enter new UNIX username: yourname
New password: ********
Retype new password: ********
⚠️ Remember Your Password
You won't see any characters while typing your password — this is normal Linux behavior. The password is being recorded; it just doesn't show dots or asterisks. You'll need this password for sudo commands throughout this course.
Step 3: Update Ubuntu
# Always update after a fresh install
sudo apt update && sudo apt upgrade -y
Step 4: Access Your Files
Your Windows files are available inside WSL at /mnt/c/:
# Your Windows Desktop
ls /mnt/c/Users/YourWindowsUsername/Desktop
# Your Linux home directory
cd ~
pwd # Shows /home/yourname
From Windows, you can access your Linux files at \\wsl$\Ubuntu\home\yourname in File Explorer.
✅ WSL + VS Code
If you use Visual Studio Code, install the WSL extension. Then you can open any Linux folder with code . from the terminal and edit files with full VS Code features.
Option C: Mac Terminal (macOS)
If you're on a Mac, you already have a Unix-based terminal built in. macOS is based on Darwin (a BSD Unix variant), which means most of the commands taught in this course work natively — no virtual machine or extra installation needed.
💡 macOS Is Not Linux
macOS is Unix-based but is not Linux. The kernel is different (XNU vs. Linux), and some tools and paths differ. For example, macOS uses /Users/yourname instead of /home/yourname, and doesn't have apt. We'll call out these differences throughout the course.
Step 1: Open Terminal
- Spotlight: Press ⌘ Cmd + Space, type "Terminal", press Enter
- Finder: Go to Applications → Utilities → Terminal
- Dock: Pin Terminal to your Dock for quick access
Step 2: Install Homebrew (Recommended)
Homebrew is the missing package manager for macOS. It lets you install Linux tools that don't come with macOS:
# Install Homebrew (one command)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once installed, you can use brew install to add common Linux tools:
# Install useful tools that mirror Linux utilities
brew install coreutils # GNU versions of ls, cat, etc.
brew install gnu-sed # GNU sed (macOS sed behaves differently)
brew install wget # wget isn't installed by default on macOS
brew install tree # tree isn't installed by default on macOS
Step 3: Note Your Default Shell
Since macOS Catalina (10.15), the default shell is Zsh, not Bash. Zsh is very similar to Bash — almost all commands in this course work identically — but there are minor syntax differences in scripting (covered in Module 8).
# Check your current shell
echo $SHELL # Likely shows /bin/zsh
# If you want to switch to Bash for this course:
bash # Starts a Bash session
# Or change your default shell to Bash:
chsh -s /bin/bash
✅ Mac + VS Code
Visual Studio Code works great on macOS. Open any folder from the terminal with code . and you'll have a full development environment. The integrated terminal in VS Code uses your Mac's default shell.
⚠️ Want Actual Ubuntu on Your Mac?
If you'd prefer to run a full Ubuntu environment, you can use VirtualBox (free, works on Intel Macs) or UTM (free, works on both Intel and Apple Silicon Macs). UTM is especially recommended for M1/M2/M3/M4 Macs since VirtualBox doesn't support Apple Silicon.
Option D: Dual Boot
Dual booting installs Ubuntu alongside Windows (or macOS) on your actual hardware. When you turn on your computer, you choose which OS to boot into.
🔴 Backup First!
Dual booting modifies your disk partitions. While the Ubuntu installer is generally safe, always back up your important files before proceeding. Mistakes during partitioning can cause data loss.
Overview of Steps
- Back up your data to an external drive
- Create a bootable USB drive using Rufus (Windows) or Etcher (any OS)
- Insert your USB drive (8 GB minimum)
- Select the Ubuntu ISO
- Flash it to the USB drive
- Boot from USB — restart your computer and press F2, F12, ESC, or DEL to access the boot menu, then select your USB drive
- Try or Install — Ubuntu will boot from the USB. Click "Try Ubuntu" to test it, or "Install Ubuntu" to proceed
- Choose "Install Ubuntu alongside Windows" — the installer will handle partitioning
- Follow the prompts — set timezone, keyboard, username, password
- Reboot — you'll see a GRUB menu letting you choose Ubuntu or Windows each time you start your computer
💡 Recommended Disk Space
Give Ubuntu at least 50 GB if possible. The minimum is about 25 GB, but you'll want room for software, projects, and updates. If you have a second drive (like an SSD), installing Ubuntu there is the cleanest option.
First Look at Ubuntu
Once Ubuntu is running (by any method), let's verify everything is working.
Open a Terminal
Ubuntu Desktop: Press Ctrl + Alt + T, or search for "Terminal" in the Activities overview.
WSL (Windows): The terminal opens automatically when you launch Ubuntu.
Mac: Press ⌘ Cmd + Space, type "Terminal", and press Enter.
Run Your First Commands
# What version of Ubuntu are you running?
lsb_release -a
# What's your username?
whoami
# What's today's date?
date
# What directory are you in?
pwd
Expected Output (example):
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
yourname
Mon Apr 14 10:30:00 PDT 2026
/home/yourname
If you see output like this, congratulations — you have a working Ubuntu system!
🎉 You Did It!
You now have Ubuntu Linux running. Everything from here on out is about learning what you can do with it.
Exercises
🏋️ Exercise 1: Install Ubuntu
Using the method of your choice (we recommend WSL or VirtualBox), install Ubuntu and verify it works by running:
lsb_release -a
whoami
date
🏋️ Exercise 2: Explore the Terminal
Try these commands and note what each one does:
uname -a
hostname
uptime
echo "Hello, Linux!"
💡 What Do These Do?
uname -a— shows kernel version and system architecturehostname— shows your computer's nameuptime— shows how long the system has been runningecho "Hello, Linux!"— prints text to the screen
🏋️ Exercise 3: Update Your System
Run your first system update:
sudo apt update && sudo apt upgrade -y
You'll be asked for your password. Type it (nothing will appear on screen — that's normal) and press Enter.
💡 What Does This Do?
sudo apt update refreshes the list of available software. sudo apt upgrade -y installs all available updates. The -y flag auto-confirms. We'll cover apt in detail in Module 5.
Summary
🎉 Key Takeaways
- VirtualBox gives you a full Ubuntu desktop in a safe, isolated environment
- WSL is the fastest way for Windows users to get a Linux terminal
- Mac Terminal gives Mac users a native Unix shell — install Homebrew for extra Linux tools
- Dual boot gives full native performance but requires more setup
- Always download the LTS version for stability
lsb_release -aconfirms your Ubuntu version,whoamishows your username
🚀 What's Next?
You have Ubuntu running — now it's time to learn the command line. Module 2 starts with opening the terminal and running your first real commands.