π· Forky Pig β The Hypercomputer Playground
Forky Pig is my experiment in turning a single machine into a miniature cloud.
Itβs a system that can spawn, snapshot, and fork virtual machines in milliseconds, using QEMU, copy-on-write overlays, and a bit of Python orchestration magic.
Itβs not production-ready, not optimized, and definitely not perfect β but itβs real, and it works. The point isnβt to chase scale yet; itβs to explore what βforkingβ compute really means when you treat VMs like living processes instead of static boxes.
π‘ What It Does
Forky Pig can:
- Cold fork: snapshot a paused VM and clone it instantly.
- Spin up isolated compute environments using overlays, so every fork shares a base image but keeps its own writable state.
- Manage and orchestrate VMs via lightweight Python daemons (
controllerandhostd) that talk over gRPC and QMP. - Experiment with future compute ideas β like hot forking, GPU passthrough, and distributed hypercomputing.
βGit for VMs, with QEMU as the kernel and Python as the glue.β
π§ Why Iβm Building It
Because containers are great β until they arenβt.
Because GPUs are scarce and orchestration is broken.
Because I wanted to see what would happen if you could fork a machine like a process β instantly, cleanly, and predictably.
Forky Pig started as a joke, but itβs becoming a serious playground for the next generation of distributed systems β where compute is treated as something fluid, not fixed.
ποΈ Architecture
βββ common # utilities and the like
β βββ ids.py
β βββ logs.py
β βββ symbols.py
βββ controller # the API interface the user talks to. it defines intent and uses hostd to do work
β βββ server.py
βββ guest_agent # there will be a mighty agent here someday
βββ FP.txt # banner
βββ hostd # the host-daemon runner, actually talks to VMs
β βββ qemu.py
β βββ qmp.py
β βββ server.py
βββ __init__.py
βββ kqemu.sh # kill running processes
βββ linux # the linux base image bits live h ere for now
β βββ bootbits
β βββ generic_alpine-3.21.4-x86_64-bios-cloudinit-metal-r0.qcow2
β βββ initramfs-lts
β βββ mnt
β βββ noble-server-cloudimg-amd64.img
β βββ root.qcow2 -> generic_alpine-3.21.4-x86_64-bios-cloudinit-metal-r0.qcow2
β βββ ubuntu-24.04.3-live-server-amd64.iso
β βββ vmlinuz
βββ proto
β βββ api_pb2_grpc.py
β βββ api_pb2.py
β βββ api.proto
βββ README.md
βββ requirements.txt
βββ run.sh # test run
βββ scripts
βββ gen_proto.sh
Each host runs hostd, which controls its local QEMU instances.
The controller issues fork/snapshot commands through gRPC and tracks metadata.
Everything else is just files and processes β no Kubernetes, no magic.
π Quick Start (Conceptually)
- Create a base VM image (
.qcow2) - Launch a parent VM via the controller
- Call
cold_fork() - Watch it spin up children VMs sharing the same base image
You can literally fork a live environment in seconds.
No rebuilds, no redeploys β just a clean new world spun off from the last one.
βοΈ Current Status
| Feature | Status |
|---|---|
| Cold forking | β Works |
| Hot forking | π§ Experimenting |
| Snapshot chains | π§ Stable |
| GPU support | π₯ Researching |
| App-directory overlays | π§© Debating |
| Multi-host orchestration | π Planned |
π§° Built With
- Python 3 (asyncio, gRPC)
- QEMU / QMP
- qcow2 overlays
- Linux KSM (for deduplication)
- Bash & a bit of insanity
π€ Philosophy
Forky Pig isnβt about reinventing the wheel β
itβs about spinning up thousands of wheels instantly
and seeing what they can build together.
π License
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/
Setup configs misc
Some of theses were required to get the system running. KSM is the paging de-duplication
apt install qemu-system-x86
grep KSM /boot/config-$(uname -r)
CONFIG_KSM=y # we want this
sudo modprobe ksm
echo 1 | sudo tee /sys/kernel/mm/ksm/run
Use this to actually run the code for now. See the run.sh for how a client could look
unset PYTHONPATH
. .venv/bin/activate
export PYTHONPATH=.
python3 {hostd,controller}/server.py