# Running TinyCore + WASI SQLite Meta-Tracing Appliance

Every TinyCore artifact contains Linux `6.12.11-tinycore64`, hypervisor drivers (`virtio_net`, `virtio_blk`, `virtio_console`, `amazon/ena`, `e1000`, `e1000e`, `nvme`, `8250`), `/opt/mtwasm/mtwasm-host`, `/opt/mtwasm/meta_tracer.wasm`, and `/opt/mtwasm/sqlite_httpd.wasm` auto-started by `/etc/init.d/wasm-sqlite-httpd` on `0.0.0.0:8080`.

## 1. Local QEMU (User-Mode SLIRP -> localhost:18080)
```bash
curl -fLO https://meta-tracing-tinycore.pages.dev/downloads/vmlinuz64
curl -fLO https://meta-tracing-tinycore.pages.dev/downloads/tinycore-sqlite-wasm.gz
curl -fLO https://meta-tracing-tinycore.pages.dev/downloads/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS

qemu-system-x86_64 -m 512M -smp 2 -nographic \
  -kernel vmlinuz64 \
  -initrd tinycore-sqlite-wasm.gz \
  -append "console=ttyS0,115200 loglevel=3" \
  -netdev user,id=net0,hostfwd=tcp:127.0.0.1:18080-:8080 \
  -device virtio-net-pci,netdev=net0
```

Or boot via the hybrid BIOS MBR disk image (`tinycore-sqlite-wasm.iso`):
```bash
curl -fLO https://meta-tracing-tinycore.pages.dev/downloads/tinycore-sqlite-wasm.iso
sha256sum -c --ignore-missing SHA256SUMS
qemu-system-x86_64 -m 512M -smp 2 -nographic \
  -drive file=tinycore-sqlite-wasm.iso,format=raw,if=virtio \
  -netdev user,id=net0,hostfwd=tcp:127.0.0.1:18080-:8080 \
  -device virtio-net-pci,netdev=net0
```

## 2. Local QEMU (Bridged LAN / Host Bridge `br0`)
```bash
sudo ip link add name br0 type bridge
sudo ip addr add 192.168.77.1/24 dev br0
sudo ip link set br0 up
sudo mkdir -p /etc/qemu
echo "allow br0" | sudo tee /etc/qemu/bridge.conf
sudo chmod 0640 /etc/qemu/bridge.conf

# Bundled script scripts/boot-qemu-bridge.sh .
qemu-system-x86_64 -m 512M -smp 2 -nographic \
  -kernel vmlinuz64 \
  -initrd tinycore-sqlite-wasm.gz \
  -append "console=ttyS0,115200 loglevel=3" \
  -netdev bridge,id=net0,br=br0 \
  -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:56
```

## 3. Google Cloud Compute Engine (GCE)
```bash
curl -fLO https://meta-tracing-tinycore.pages.dev/downloads/tinycore-sqlite-wasm-gce.tar.gz
sha256sum -c --ignore-missing SHA256SUMS
gcloud storage cp tinycore-sqlite-wasm-gce.tar.gz gs://YOUR_BUCKET/
gcloud compute images create tinycore-wasm-sqlite-v1 --source-uri=gs://YOUR_BUCKET/tinycore-sqlite-wasm-gce.tar.gz
gcloud compute firewall-rules create allow-wasm-sqlite-8080 --allow=tcp:8080 --target-tags=wasm-sqlite
gcloud compute instances create tinycore-wasm-sqlite --machine-type=e2-micro --image=tinycore-wasm-sqlite-v1 --tags=wasm-sqlite --metadata=serial-port-enable=TRUE
```

## 4. AWS EC2 Import (Nitro / ENA / NVMe)
Upload `tinycore-sqlite-wasm.iso` as raw format to S3, run `aws ec2 import-image` with `Format: "raw"`, and launch on Nitro/ENA (`t3.micro`, `c6i.large`, etc.) with inbound TCP 8080 allowed.
