Getting Started
You’ll need a machine with KVM. If you can run ls /dev/kvm and see a file, you’re good.
What You Need
Section titled “What You Need”Hardware
Section titled “Hardware”Manager node can be small — it mostly coordinates things. Workers need more since they actually run VMs.
| Node | Minimum | Works Better |
|---|---|---|
| Manager | 1 vCPU, 1 GB | 2 vCPU, 2 GB |
| Worker | 2 vCPU, 4 GB | 4 vCPU, 8 GB |
Software
Section titled “Software”Ubuntu 20.04+ or Debian 11+ work well. Any KVM-compatible distro should do.
You need root access for setting up bridges and Firecracker.
Check KVM
Section titled “Check KVM”ls -la /dev/kvm # Must show a filelscpu | grep Virtualization # VT-x (Intel) or AMD-V (AMD)If you’re running inside a VM, nested virtualization has to be on:
cat /sys/module/kvm_intel/parameters/nested # Should be 'Y'
# If it's 'N':sudo modprobe kvm_intel nested=1Install
Section titled “Install”One-Line Install (blessed path — ADR-005)
Section titled “One-Line Install (blessed path — ADR-005)”install.sh only downloads the latest release binary and verifies its checksum.
Everything else is handled by the swarmcracker setup subcommand:
# 1. Install the binarycurl -fsSL https://raw.githubusercontent.com/restuhaqza/SwarmCracker/main/install.sh | sudo bash
# 2. Verify prerequisites (KVM, kernel modules, tools)sudo swarmcracker setup check
# 3. Install Firecracker, jailer, kernel, and rootfssudo swarmcracker setup install --download-kernel --download-rootfs
# 4. Create the VM bridge + enable NATsudo swarmcracker setup network
# 5. Generate the configsudo swarmcracker setup config --non-interactiveRepeat steps 2–5 on every node (manager and workers). Then start the cluster:
# On the manager nodesudo swarmcracker cluster init --advertise-addr <MANAGER_IP>:4242
# On each worker nodesudo swarmcracker cluster join --token <TOKEN> <MANAGER_IP>:4242Build It Yourself
Section titled “Build It Yourself”git clone https://github.com/restuhaqza/SwarmCrackercd SwarmCrackermake allsudo make installThe Kernel Thing
Section titled “The Kernel Thing”Firecracker needs an uncompressed ELF kernel at /usr/share/firecracker/vmlinux.
swarmcracker setup install --download-kernel downloads a known-good kernel for you.
Don’t try downloading from GitHub raw URLs — you’ll get HTML, not a binary.
To extract one from your host kernel instead:
sudo mkdir -p /usr/share/firecracker./test-automation/scripts/extract-vmlinux.sh /boot/vmlinuz-* /usr/share/firecracker/vmlinux
# Check it workedfile /usr/share/firecracker/vmlinux# Should say: ELF 64-bit LSB executable, x86-64Local Test Cluster
Section titled “Local Test Cluster”For a multi-node cluster with microVMs placed on separate nodes (VXLAN overlay), use the single-host lab:
sudo test-automation/multinode/cluster-lab.sh up 2 # create + provision + clustersudo test-automation/multinode/cluster-lab.sh test # cross-host matrixsudo test-automation/multinode/cluster-lab.sh destroyStart the Cluster
Section titled “Start the Cluster”Manager Node
Section titled “Manager Node”sudo swarmcracker cluster init --advertise-addr <MANAGER_IP>:4242--advertise-addr is critical: workers need to reach the manager, and without it
they’ll try to connect to 0.0.0.0, which won’t work.
This starts:
- SwarmKit manager (Raft consensus for cluster state)
- Control socket at
/var/run/swarmkit/swarm.sock - TLS certificates
- Join tokens saved to
/var/lib/swarmkit/join-tokens.txt
Get the Join Token
Section titled “Get the Join Token”sudo swarmcracker cluster token workerLook for the SWMTKN-... token in the output.
Join Workers
Section titled “Join Workers”sudo swarmcracker cluster join <manager-ip>:4242 --token <TOKEN>Check the Cluster
Section titled “Check the Cluster”sudo swarmcracker node lssudo swarmcracker cluster healthYou should see all your nodes with READY status.
Run Something
Section titled “Run Something”Deploy a Service
Section titled “Deploy a Service”sudo swarmcracker service create --name web --image nginx:alpine --replicas 3See What’s Running
Section titled “See What’s Running”swarmcracker service lsswarmcracker service ps webEach task is a Firecracker microVM.
What’s Actually Happening
Section titled “What’s Actually Happening”Manager (swarmd) │ │ gRPC: schedules tasks, maintains state │┌───┴───────────────────┐│ │Worker-1 Worker-2swarm-br0 swarm-br0┌───┐┌───┐ ┌───┐┌───┐│VM1││VM2│ ← VXLAN → │VM3││VM4│└───┘└───┘ └───┘└───┘- Manager runs SwarmKit control plane
- Workers run swarmd-firecracker, which turns SwarmKit tasks into microVMs
swarm-br0is a Linux bridge for local VM networking- VXLAN connects VMs across different nodes
Common Problems
Section titled “Common Problems”Kernel: Invalid ELF Magic Number
Section titled “Kernel: Invalid ELF Magic Number”The kernel file isn’t actually a kernel. Probably HTML from a bad download.
file /usr/share/firecracker/vmlinux# If it says "HTML document", re-download:sudo swarmcracker setup install --download-kernel# Or extract from your host kernel:./test-automation/scripts/extract-vmlinux.sh /boot/vmlinuz-* /usr/share/firecracker/vmlinuxKVM Not Found
Section titled “KVM Not Found”sudo modprobe kvm_intel # Intelsudo modprobe kvm_amd # AMDNested KVM Issues
Section titled “Nested KVM Issues”Running inside a VM? Check:
cat /sys/module/kvm_intel/parameters/nested
# If it's 'N':sudo modprobe -r kvm_intelsudo modprobe kvm_intel nested=1Or add options kvm_intel nested=1 to /etc/modprobe.d/kvm-nested.conf.
Workers Can’t Connect
Section titled “Workers Can’t Connect”curl http://<manager-ip>:4242 # Check manager reachablesudo swarmcracker node lsIf the manager advertises 0.0.0.0:4242, that’s wrong. Re-init with
--advertise-addr <actual-ip>:4242.
Services Not Starting
Section titled “Services Not Starting”sudo swarmcracker node ls # Check nodes are readysudo swarmcracker doctor # Diagnose common issuessudo journalctl -u swarmcracker-manager -f # Manager logssudo journalctl -u swarmcracker-worker -f # Worker logsfile /usr/share/firecracker/vmlinux # Verify kernel is ELF- Configuration — More options
- Networking — VXLAN setup
- Security — Jailer hardening
- CLI Reference — All commands