User-defined Playground

Linux Kernel Hacking Playground

Minimal environment for compiling and testing the Linux kernel with GCC, Clang/LLVM, Clangd, and QEMU.

Linux Kernel Hacking playground: Minimal environment for compiling and testing the Linux kernel with GCC, Clang/LLVM, Clangd, and QEMU.
Machines & network
1 VM · 4 vCPU · 4GiB RAM
Playground host Internet NAT MASQUERADE local (bridge) 172.16.0.0/24 gw 172.16.0.1/24eth0
VM
vCPU ·
eth0
/
ubuntu-24-04
About

Linux Kernel Compilation Playground

Bare minimum Ubuntu 24.04 environment configured for Linux kernel compilation and QEMU testing.

Installed Toolchain & Dependencies

  • Compilers & LSP: build-essential (GCC, Make), clang, llvm, lld, clangd
  • Kernel Build Essentials: bc, bison, flex, libelf-dev, libssl-dev, libncurses-dev, dwarves (pahole)
  • Testing: qemu-system-x86
  • IDE: VS Code (code-server) with clangd extension pre-installed

Kernel Source Location

The Linux kernel source is available in:

  • /home/laborant/linux
  • /linux (symlink)

Quickstart Commands

Navigate to the kernel directory:

cd ~/linux

1. Default Configuration

make defconfig

2. Interactive Menu Configuration

make menuconfig

3. Build Kernel with GCC

make -j$(nproc)

4. Build Kernel with LLVM / Clang

make -j$(nproc) LLVM=1

5. Generate compile_commands.json for Clangd in IDE

./scripts/clang-tools/gen_compile_commands.py
Every playground includes
Learn more about playgrounds
Start
Settings