#574·ravynos

Consider QEMU VM DEMO as PoC for proper CI/CD

Author: reactive-firewallCreated Jul 25, 2026Updated Jul 26, 2026

What the Demo Script Means

Regarding ravynOS.vm/run-ravyn.sh - The shell script that launches a QEMU virtual machine configured to run the ravynOS demo.

This provides a testable boot automation. Because Github runners (e.g., macos-26-intel for example) can use qemu to nest VMs already (just a brew install qemu away) this demo has also paved the way for a GHA CI workflow for testing ravynOS.vm boot-ability in CI.


The Idea:

Testing VM Boot in GitHub Actions (Nested VM)

Here's a CI-safe approach:

bash
#!/bin/bash
set -e

# Configuration
BOOT_TIMEOUT=60
SERIAL_LOG="vm-boot.log"
MAX_RETRIES=1
QEMU_SCRIPT="./path/to/the/run-ravyn.sh"

# Function: Run VM with timeout and capture serial output
run_vm_test() {
  local attempt=$1
  echo "Attempt $attempt: Booting VM..."
  
  # Run QEMU in background, capture serial output
  timeout $BOOT_TIMEOUT "$QEMU_SCRIPT" "$@" 2>&1 | tee -a "$SERIAL_LOG" &
  local qemu_pid=$!
  
  # Wait for VM to boot (check for success marker in serial output)
  local boot_success=0
  for i in $(seq 1 $BOOT_TIMEOUT); do
    # probably need to tweak this for ravynOS
    if grep -q "login prompt\|shell prompt\|boot completed\|ravynOS\|Welcome" "$SERIAL_LOG" 2>/dev/null; then
      boot_success=1
      break
    fi
    sleep 1
  done
  
  # Gracefully shutdown VM
  if ps -p $qemu_pid > /dev/null 2>&1; then
    echo "q" | nc localhost 55555 2>/dev/null || true  # Send 'quit' to QEMU monitor
    sleep 2
    kill -0 $qemu_pid 2>/dev/null && kill -9 $qemu_pid || true
  fi
  
  return $boot_success
}

# Main test
: > "$SERIAL_LOG"  # Clear log

for attempt in $(seq 1 $MAX_RETRIES); do
  if run_vm_test $attempt; then
    echo "✓ VM booted successfully"
    exit 0
  fi
  echo "✗ Boot attempt $attempt failed"
done

echo "✗ VM failed to boot after $MAX_RETRIES attempts"
echo "=== Serial output ==="
tail -50 "$SERIAL_LOG"
exit 1

Key Points for GHA Nested VMs:

  1. Timeout protection: timeout command ensures QEMU doesn't hang
  2. Serial log monitoring: Grep the serial output for known boot markers
  3. Graceful shutdown: Use QEMU monitor protocol or kill -9 fallback
  4. Log artifacts: Upload $SERIAL_LOG on failure for debugging
  5. No initial display service needed: Serial-only output works in headless CI

GitHub Actions Workflow Example:

yaml
- name: Test VM Boot
  timeout-minutes: 5
  run: bash .github/scripts/test-vm-boot.sh
  
- name: Upload VM serial log on failure
  if: failure()
  uses: actions/upload-artifact@v3
  with:
    name: vm-boot-logs
    path: vm-boot.log