What you are running
The terminal in this course is not connected to a server somewhere else. It is a Linux machine that exists only inside this browser tab. Its kernel is unkernel, which is the actual Linux kernel source compiled to WebAssembly. The lab is built from the code-lab project, and it pins unkernel at version 0.3.0.
Above the kernel runs an unmodified Alpine Linux aarch64 userland. The shell, coreutils, procps, and the other commands are ordinary Alpine packages built for the aarch64 architecture. You are logged in as the unprivileged user user. Your home directory and working directory is /workspace, and your login shell is /bin/bash, version 5.3.9.
The browser runs all of this with JSPI (JavaScript Promise Integration). JSPI lets synchronous kernel code pause while asynchronous browser work finishes, such as fetching a block of the disk image, and then resume where it stopped. That is why the lab needs a recent Chromium-based browser.
Investigating a machine from inside
Start with the questions you would ask about any machine you have just been given. Most of the answers come from the kernel itself, through commands and through the /proc virtual filesystem, which the kernel generates each time you read a file in it.
uname -a
cat /proc/versionuname -a prints the kernel name, host name, release, and machine architecture on one line. In this lab the line looks like this:
Linux unkernel 7.3.4+ ... aarch64 GNU/LinuxThe release tells you the kernel version, and aarch64 tells you the processor is 64-bit Arm. /proc/version records how the kernel was built. It names clang 22 and LLD, so the kernel was compiled with the LLVM toolchain and linked with the LLVM linker.
nproc
free -mnproc prints the number of processing units available, which is 1 here. free -m reads /proc/meminfo and reports memory in mebibytes. The total is about 241 MB and swap is zero. cat /proc/cpuinfo shows a single processor entry, which matches nproc. Its field names differ from the x86 output you may have seen, because this is an Arm processor.
A budget this small changes how you work. A large compile or a memory-hungry program can exhaust RAM, and there is no swap area to spill into. Check free -m before you start anything heavy.
The overlay and the read-only image
Run mount and df -h to see how storage is arranged. The distro image appears as /dev/wda, mounted read-only with the type erofs. erofs is a compressed, read-only filesystem built for system images, so the packages on it cannot be changed in place.
mount
df -h / /workspaceThe root directory / is an overlay filesystem. An overlay merges several layers into one view. The lower layer here is the read-only image. The upper layer sits on tmpfs, a filesystem held in memory. When a program creates or changes a file, the change lands in the upper layer, and the image itself never changes.
The consequence matters. Writes live in RAM and disappear when you reload the tab, because the browser discards the in-memory upper layer along with the page. Think of the lab as a machine that starts fresh each time you open it.
How the disk reaches your browser
The image is 25 MiB, which is too much to download before the shell appears. Instead the browser fetches it lazily. When the kernel reads a region of /dev/wda, the request becomes an HTTP request with a Range header that asks only for the bytes needed. A server that supports ranges answers with 206 Partial Content and just that slice.
The site is served from Cloudflare Pages on the free plan, and that static host ignores Range headers. Every request would return the whole 25 MiB file, which defeats the purpose. A service worker fixes this. It keeps a cached copy of the image and answers each Range request from that copy with a 206 slice, so the kernel receives only the bytes it asked for.
Limits and what is still real
The lab is a real kernel in a narrow environment. Expect these limits:
- No network. You cannot reach the internet, so package installs and downloads do not work.
- One CPU. Parallel builds and parallel pipelines run on a single processor.
- Memory only. About 241 MB of RAM, no swap, and a tmpfs upper layer that also uses that RAM.
- Slower than native. The kernel runs as WebAssembly, so timings here do not represent a native Linux machine.
Everything above the hardware is still real. System calls go through the kernel's real syscall interface. Terminal input passes through a real pseudo-terminal, which is why tty reports /dev/pts/0. Processes have real PIDs and real parent-child relationships. File permissions are checked by the kernel, so the unprivileged user is refused where root would be allowed. sudo is not installed, so you cannot escalate privileges.
This lab has no man or info, and no man page files, because the documentation was removed to keep the image small. Use --help, the help builtin for shell builtins, type, or the man7.org pages online. Containers and cloud images are often stripped the same way, so the habit is worth building now.
Try it yourself
Run these three commands. Expect /dev/pts/0, then xterm-256color, then a process list in which ps is a child of bash.
tty
echo $TERM
ps -o pid,ppid,tty,commNext, test the in-memory upper layer. Write a file, read it back, then reload the tab and run the same read again.
echo "hello" > /workspace/scratch.txt
cat /workspace/scratch.txtAfter the reload, cat should report that the file does not exist. The reload starts a fresh machine from the same read-only image, and only the memory-backed upper layer is discarded.