
Why you need a real Linux machine
3 min readThis 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 the set of programs that turn source code into a runnable binary, here gcc, as, ld and gdb 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 a standard interface of functions and conventions that Unix-like operating systems provide, so portable programs can rely on them 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 the core of the operating system that runs in privileged mode, manages memory, processes and hardware, and provides system calls to programs sits at the bottom of the stack. Programs talk to it through a controlled request a program makes to the kernel to do privileged work such as reading a file or starting a processs, 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.
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.
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
How we got here: Unix, Linux and the virtualization boom
4 min readLinux 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 a packaged collection of the Linux kernel plus userspace tools, libraries and a package manager, such as Ubuntu or Debian. Ubuntu, first released in 2004 and built on Debian, is the distribution this program uses.
Meanwhile two other threads were spinning up. running one or more operating systems as software guests on top of a host, managed by a hypervisor 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.
Choosing your environment
4 min readThere 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.
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
- 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.
- Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
- 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.