Module 0 · Lesson 1 of 42

Why you need a real Linux machine

Explain why systems and embedded C work needs real Linux and choose among WSL2, a virtual machine, dual boot, native Linux, a container, and a cloud VM.

  • Beginner to advanced
  • 8 min read
  • 1 min lab
What you will need

A PC or laptop with at least 8 GB of RAM and about 40 GB of free disk; Windows 10 (2004 or later) or Windows 11, an Intel or Apple Silicon Mac, or an existing Linux machine. Nothing else is required.

Your place in the module
By the end you can 3 objectives
  • Explain why systems and embedded C development needs a real Linux environment rather than a Windows or macOS host alone.
  • Compare WSL2, a virtual machine, dual boot, a native install, a container and a cloud VM, and choose one for a given machine.
  • Explain how Unix, GNU, and the Linux kernel combined to form distributions like Ubuntu.
Video coming soonWhy you need a real Linux machine
The video for this lesson is being recorded. Read the lesson below in the meantime.
01

Why you need a real Linux machine

3 min read

This program builds software for Linux, and every later module assumes you have one running. This lesson answers why you need a real Linux machine and which environment to choose.

Everything in this program, from your first C program to a Yocto image running on a Raspberry Pi, targets Linux. You can read about Linux, but you cannot learn to build for it without sitting in front of one. This first lesson gets a real Linux environment onto whatever machine you already own, before any programming begins.

The technical reason is threefold. First, the you will use is the GNU toolchain. Its compiler gcc, assembler as, linker ld and debugger gdb are native to Linux and behave differently, or are absent, on Windows and macOS. Second, the C programs you will write call the API, a standard set of functions for files, processes and threads. Linux implements POSIX directly; Windows does not. Third, and most important for this program: the target boards you will use later, a Raspberry Pi and a QEMU virtual board, both run Linux. Developing on Linux means your code already speaks the language of the machine it will ship on.

A sits at the bottom of the stack. Programs talk to it through s, and the POSIX C library wraps those calls in the functions you will write. The same stack runs on your laptop and on an ARM board, which is why Linux skills transfer.

The same stack runs on the board

A Raspberry Pi runs the same kernel interface, the same glibc or musl C library, and often the same busybox or systemd tools as your development machine. The only real differences are the CPU architecture (ARM rather than x86) and the resources. Learning on a desktop Linux means you are already learning the target platform.

So the goal of this lesson is narrow: get Ubuntu 24.04 LTS running somewhere real, and confirm it works. You do not need to buy anything or repartition your disk. Pick an option, install it, and verify it.

The Linux software stackApplicationsbash, your C programsC libraryglibc or muslSystem callsKernelmemory, processes, devicesHardwarex86 or ARMrequests go down, data comes upApplicationsbash, your C programsC libraryglibc or muslSystem callsKernelmemory, processes, devicesHardwarex86 or ARMrequests go down, data comes up
The Linux software stack, from applications through the POSIX C library and system calls to the kernel and hardware, the same stack that runs on a Raspberry Pi or QEMU board.
Prove this is a real Linux machine
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
sbin.usr-is-merged
snap
srv
sys
tmp
usr
var
learner@embeddex:~/lab$ # a real binary: size, inode and link count
learner@embeddex:~/lab$ stat -c '%n: %s bytes, inode %i, %h links' /bin/ls
/bin/ls: 142312 bytes, inode 41630, 1 links
learner@embeddex:~/lab$ # the exact kernel this machine is running
learner@embeddex:~/lab$ cat /proc/version
Linux version 6.18.58.1-microsoft-standard-WSL2 (root@6869314ecc53) (gcc (GCC) 13.2.0, GNU ld (G
NU Binutils) 2.41) #1 SMP PREEMPT_DYNAMIC Tue Oct 27 00:24:11 UTC 2026
02

How we got here: Unix, Linux and the virtualization boom

4 min read

Linux is not one company's product. It is the result of several independent movements that happened to lock together. Knowing this explains why the installation choices look the way they do, and why there are so many of them.

