GitHub - maya-undefined/FORKY_PIG: Porcine hypercompute fabric

4 min read Original article β†—

🐷 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.

Build Status Python QEMU Status Made with ❀️


πŸ’‘ 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 (controller and hostd) 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)

  1. Create a base VM image (.qcow2)
  2. Launch a parent VM via the controller
  3. Call cold_fork()
  4. 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