Map: synod
Synod shares the folders a person chooses with an office assistant, in a
hardware VM or offline on the host, adds and withdraws them while it runs, and
accounts for each folder’s changes after each job. It is a
desktop product: synod::PRODUCT supplies its persona,
grants and prompts. An account reads metadata, never file contents, and offers
no restoration operation. Sharing and withdrawal are decided in
hot-shared-folders.
The crates
One runtime agreement connects the host, guest, engine and image tools (the-vm-crates-are-layered).
guest-abi— dependency-free, std-only runtime constants, boot grammar, packet framing and the mounts wire.ral-core— the engine, wire transport, path judgments and pure egress policy data; it depends onguest-abi.exarch— provider machinery, agents, the threaded fleet host, policy loading and guest-engine construction over core andguest-abi; its defaultvmfeature addsexarch::vmovervm-managerandnetgate.netgate— host CONNECT gate, TCP/IP stack and audit ledger; it depends on core andguest-abi.vm-manager— machine construction, lifecycle and media; its runtime workspace dependency isguest-abi, and it has no privileged half.ral-guest— binary-only Linux PID 1 overguest-abi.ral-vm-image-build-tools(vm-image/build-tools/) — manifest production and checking over core andguest-abi.desktop— the shared GUI shell over core,exarch,vm-manager,netgateandguest-abi.synod— thin binary and library overdesktop,exarch, core,vm-managerandguest-abi;exarch-guiis its sibling overdesktop,exarch, core andvm-manager(exarch).
guest-abi/ and ral-guest/ — the guest
One PID 1 assembles and supervises the guest without an exec between stages.
guest-abi/src/{boot,ports,link,layout,packet,mounts}.rsowns the runtime agreement.boot::Netvalidates routing once and preserves it through private fields. Changes to boot, layout, framing,mounts, the factory port or the mounts port bumpboot::CONTRACTbeside its writer and reader.- The boot line names no folder (
CONTRACT5).mountscarries the host’s folder requests to PID 1 onports::MOUNTS:Request::{Mount, Unmount, Vacated}andReply::{Done, Busy, Failed, InDoubt}, over the checkedTag,FolderNameandMark. The engine path defaults because it belongs to the image. ral.portandral.netname separate host-side control and network ports: confusing them connects different protocols. Without a network, the engine receives no proxy environment for a missing peer.packetis shared by host and guest without a Linux gate to prevent codec drift. Frames have no prologue and reject invalid lengths before allocation. Rawread_exactprevents read-ahead bytes being lost on descriptor handoff; framing or I/O failure ends the link because a frame boundary cannot be guessed.ral-guest/src/main.rsrefuses a non-init process before any side effect, ignores argv, then callsassemble::assembleandinit::serve.assemble/{plan,run}.rsloads modules to a fixpoint, adopts the console, probes rootfs/session disk pairs, formats the session disk, assembles the overlay, installs the engine, reclaims the initramfs and switches root. Mount primitives are shared throughmount.rs.- Module metadata supplies a load-order hint; missing symbols can resolve after
another pass, so loading repeats while it makes progress. An absent manifest
permits kernels with built-in drivers;
EEXISTalready satisfies a requirement. - The host supplies the boot clock because the guest has no reliable RTC. It is set once; long sessions can drift, and further correction belongs on the protocol rather than under a second clock authority in PID 1.
init/serve.rsorders clock, mounts, cgroups, the read-only/work, sysctls, the mounts listener, control dial, networking, root engine, factory and theral-mountsthread.reap::maskblocks signals before threads; children unmask before exec.engine.rsconstructs one closed command/environment and hands each engine its stream unread on fd 3. Each engine joinsENGINE_CGROUP(/sys/fs/cgroup/ral-engine, besideral-exec) first thing inpre_exec, through acgroup.procsdescriptor opened before the fork; a failed join fails the spawn.mount.rs::workmakes propagation private, the root-only/run/raland its stage, and a tmpfs alias at/run/ral/workbound onto/workand remountedRDONLY | NOSUID | NODEV./workholds only the folders’ mountpoints.init/mounts.rsbindsMOUNTSbefore the control dial and runs theral-mountsthread, which serves the host’s requests in order and powers the guest off after anInDoubtreply.folders.rsstages a share at/run/ral/stage, checks VZ’s idle mark there, moves it onto/work/<name>,statfses the other live folders, and certifies a withdrawal with a non-lazy unmount, scanning/procfor holders onEBUSY:Busyonly when every holder found is a detached command (inral-exec), its text only the list of those commands; a holder outside it, such as an engine, givesFailed, naming it.maintenance.rsfreezesral-engineand stopsral-exec’s survivors, each wait bounded.FROZEN_BUDGET(10 s) is checked once, after the frozensyncfsand beforeumount2; that flush, the unmount and the holder scan may overrun it. Only the host’sREQUEST_PATIENCE(60 s) ends the window, by ending the machine.- Each guest engine installs core’s per-command jail: the one unprivileged
GUEST_ID, cgroup budgets,NO_NEW_PRIVS, descriptor marking and seccomp, plus a private network namespace fornet: `offline.sysctl.rssetskernel.yama.ptrace_scopeto 3 anduser.max_user_namespacesto 0 before any engine runs, a failure ending the boot; one command may still signal another and read its read-mode/procentries. Every command’sHOMEislayout::HOME(/tmp/home), whichmount.rsgives toGUEST_ID. The admitted utility and descendants have no per-grant fs/exec projection; VM mounts/topology and Unix modes remain the file perimeter, and hostNetPolicyremains the destination gate (guest jail boundary). init/fleet.rsowns admission and the host-CID-only engine factory; binding precedes the root spawn.exarch::vm’s machine factory dials this listener to create one engine per helper.init/halt.rsowns reaping, deepest-first engine cgroup cleanup and TERM/grace/KILL shutdown withcgroup.kill. Engine cleanup spares the sharedral-exec/detachedsurvivor leaf. Halt closes the fleet, thawsral-engine(a freeze is written only while the fleet is open, under its lock), then kills the wholeral-exectree, including that leaf, andral-engine.pump::startowns tun/net descriptors in two threads, one writer per direction, with rawread_exact. Any I/O end or caught panic records the first fatal notification throughreap::failand signals PID 1 with TERM. Root exit ends the session; the root is never restarted.
netgate/ — the host network boundary
The guest’s tun has one peer: a host TCP/IP stack that admits only vetted CONNECT destinations, with no network adapter on the VM (egress).
ral_core::egressownsHost,NetPolicy,admitsand refusal text; exarch loads policy and passes only its search bit to the agent.netgate/src/lib.rsexportsrun,Config,Session,Dialer,System,AuditLogandLEDGER.stack.rsownsConfig,pipe.rsownsWake, and privaterefusal.rsserves decoding and vetting.connect.rsdecodes bounded CONNECT headers;vet.rsresolves once, rejects non-public addresses and dials only vetted destinations.ledger.rsowns strict-poison audit writes and rotation: admission is recorded before sending 200, refusal before returning it, and close includes byte counts.device.rsuses core’sWireStream;pipe.rsowns bounded rings and backpressure. Directional EOF is independent of whole-worker retirement: upload EOF shuts the origin’s write half; download EOF closes only output. A full frame inbox drops packets so guest TCP backs off; transmit blocks on the wire. Full byte rings leave bytes in smoltcp’s receive buffer. Rings ignore poison because joining reports worker panics and surviving peers must remain able to wake; ledger poison stays strict.stack.rstracks live workers without joining them on the poll thread. Drained output can send FIN; whole-worker completion startsFIN_GRACE.Session::{stop, join}wakes and joins the workers. There is no active tunnel timeout;TUNNEL_CAPbounds the population.
The stack speaks bare IP (medium-ip) because its peer is a tun, with no
UDP sockets. Vetting and dials raise no separate card: their accounting is
the ledger, and the invoking exec already surfaces the operation. The fuzz
workspace isolates nightly/libfuzzer dependencies; ordinary parser tests
replay its corpus. Loopback tests retain real address vetting but dial local
fixtures, and run serially because thread-count assertions are process-wide.
Timeout margins allow scheduling jitter; finite join waits make a hung
session fail its case instead of hanging the suite.
vm-manager/ — machines and media
The crate root is the public facade; backend children import their owning modules directly. Only real machines are constructed.
spec.rsownsShare { folder, read_only }and itsresolve,SIZE(4 vCPUs, 6144 MiB) andboot_line, the caller of the sole ABI command-line writer.machine.rsownsBooted,Wires,Socket,MAX_FOLDERS(8),StopEvidence,Withdrawn,MountError { Refused, Ended },UnmountError { Refused, Busy, Ended }and theHypervisor/Machinetraits;Hypervisor::boot(&self)boots with no folder, and every machine method is required.shares.rs::Sharesis the backend-independent order of every sharing change over the mounts wire: expose then mount; certify the unmount, then withdraw; roll back a refused mount; and end the machine, withStopEvidence, on any change it cannot confirm. Every later call returns that ending.mountresolves the folder before refusing a duplicate name. A backend supplies only anExposure: itsDevice(au32index on OpenVMM, ausizeslot on VZ) andtag, built bynumbered, the one total tag constructor, with no tag parsed back; expose, withdraw, its idle mark if any, and end.PLUG_PATIENCE(15 s) bounds each backend’s half, client-side. The guest’s text gives the cause; the host adds the consequence.direct(artifact)anddetect(media)check availability before construction and resolve artifacts before another process opens them;available(exe, flavor)checks the backend, its entitlement and the media’s presence, never inflating or hashing them.detectchecks availability before invoking its lazyBootMedia, so a refused host inflates nothing. Missing hardware support, entitlement, WHP,openvmm.exeor media gives a refusal. MSI cabinets cannot hold a two-gigabyte rootfs file, so installed media is compressed.media::locate(exe, flavor)reads nothing: it tries bundle../Resources/boot, then installedbootbeside the executable, where an installation ships one rootfs (rootfs.img.zstwith its checksum, elserootfs.img), then atargetancestor’s checkout, whose rootfs is per flavor (vm-image/out/rootfs-<RootfsFlavor::name>/). Failing all, it isError::NoGuestImage { flavor, looked_in }, naming thejust vm::rootfsrecipe.Layout::readyverifies and publishesrootfs-<sha256>.img, the raw disk both backends attach.publishlocks<leaf>.lock, prepares a unique temporary file, syncs it and publishes without replacement.inflatebounds the zstd window.lifecycle.rs::await_dialsreceives control and net against one 60-second deadline; its refusals (Undialled, with a per-wire cause, orEndedBeforeDialfor a guest power event) quote the console and name the hypervisor’s own log when it has one.stop_withinpolls everyPULSEfor five seconds before forcing, and a force that fails is returned in place ofForcedStop.SessionDiskholds a std exclusive lease in a uniqueral-vm-session-<epoch>-<pid>-<suffix>directory undertemp_dir(), the one session directory on both backends. It is private from creation: mode0700on Unix, and on Windows a protected owner DACL given toCreateDirectoryW; there it also holds the backend’sAF_UNIXsockets.session.imgis sparse andSESSION_BYTES(8 GiB) on both. Removal retries for two seconds;sweepreclaims aged, unleased directories without following links or other reparse points, and one predicate admits our own socket entries (r.sock,v.sock,v.sock_<digits>, each anAF_UNIXreparse point) to bothDropandsweep. On macOS it also holdsidle/, VZ’s idle share, whichDropandsweeprecognise by shape.error.rsowns data-onlyError;worded(spell)renders at the caller’s boundary.GuestConsole::{Kept, Unkept}distinguishes a retained empty console from no retained copy.GuestConsole::reportsupplies engine-loss diagnostics. Windows refusals includeHypervisorPlatformOff,NoVmm { looked_in },SocketPathTooLong { path }(set bothTMPandTEMP, since Windows readsTMPfirst),NoPlainSpelling(a path Win32 would read as another) andVmmFailed(OpenVMM’s own failure, with its log’s tail), each naming its remedy. Sharing addsTooManyFolders,MountRefused,UnmountRefusedandMountsUndialled, which reads as a socket-transport fault, since the guest listens onMOUNTSbefore it dials; an outdated image is named bystale_imageunderUndialledandEndedBeforeDialon the control wire.vz/{mod,config,queue}.rsowns the macOS arm64 machine, configuration and serial-queue operations. It requires the virtualization entitlement, bootsMAX_FOLDERSvirtio-fs slot devices (s0…s7) on a per-boot idle share, attaches RO rootfs and RW sparse session disks, and multiplexes both accepted wires on one vsock device, dialling the mounts port after them.Slotspoints a slot at a folder withsetShareon the machine’s queue; the guest’s mount confirms it against the idle mark, andVacatedconfirms each withdrawal.force_stopobserves its completion. Every wait on the machine thread is bounded:PLUG_PATIENCEfor share, unshare, force and the stop on shutdown or drop (kept above twiceSTOP_GRACEat compile time);BOOT_PATIENCEfor the boot report;CONNECT_PATIENCEfor a guest dial. Its console goes to stdout without a retained copy. The generatedobjc2binding avoids a Swift shim and its second toolchain; configuration construction needs no entitlement, but validation already does.openvmm/{mod,hypervisor,proto,relay,ttrpc,process,afunix,console,win}.rsowns the Windows x86_64 machine: one unprivilegedopenvmm.exeon WHP, spawned by absolute path into a kill-on-close Job Object it joins at creation, and ready oncer.sockaccepts (windows-runs-openvmm).proto.rsandttrpc.rshand-encodeCreateVM,ResumeVM,AddVpciDeviceandRemoveVpciDeviceoverr.sock; withrelay.rs’sCONNECT/OKparser they compile undercfg(any(windows, test)), so their golden tests run on Linux. The machine has direct kernel boot, raw rootfs and session disks on VMBus SCSI, a VPCI virtio-fs device hot-added per folder byDevices(tags<n>andinstance_id(n), never reused;metadataormetadata;ro), which owns the boot’s RPC client andlive: Option<(Vmm, SessionDisk)>, taken by the first stop (Devices::end, orGuest::stopthroughShares::exposure()); the hybrid vsock relay atv.sock, a COM1 console that OpenVMM opens on the host’s pipe, and no network adapter. Guest power events exit the process (0 shutdown, 64/65/66 reset/crash/watchdog), and the exit code is the stop. The console tees stdout, a bounded log and a line ring; OpenVMM’s stderr is a sibling log. Guest RAM is committed at boot and faulted in lazily.Machine::dial_engine(&self) -> Result<Socket, DialError>asks forguest_abi::ports::FACTORY;connect_guest(&self, port: u32)has the same result type. Both backends implement it: macOS on the vsock device, Windows byCONNECT <port>onv.sock, where a port with no listener isDialError::Unanswered.dial.rsownsDialErrorandDialBackend, independent of ral-core. Failures retain machine/device/completion state, timeout versus disconnected wait, backend and native platform domain/code/detail, or the originalio::Error. Presentation does not replace this evidence.
synod/src/ — the product
synod supplies product identity, grants and prompts to desktop::run;
window plumbing, folder accounting and narration are
desktop’s, and the machine is exarch::vm’s.
src/lib.rsdefinesPRODUCT(synod::product()):exarch::app::SYNOD(providers.ral),StrictOffice,RootfsFlavor::Office, live pages on, diff review and mid-session model switching off,RuntimeMode::Vmby default, no profiles, and ChatGPT sign-in. Its network policy isnet_policy::load()in a machine andNetPolicy::offline()on the host.src/grant.rsowns the officeTOOLBOX(bare names, so image additions never widen the grant),vm_ceiling(guest/workand scratch, the toolbox, no editor, no GPU;shellleft open, since the machine bounds every survivor; pinned atsrc/golden/ceiling-grant.md) andhost_stack(the shared folders and scratch, the toolbox and bundled tools,ShellVerb::ChdirwithoutDetach, GPU withheld, offline, sealed byexarch::policy::secure_host_stack). Python andfind -execmake the toolbox a job policy, not containment.src/prompt.rsassembles both prompts overdata/*.mdandexarch::prompt::{RAL_REFERENCE, EDIT_REPLACE}.assemble_vmspeaks of/workfolders, the installed toolbox and the guest network (data/network.md);assemble_hostsays only what holds on the host: the grant’s programs run only where installed, nothing installs, and the network is off (data/host-network.md). Optional house rules come from trusted config; surface then live-page guidance (data/live.md) come last.data/network.mddescribes destination admission on port 443 to vetted public addresses, not an information-flow boundary (egress).src/main.rscallsexarch::exit_if_re_exec_child()first, thendesktop::run(synod::product(), context)on GUI builds, ordesktop::run_unavailable.build.rsguardstauri_build::build();tauri-buildstays an unconditional build dependency for cross-target checks.
vm-image/ — build and packaging
Boot compatibility is checked by the image tools before bundling.
common.shis the skeleton both builders source: host-derived architecture (no override, no cross-building), mirror, podman and emulation check, staging, and lock-then-swap publication.build-rootfs.sh [office|dev]builds a flavor’s image frompackages-<flavor>.txtin a native arm64 or amd64 container intovm-image/out/rootfs-<flavor>/, with checksum and package manifest, the ext4 labelral-<flavor>and a per-flavorFS_UUID. It adds theworkuser (GUEST_ID, homeHOME);officepre-builds the font cache and spot-checks its document tools, anddevfails unlessgcc,gitandcargorun.vm-image/README.mdrecords the pipeline and remaining image questions.build-boot.shbuilds static muslral-guestandexarchseparately (exarchwith--no-default-features --features coreutils), packages PID 1 as/init, and writes kernel, initramfs andboot-manifest.txt. It refuses kernels withoutCONFIG_SECCOMP_FILTER,CONFIG_NET_NSorCONFIG_SECURITY_YAMA, or whoseCONFIG_LSMomitsyama, keeps a persistent cargo cache, and under WSL builds from an ext4 copy of a drvfs checkout.build-tools/src/manifest.rsownsread,checkandlines.media-manifestcompilesboot_contractandproto_versionfrom their defining constants;check-mediacompares them. Present media without a readable manifest is refused; absent media is left to bundling.- Each product’s
tauri.bundle.conf.jsonalone carries its flavor’s guest media, and runscheck-mediafirst;tauri.bundle.notices.conf.jsonalone carries its third-party notices, andtauri.bundle.windows.conf.jsonalone stagesopenvmm.exe, its licence andTHIRDPARTY-OPENVMM, so a checkout without them still compiles. Linux has no VM backend, so its bundle takes the notices but no guest media. Generatedgen/permissions stay ignored.
Verification boundary and related reading
The source describes behavior; a successful build alone does not witness a machine boot.
- The macOS path has prior end-to-end exercise of a boot-time folder. The
Windows OpenVMM backend awaits native acceptance on a standard account: a
boot, virtio-fs metadata on NTFS, host-to-guest dials, the named-pipe
console and job containment. Live folder sharing awaits native acceptance
on both platforms, VZ’s
setShareon a running machine above all (hot-shared-folders).vm-manager/examples/boot-smoke.rsboots empty and exercises sharing with two to eight folders. - The image README holds build instructions.
- desktop, agent, frontend and engine-protocol locate the shared shell, reusable guest engine, conversation bus and wire semantics.
- boot-contract-is-versioned, session-disk-outlives-its-machine and guest-console-outlives-stdout record the media, disk and diagnostic laws.