The story starts in 1969 at Bell Labs, where Ken Thompson and Dennis Ritchie built Unix on a spare minicomputer. Ritchie created the C language to rewrite it, so the operating system could move to new hardware without being rewritten in assembly. In the 1980s, as commercial Unix fragmented, the IEEE standardised the portable interface as POSIX, so a program written for one Unix could compile on another.

In 1983 Richard Stallman launched the GNU project to build a free Unix-compatible system, and by the early 1990s it had produced the compiler gcc, the debugger gdb and almost everything except a kernel. In 1991 Linus Torvalds, a student in Helsinki, released the missing kernel and called it Linux. The combination of the GNU tools and the Linux kernel, assembled and packaged by groups like Debian, became what we call a . Ubuntu, first released in 2004 and built on Debian, is the distribution this program uses.

Meanwhile two other threads were spinning up. is an old idea, from IBM mainframes in the 1960s, but it became practical on ordinary PCs in 2005-2006 when Intel and AMD shipped hardware support, VT-x and AMD-V, in their CPUs. That enabled programs like VMware and VirtualBox to run a second operating system at near-native speed. Containers are older than most people think (chroot in 1979, FreeBSD jails in 2000, Linux LXC in 2008), but Docker made them popular in 2013 by packaging programs into portable images that share the host kernel instead of emulating a whole machine.

Microsoft closed the loop with WSL, the Windows Subsystem for Linux. WSL1, released in 2016, had no Linux kernel: it translated Linux system calls into Windows ones, which broke many programs. WSL2, announced in 2019 and generally available since 2020 (Windows 10 version 2004), ships an actual Linux kernel inside a small, fast virtual machine, and it is now the default and the recommendation. This program uses WSL2 on Windows, a virtual machine or native Linux elsewhere.

From Unix to WSL2Unix1969, BellLabsGNU1983, gccand gdbPOSIX1988,standardLinux1991, LinusTorvaldsUbuntu2004VT-x /AMD-V2005Docker2013WSL22020(announced2019)Unix1969, BellLabsGNU1983, gccand gdbPOSIX1988,standardLinux1991, LinusTorvaldsUbuntu2004VT-x /AMD-V2005Docker2013WSL22020(announced2019)
A timeline from Unix in 1969 through GNU (1983), POSIX (1988), Linux in 1991, Ubuntu in 2004, hardware virtualization in 2005, Docker in 2013 and WSL2 (announced 2019, released 2020).

The key line: Unix (1969) led to POSIX and GNU, which combined with the Linux kernel (1991) to form Ubuntu (2004); hardware virtualization (2005-2006), Docker (2013) and WSL2 (generally available 2020) each added a new way to run Linux.

  • events: [{"date": "1969", "label": "Unix at Bell Labs", "detail": "Ken Thompson and Dennis Ritchie build Unix; Ritchie creates C to rewrite it so it can move to new hardware."}, {"date": "1983-09-27", "label": "GNU project begins", "detail": "Richard Stallman launches GNU; by the early 1990s it has gcc, gdb and almost everything except a kernel."}, {"date": "1991-08-25", "label": "Linux kernel announced", "detail": "Linus Torvalds in Helsinki announces the missing kernel (version 0.01 follows in September); GNU tools plus this kernel, packaged by Debian and others, become a distribution."}, {"date": "2004-10-20", "label": "Ubuntu first release", "detail": "Ubuntu 4.10, built on Debian, is the distribution this program standardises on."}, {"date": "2005-11", "label": "Hardware virtualization ships", "detail": "Intel ships VT-x and AMD ships AMD-V (2005-2006), letting hypervisors run guests at near-native speed."}, {"date": "2013-03", "label": "Docker popularises containers", "detail": "Containers already existed (chroot, FreeBSD jails, LXC); Docker made them easy and portable. They reuse the host kernel to run isolated environments, instead of emulating a whole machine."}, {"date": "2016-08-02", "label": "WSL1 released", "detail": "No Linux kernel: it translates Linux system calls into Windows ones, which breaks many programs."}, {"date": "2020-05", "label": "WSL2 generally available", "detail": "Announced in May 2019 and shipped with Windows 10 version 2004: a real Linux kernel inside a small, fast Hyper-V utility VM; now the default and the recommendation."}]
03

Choosing your environment

4 min read

