# Architecture & Security

> How Reims-Go bridges Metal to Vulkan across the VM boundary, isolates GPL/LGPL runtimes, and enforces loopback-only zero-telemetry security.

- **Canonical URL**: https://reims.dev/en/docs/architecture-security
- **Chinese Version**: https://reims.dev/docs/architecture-security.md
- **Section**: CLI & Architecture
- **LLMs Index**: https://reims.dev/llms.txt

---

Reims-Go is engineered around three structural commitments: **real hardware GPU acceleration**, **clean license and process isolation**, and **zero-telemetry loopback security**.

## Five-stage Metal → Vulkan GPU pipeline

Without hardware acceleration, macOS WindowServer and graphics apps fall back to software rendering with severe frame drops. Reims-Go integrates a five-stage graphics bridge derived from upstream `reims-vgpu`:

1. **Metal app (Guest)**: macOS desktop compositor and Metal 3 applications issue unmodified Metal rendering and compute calls.
2. **Reims Guest Driver (Guest)**: Captures guest Metal API calls and serializes them into a compact, low-latency command stream.
3. **Virtual GPU (`reims-graphics-pci`)**: Exposes a virtual PCIe graphics device across the QEMU virtualization boundary to transfer the command stream with minimal overhead.
4. **`metal2vulkan` translator (Host)**: Translates Metal pipeline states, shaders, and texture operations into standard Vulkan 1.3 calls in real time.
5. **Windows discrete GPU (Host hardware)**: The host Vulkan 1.3 ICD renders and composites frames natively on hardware.

Before launch, Reims-Go validates Vulkan 1.3 support and required extensions while filtering out stale Windows registry ICD entries that could otherwise break Vulkan initialization.

## Process and license isolation

- **Desktop client (`Apache-2.0`)**: Built with Go and Wails, managing UI, configuration, direct Apple image downloads, Guest Tools host services, diagnostics, and CLI subcommands.
- **Portable runtime (`GPL / LGPL`)**: Bundles customized QEMU, OpenCore assets, and the `metal2vulkan` engine in a separate portable package invoked strictly as a child process. Matching source archives and `SHA256SUMS.txt` accompany every runtime release.
- **Zero Apple file distribution**: No Apple binaries, system images, or proprietary keys are shipped in the repository or release assets.

## Loopback security and least privilege

Reims-Go keeps its network and privilege surface minimal by default:

- **Loopback-only binding (`127.0.0.1`)**: Clipboard sync, WebDAV shared folders, SSH forwarding, and CLI-to-tray control channels bind strictly to localhost—never `0.0.0.0`.
- **Per-VM 256-bit tokens**: Each VM launch receives an ephemeral 256-bit random token to authenticate local host-guest service requests.
- **Path boundary enforcement**: Guest Tools v8 enforces unified root path boundaries on WebDAV and sync operations, rejecting `..` traversal and escaping symlinks.
- **On-demand elevation only**: Daily VM operations run as a standard user. UAC elevation is requested only when you explicitly ask Reims-Go to enable WHPX.
- **Zero telemetry**: Outside explicit user actions (Apple downloads, GitHub update checks, and marketplace sync), Reims-Go sends no analytics or usage reports.

## Portable data directory

All virtual disks, runtimes, images, and plugins reside inside your chosen data directory. Uninstalling requires only exiting the tray app and deleting the executable and data folder.