There is no single best answer, so this section lays out the options honestly and gives you a way to decide. The decision mostly depends on your host operating system and whether you will later need to run QEMU with hardware acceleration.

Here are the six options.

WSL2 on Windows 10/11. A real Linux kernel in a fast, lightweight VM managed by Microsoft. It starts in seconds, shares the Windows filesystem, and is the lowest-friction way to get Linux on Windows. It is the default recommendation for this program on Windows. Its limits are that it is not a full independent machine and it shares resources with Windows. Linux GUI apps work out of the box on Windows 11 (WSLg); on Windows 10 they need extra setup.

A virtual machine (VirtualBox, VMware, UTM). A complete second computer running inside your host. It can run any operating system as a guest, supports snapshots, and on an Apple Silicon Mac a VM is the practical way to run Ubuntu. It costs more RAM and disk, and it needs hardware virtualization enabled. On Windows, a type-2 hypervisor such as VirtualBox can conflict with WSL2 and Hyper-V (covered in the internals section).

Dual boot. Install Ubuntu alongside Windows on its own partition and choose at startup which to run. It is the fastest and most native option, using all your hardware. It is also the riskiest, because repartitioning can destroy data if something goes wrong. Only choose it if you understand the risks and have a full backup.

A native Linux install. If your machine is already Linux, you are done. This is the ideal case and the rest of the lesson is just verification and configuration for you.

A container or dev container. Docker (or a dev container in VS Code) runs Ubuntu tooling inside your host without a full VM, reusing the host kernel. It is excellent for reproducible build environments and will return in module M1, but it is less suited to the interactive system programming you will do here, so treat it as a complement rather than your first choice.

A cloud VM. A rented virtual machine from a provider. Useful if your local machine is weak, but it costs money, needs a network, and is a poor fit for the interactive labs. Mentioned for completeness.

The decision diagram below reduces this to a short set of questions. In one sentence: on Windows, use WSL2; on a Mac, use a VM (UTM is free); on Linux, use the machine you have.

Constraints matter before you commit. A VM needs a few gigabytes of RAM and disk to feel comfortable, so check nproc, memory and disk (commands in the verification section). If you plan to run QEMU with KVM acceleration in modules M4 and M5, you need nested virtualization, which WSL2 and some VM setups can provide but only on capable hardware. Finally, licensing: VMware Workstation/Fusion is commercial (free for personal use), VirtualBox is free but has a licensing model around its extension pack, and UTM is free. On Windows, the Hyper-V platform that WSL2 uses and a type-2 hypervisor like older VirtualBox versions cannot both own the CPU's virtualization features at once, which is a real, common conflict.

Choosing your environmentYour host OSWindowsWSL2recommendedvirtual machinefull machine, snapshotsdual bootfastest, riskyIntel MacVirtualBox or VMwareApple SiliconUTM (free) or VMwareLinuxnative installYour host OSWindowsWSL2recommendedvirtual machinefull machine, snapshotsdual bootfastest, riskyIntel MacVirtualBox or VMwareApple SiliconUTM (free) or VMwareLinuxnative install
A decision tree that routes the host OS - Windows, Intel Mac, Apple Silicon Mac, or Linux - to WSL2, a virtual machine, dual boot or the native install.
Follow only your path

You do not need every section below. Windows: read "Installing Ubuntu 24.04 on WSL2", then jump to "Verify, configure and snapshot your system". Mac (Intel or Apple Silicon): read "Installing Ubuntu in a virtual machine", then the verification section. Already on Linux: go straight to the verification section. The dual-boot and internals sections are for when you want to understand or need them.

Key takeaways

  • Systems and embedded C needs Linux: the GNU toolchain, the POSIX API and the target boards all assume it.
  • Linux is the GNU tools plus the Linux kernel, packaged into distributions such as Ubuntu.
  • On Windows use WSL2, on a Mac use a virtual machine, and on Linux use the machine you have.
Reflect
  1. Explain to a colleague, in two sentences: explain why systems and embedded C development needs a real Linux environment rather than a Windows or macOS host alone.
  2. Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
  3. What surprised you when you ran the commands yourself?
On a real board

Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.

References and further reading

Official documentation first. Links checked when the lesson was published.

Find your next step

↑ ↓ to move · Enter to open · Esc to close