Skip to content

C11 - Host Daemons, Audit, and Disks

Purpose: The test cases for the host daemons’ own checks: wb-vmd’s device set and slots, the image build bundle, supervision, the accounting and event channels, the daemon log pipes, the audit writer, free space, and the data disk steps.

Verifies: S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from. (“The device set is fixed and checked”, “Guest ports below 1024”, “Hand-off on macOS”, “The host opens every connection”, “Caps and closing”), S06-12-guest-agentS06-12-guest-agent: Guest AgentWhat wb-guestd, the service in the guest, does for the host, and how it updates itself. (“The hello”), S06-11-reconnect-and-recoveryS06-11-reconnect-and-recovery: Reconnect, Loss and RecoveryWhat happens when the host-guest link drops, when a session is lost, and how a lost session's work is recovered or discarded. (“Reconnect”), S06-06-devices-and-warm-startS06-06-devices-and-warm-start: Devices, Warm Start and TimeA VM's devices and resources, saving and restoring its state, and how the guest clock follows the host. (“When the host sends the time”, “Network device per slot”, “The Xcode disk”, “MAC address”), S07-02-packet-pathS07-02-packet-path: Packet PathHow wb-netd carries the guest's frames: the packet transport, the stack, the link filter, its caps, addressing, the MTU and connections. (“Packet transport”, “MTU”), S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs. (“Host work the guest can cause”), S04-03-self-sandboxingS04-03-self-sandboxing: Self-SandboxingHow each host daemon confines itself at startup, and the wb-launcher that starts confined programs on macOS. (“Each host daemon is self-sandboxed”, “Confined first thing in main”), S04-07-supervisionS04-07-supervision: SupervisionWho starts and restarts each host process, what happens when wb-hostd stops or the bundle is upgraded, and daemon outages., S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh. (“wb-build-ssh”), S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach. (“Message form”, “Streams”, “Resets”), S07-06-name-mappingS07-06-name-mapping: Name MappingHow wb-proxyd keeps its own checked copy of the names wb-netd gave synthetic addresses: name reports, releases, replay, lifetime, the second count of the wildcard budget, and the copy wb-hostd keeps. (“Name reports”, “Releases”), S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs. (“Accounting and event channels”, “Logs and health”), S06-05-disksS06-05-disks: DisksA VM's system disk and data disk: how the data disk keeps what the guest flushes, and how the guest mounts it., S06-13-data-disk-formatS06-13-data-disk-format: Data Disk FormatHow the host formats a VM's new data disk, the one exception SEC15-no-guest-disk-mount makes, and the checks before a VM starts with its disk., S09-11-auditS09-11-audit: AuditWhat the audit log records, the budgets that bound it, and what happens when the log can't be written., S09-13-event-sendersS09-13-event-senders: Event SendersHow wb-hostd tells the senders of event records about the audit budgets, what it holds back, and when it stops a VM for its records., S04-04-vm-processesS04-04-vm-processes: Per-VM ProcessesOne wb-vmd for each VM, the wb-vmd-layer entry of the Claude Code layer build, the wb-vmd-recipe entry of a named image's recipe, and wb-diskfmt, which formats a VM's new data disk., S05-03-management-commandsS05-03-management-commands: Management CommandsThe commands of wb other than the agent commands. (“wb vm”), S06-07-slot-admissionS06-07-slot-admission: Slot AdmissionHow wb-hostd admits every macOS VM it starts against the limit of two, and lends the isolated VM's slot to a maintenance VM. (“Other software”), S06-12-guest-agentS06-12-guest-agent: Guest AgentWhat wb-guestd, the service in the guest, does for the host, and how it updates itself. (“Guest tools disk”)

  • With WB_VM_TEST_BUNDLE naming a spike bundle, mise run swift:test-vm clones it into the work slot and starts the signed wb-vmd with its start interface. See RUNNING through WatchState, the logged device list equal to the fixed set, a forced stop reach STOPPED, a data disk linked out of the bundle refused with device-set-file-outside-bundle and wb-vmd still answering, and a closed lifeline end the process with status 0. The slot is deleted afterwards. Pass or fail, the test prints how wb-vmd ended and every record it logged. After the first start reaches RUNNING, the test reads the KIND_NETWORK record from the hand-off channel and waits up to 300 s for a DHCPDISCOVER from the VM’s MAC address on the transport.

  • Install (VMInstallTests, needs-vm and needs-host). With WB_VM_TEST_RESTORE_IMAGE naming a restore image in the spike cache, mise run swift:test-vm clones it to <data>/images/macos-restore.ipsw, makes the build bundle with tools.img and an empty sparse 8 GiB data.wbdisk in it, and starts the signed wb-vmd in the build slot with descriptor 5 a pipe. The test refuses to run when the bundle or the image is already there. See Install stream rising percents that end at 100 and no error, the bundle hold the six bundle files, the bundle boot to RUNNING with the build slot’s fixed set, a forced stop reach STOPPED, and a closed lifeline end the process with status 0. The install’s time is logged with measure:. The test deletes the bundle, the clone, and the directories it made. The install calls Apple’s signing server over the host’s network (X30-installer-trustX30-installer-trust: Installer refusal of a changed restore imageDoes the Virtualization framework's macOS installer, run by wb-vmd-install, refuse a restore image that Apple didn't sign, or one with a changed or replaced component, and does the install contact Apple while wb-vmd-i…).

  • wb-hostd on a VM (TestC11HostdVM in cmd/wb-hostd, needs-vm). With WB_VM_TEST_BUNDLE naming a provisioned test bundle, mise run go:test-vm builds the bundle. The test clones it into .scratch/go-test-vm/test-app with a wb-vmd and a wb-diskfmt built with a test data root of its own (S06-05-disksS06-05-disks: DisksA VM's system disk and data disk: how the data disk keeps what the guest flushes, and how the guest mounts it., “Test data root”), and runs the test binary as wb-hostd from the clone, with <config> and <logs> in .scratch/go-test-vm. The test data root is a new directory under the system’s temporary directory, which the test removes at its end. The test fails when the real <data> exists at the end and didn’t at the start, or the other way round, or when its inode or modification time changed. A file made or removed directly in <data> changes the modification time, and one deeper down doesn’t. Through wb vm it checks:

    • start links, status shows the guest’s version equal to the build’s and the generation, tools.img has a new inode, and the boot’s time call took under 1 s;
    • closing wb-hostd’s end of the link (SIGUSR1 to the child) links again within 2.1 s;
    • stop reaches stopped, and wb-vmd exits;
    • after kill -9 of wb-hostd, its wb-vmd exits by the lifeline. A new wb-hostd starts the VM at once, and the test logs the outcome;
    • a bundle whose tools disk has another build’s wb-guestd and VERSION: start exits 255, and status shows the refusal with peer-version-mismatch and both versions.

    Each measurement is logged with measure:. Runs:

  • Restore image. A wb-vmd-install whose restore image is a symbolic link, or not at the fixed path, logs vmd-restore-image-mismatch before sandbox_init (BuildSlotTests checks the slot resolution without a VM).

  • Provisioning. An instance in the work, isolated or layer slot refuses provisioning options with vmd-provisioning-refused, and the build slot accepts them (ProvisioningCheckTests).

  • Launcher table. A table test on the wb-launcher entries checks that each wb-vmd entry’s WB_VMD_SLOT value and its bundle parameter belong to the same slot. TestDiskfmtEntries checks the same of each wb-diskfmt entry’s WB_DISKFMT_SLOT, and that its environment holds nothing else.

  • Leave a symbolic link, a hard-linked file, or a directory at the sealed disk’s name in the build bundle, and see the build fail with build-bundle-not-regular, nothing cloned into <data>/images/, and nothing outside the bundle deleted.
  • Send wb-hostd a port 22 socket from a session VM’s wb-netd, one while no build waits for it, and one in a message with two descriptors. See each refused with build-socket-refused and every descriptor closed. Start wb-build-ssh with a socket of another type, and see it exit with build-ssh-socket-refused before it reads its standard input (S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh., “wb-build-ssh”).
  • See wb-hostd log build-socket-accepted for the build VM’s socket.
  • Run wb-build-ssh against a test SSH server whose output repeats the password, whole and split across two reads and across a line cut, and see the password in no log line. See the server’s banner in no log line, and its version and disconnect text escaped and cut.
  • Run it against a server that never finishes the handshake, one that goes quiet in the session, and one that writes output without end. See build-ssh-login-timeout, build-ssh-idle-timeout and build-ssh-output-limit, and the build fail.
  • Run it against a server that writes one byte of output every 90 s, past the session deadline, and see build-ssh-deadline and the build fail.
  • See it offer only password authentication to the test server.
  • One descriptor per message (S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., “Message form”). Over real socketpairs, records with and without a descriptor round-trip. An oversized record, two, three and 254 descriptors are each refused with every descriptor closed. A message whose descriptors don’t fit the full descriptor table is dropped, and a send to a full peer fails at once.
  • Order and no silent drop (S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., “Transport”). On macOS, TestOrderUnderLoad in internal/platform/fdchan sends 100,000 numbered records of mixed sizes up to 4 KiB, every tenth with a pipe, over Socketpair(4096). The sender gives each record a 5 s deadline and retries a send that fails with ENOBUFS or EAGAIN before it sends the next. A receiver that pauses now and then sees every record once, in order, with its bytes, and reads each pipe under a read deadline. The counts sent and received are equal, and at least one send found the channel full. TestQueueDepth sends with no retry until a send fails with ENOBUFS or EAGAIN, and logs the depth: 19 records of 4 KiB, 292 of 264 bytes.
  • Egress contract form (S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., “The contract”). In internal/egressmsg, each decoder refuses a record that is empty or over 4 KiB, doesn’t decode, holds a field of another message or of a later build at any depth, doesn’t set a kind, or carries a descriptor its kind doesn’t take or lacks one it does. A name in another form than canonical is refused with name-form, an address outside 198.18.0.0/15 with synthetic-range, and a VM that isn’t a slot with vm-slot. A HandoffSocketClosed with another rule than name-report-malformed or another check is refused. A control message before the start message, and a second start message, are refused. TestLinkRoundTrip: a NetdStart gives back the link it was written from. TestDecodeHostdToNetd: one with no addressing, a short or multicast MAC address, one MAC for both ends, a prefix length outside 8 to 30, host bits in the subnet, a gateway outside it, or the network or broadcast address as the lease is refused with the check addressing. TestMACOrder: with both MACs wrong, the guest’s is the one refused. A payload pipe that isn’t a pipe, has a length over 64 MiB, isn’t whole by its deadline, or has a byte after it is refused with payload-read. TestMaxPayloads builds the largest payloads the bounds allow and sees each under 64 MiB.
  • Hand-off receiver (S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from., “Hand-off on macOS”). Tests in internal/platform/vmhandoff and internal/vmdlink: over a real socketpair, each refusal of the receiver and of fdchan has its rule, and no descriptor of the record is open after it (fcntl). A record without a kind, or of an unknown one, is refused with handoff-kind. A good record gives its request a working connection, and the hello runs over it end to end with a fake wb-vmd. FuzzHandoffMessage checks that no record of arbitrary bytes, the empty one included, is accepted unless it names the open request, the current generation, the host’s direction and the requested port, or is the one packet transport of the current generation, and that every record that decodes has a HandoffAck that names it. TestAckAccepted and TestAckRefused: an accepted connection, an accepted packet transport and a refused record are each acknowledged, and a record that doesn’t decode isn’t. TestAckSendFailed: an acknowledgment that can’t be sent is logged with handoff-ack-send-failed.
  • Packet transport hand-off (S07-02-packet-pathS07-02-packet-path: Packet PathHow wb-netd carries the guest's frames: the packet transport, the stack, the link filter, its caps, addressing, the MTU and connections., “Packet transport”). In internal/platform/vmhandoff: a KIND_NETWORK record of the current generation with an AF_UNIX datagram socket gives the waiter a Transport whose only methods are Close and StartWith. TestStartWith: a child started with it inherits the descriptor in the given slot, the slot is empty again after the start, a failed one included, and a slot that isn’t an empty placeholder is refused. A record of generation 0 or another generation, one nobody asked for, a generation’s second one, one with a request ID, direction or port, and one with a stream socket are each refused with handoff-network-refused, with no descriptor left open. A newer generation’s request closes the older one’s. In internal/vmdlink: Start returns the transport, a refused or missing one is refused with its rule and doesn’t leave a descriptor open, and a refused Start returns wb-vmd’s error.

Spec: S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., S07-06-name-mappingS07-06-name-mapping: Name MappingHow wb-proxyd keeps its own checked copy of the names wb-netd gave synthetic addresses: name reports, releases, replay, lifetime, the second count of the wildcard budget, and the copy wb-hostd keeps., S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs. (“Accounting and event channels”). Tests in internal/netd/handoff and internal/netd/hostlink, over real fdchan socketpairs on macOS:

Spec: S04-09-netd-startS04-09-netd-start: Starting `wb-netd`How wb-hostd starts and stops each VM's wb-netd, what the program inherits, its profile, and what it does before its start message..

  • Start interface. In cmd/wb-netd on macOS, the tests start the built program as wb-hostd does, with no arguments, an empty environment, descriptors 2 to 6, and a fake guest on a datagram socketpair. TestChildServes: a flood of frames before the start is drained, DHCP leases the start message’s address, an allowed name gets a synthetic address only after its accounting record and its name report, and the confined process exits 0 when the control channel closes. TestChildRefused: an argument exits with netd-arguments, and no descriptors or a stream socket as the transport, and an open descriptor above 6, exit with netd-descriptor-invalid, each with status 1. TestChildTransportEnds: a guest end that closes ends wb-netd with netd-failed and status 1, not netd-stopped. TestFirstOpenFrom in internal/platform/fdchan: the walk finds an open descriptor and skips a closed one. TestCloseOnExecFrom: a descriptor without close-on-exec gets it. After a descriptor refusal, the confinement has already denied a read outside the profile.
  • Drain before the start (S04-09-netd-startS04-09-netd-start: Starting `wb-netd`How wb-hostd starts and stops each VM's wb-netd, what the program inherits, its profile, and what it does before its start message., “Drain before the start”). TestGateDrains: frames before the start message are read at once and dropped with link-not-started, and the stack reads the frames after it. TestPolicies: before the first policy no name and no port is allowed (SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable.), and after it the policy’s are.
  • Started by wb-hostd. In internal/hostd/netdproc on macOS, with the real wb-netd: TestC11NetdStartAndStop starts it, sends the start message and the first policy, sees the acknowledgment, and at the stop sees it exit 0 with netd-stopped. TestNetdEndedExits: a wb-netd ended with netd-ended exits. TestStartRefused: a transport that can’t hand its descriptor on, a multicast or short MAC address, and a program that isn’t wb-netd are each refused with netd-start-failed. TestInheritedDescriptorNotPassed: a descriptor without close-on-exec in wb-hostd is marked with inherited-descriptor and doesn’t reach wb-netd, which starts. TestNetdStopTimeoutKills: a stopped wb-netd that doesn’t exit after the control channel closed is killed with netd-stop-timeout.
  • The VM’s run (internal/hostd/vm). TestC11NetdStartsAndStopsWithTheRun: the run’s wb-netd gets the VM’s MAC address and transport, is stopped before the transport copy closes, and its open accounting runs are in the stop record. TestNetdStartFailedRefused: a failed start refuses the VM start with netd-start-failed. TestNetdExitStopsTheVM: a wb-netd that exits during a run stops the VM with netd-exited. TestNetdExitDuringStartStopsTheVM: a wb-netd that exits before the VM is running still stops it with netd-exited. TestNetdExitDuringStopKeepsTheStop: an exit during a requested stop leaves that stop’s vm-stop rule. TestNetdPreparedBeforeTheVM: the policy is loaded before the provider’s start, and a failed load refuses the start with netd-start-failed before the VM starts.

Spec: S04-07-supervisionS04-07-supervision: SupervisionWho starts and restarts each host process, what happens when wb-hostd stops or the bundle is upgraded, and daemon outages..

Spec: S04-04-vm-processesS04-04-vm-processes: Per-VM ProcessesOne wb-vmd for each VM, the wb-vmd-layer entry of the Claude Code layer build, the wb-vmd-recipe entry of a named image's recipe, and wb-diskfmt, which formats a VM's new data disk., S06-07-slot-admissionS06-07-slot-admission: Slot AdmissionHow wb-hostd admits every macOS VM it starts against the limit of two, and lends the isolated VM's slot to a maintenance VM. (“Other software”), S06-12-guest-agentS06-12-guest-agent: Guest AgentWhat wb-guestd, the service in the guest, does for the host, and how it updates itself. (“Guest tools disk”), S05-03-management-commandsS05-03-management-commands: Management CommandsThe commands of wb other than the agent commands. (“wb vm”). Tests in internal/hostd/vm, with the fake provider and cloner of internal/hostd/vm/vmtest:

  • A start and a stop of each slot. A second start is refused with vm-running, and a stop of a stopped VM with vm-not-running.
  • Refusing mode refuses a start with its rule, before any step.
  • Managers that share one state.db give strictly increasing generations, and the generation is committed before the provider sees it. Generation 0 is refused with vm-generation-invalid on start, stop and connect. A connection for any generation but the current one is refused with vm-generation-stale. Each run that reaches running is reported once to OnRunning, whose channel closes when the run ends.
  • A provider refusal is passed on with its rule. A start that fails on the framework’s limit of running VMs is refused with vm-limit-other-software, naming the running VM, with no retry.
  • A VM that stops on its own reaches stopped with its error kept, and is logged with vm-stopped-unexpectedly. Its stop record comes before the slot reads stopped, and a stop while the run ends is refused with vm-stopping.
  • A request stop that doesn’t finish in time goes to a force stop. A provider that never answers a stop still ends the run, with the instance closed once, and one that never opens or never answers a start is refused with vm-start-timeout.
  • While a stop runs, a second stop and a connection are refused with vm-stopping, and a start with vm-running. Of concurrent starts of one slot, one opens an instance. A stop that races wb-vmd’s exit closes the instance once. After a restart, every call goes to the new instance.
  • A provider rule that names one of the manager’s own rules is refused with vm-provider-failed, and the provider’s text is cut to 1 KiB.
  • A bundle path that is a symbolic link or a file is refused with vm-bundle-not-directory, and one that can’t be created with vm-bundle-create-failed.
  • The configured resources reach the provider.
  • MAC address and packet transport (S06-06-devices-and-warm-startS06-06-devices-and-warm-start: Devices, Warm Start and TimeA VM's devices and resources, saving and restoring its state, and how the guest clock follows the host., “MAC address”; S07-02-packet-pathS07-02-packet-path: Packet PathHow wb-netd carries the guest's frames: the packet transport, the stack, the link filter, its caps, addressing, the MTU and connections., “Packet transport”). In internal/hostd/state, a slot’s MAC address is made once, is locally administered unicast, is kept across calls and restarts, and differs between slots. A new address that is another slot’s is made again, and an address in the database that wb-vmd would refuse is an error. In the manager, each StartRequest carries the slot’s address, the same on every start. A failure to get it is refused with vm-mac-failed before any provider instance opens. The transport is held while the VM runs and closed once when the run ends, by a stop or by wb-vmd’s exit. A transport that comes after the start’s deadline is closed. A start without one is refused with vm-network-missing, and the instance is closed. The type the manager holds it in has Close and no other method.
  • A stop with a fake session is refused with vm-live-sessions, and the refusal lists it.
  • Tools disk, in a temporary directory with a cloner that copies: tools.img is replaced before each start. A symbolic link at tools.img to a file outside the bundle is replaced, with the target unchanged. A leftover temporary file is deleted. A clone failure refuses the start with tools-disk-clone-failed, and the temporary file is gone. An old copy with mode 000 is still replaced, which shows the manager never opens it (SEC15-no-guest-disk-mountSEC15-no-guest-disk-mount: The host never mounts a guest-written diskA disk image is guest-written once a guest has run with it attached, and every copy or clone of a guest-written image is guest-written too.).

Spec: S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves..

  • Fail an event write with ENOBUFS or EAGAIN, and see new work refused with event-channel-blocked, and the record written once the retry succeeds. In internal/eventchan, on a fake clock: TestFailedWriteBlocksAndRetries, TestAdmitRefusesWhileBlocked, TestSlowWriteBlocks (a write past 100 ms), TestQueueCapStallsInput (a full queue stalls the caller, refuses new work and doesn’t drop a record), TestEmitOfBadFormCounts, TestControlTruncatedEndsReads and TestUnencodedRecordRefusesForGood. TestRealChannelFullPeerBlocks fills a real socketpair, and sees every record arrive in order once the peer reads.
  • In internal/hostd/events, TestRefusedRecordEndsSender sends records that don’t decode, break a bound, skip a sequence number, or name another VM, or hold a field the contract lacks at any depth, and sees each logged with event-record-invalid, the sender ended, and nothing written. So do TestRepeatedSequenceEndsSender, TestDescriptorEndsSender and TestProxydNamesVMThatNeverRan. TestRecvErrorsEndSender ends the sender with fdchan’s rule or event-channel-failed, and TestRealChannelOversizeEndsSender with fdchan-record-size for a record over 4 KiB.
  • A sender that ignores its budget has its VM stopped, and wb-proxyd’s channel is never held for a budget (S09-13-event-sendersS09-13-event-senders: Event SendersHow wb-hostd tells the senders of event records about the audit budgets, what it holds back, and when it stops a VM for its records., “The margin”). TestFloodStopsVM floods a real socketpair with well-formed records that ignore every notice. It sees the audit writer’s queue stay at its cap, logged with event-queue-full, the sender’s writes fail, then the VM’s run stopped once with event-budget-ignored at the margin’s end. The receiver then reads nothing the sender sends on until it is gone, and every record it sent is written. In margin_test.go, TestBudgetIgnoredStopsVM and TestBytesMarginStopsVM see the stop and its log line with the rule and the sender, and the hold of wb-netd after it. TestStoppedNetdGetsTheAllowance sees a wb-netd that sends on read no more than the stop allowance, across a minute’s turn. TestMarginPerSender sees a flood of the work VM from its wb-netd stop that VM while wb-proxyd’s records of the isolated VM are read, written, and neither held nor refused.
  • TestProxydPastMarginStopsItsVMOnly sees wb-proxyd’s records of a VM after its stop decision go the late way, the drops past the allowance counted in one record at the VM’s end. TestStopWithProxydQueued stops the work VM while wb-proxyd holds queued records of it, and sees them written with event-vm-ended and wb-proxyd not ended. TestLateRecordsPastAllowanceDropped sees late records past the stop allowance dropped and logged, the count of the drops written at the next end and at the exit, and wb-proxyd read on. TestLateDropsCountedOnTimer sees the count of the drops written on the timer, each drop counted once. TestRecordsMarginPerMinuteUnderBytes sees the records count start again each minute over the bytes budget.
  • With the real audit writer, TestBytesMarginChargesLines sees the bytes past the budget at the stop within the margin and one line, and the stop allowance read after it. TestRecordsMarginUnderBytes sees small records stopped at the margin’s records over the bytes budget. TestRecordCounted and TestForceStopRun in internal/hostd/audit, and TestAuditForceStopRun in internal/hostd/vm, see the counted bytes, and a stop reach the named run only.
  • A sender is held back while the audit writer holds its cap (S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs., “Host work the guest can cause”). The flood tests run on macOS only, because fdchan.Socketpair is unsupported elsewhere, and the tests in hold_test.go check the hold on every OS. TestFloodStopWhileQueueFull, TestQueueFullReleasedWhenSenderGone and TestSenderGoneWakesRecv see a VM stop not wait for the hold. TestStoppingReadsTheAllowance sees the receiver read no more than the stop allowance past a hold, and log the rest with event-stop-allowance. TestHoldLogLimited sees a repeated hold logged at most once a second. TestStopReadsPastAFullQueue in internal/hostd/netdproc starts a wb-netd stand-in that fills its event channel while the audit writer holds its cap, and sees the stand-in exit on its own before the kill at StopTimeout, and the stop return its open run, with no record dropped at its close. TestQueueCapRoom and TestRoomOnClose in internal/hostd/audit check the writer’s cap.
  • A wb-netd that ignores its stop gets no more than the stop allowance read (S09-13-event-sendersS09-13-event-senders: Event SendersHow wb-hostd tells the senders of event records about the audit budgets, what it holds back, and when it stops a VM for its records., “At a VM’s stop”). TestStopBoundsASenderThatIgnoresIt in internal/hostd/netdproc starts the stand-in built to keep sending after its control channel closes. The test kills the stand-in once it has written past the allowance plus the slack, and the stop returns and logs the drop with event-stop-allowance, while TestNetdStopTimeoutKills covers the kill at StopTimeout. TestRoomCountsUnsynced and TestRoomAfterFailedSyncAtCap in internal/hostd/audit see the records written but not synced count against the writer’s cap, and Room open again once a failed sync at the cap is retried.
  • Send a mapping entry with an uppercase or non-LDH name, a trailing dot, an address outside 198.18.0.0/15, one past 131,072 live entries, or one whose name or address the VM holds for another. See it logged with mapping-entry-invalid, and the wb-netd that sent it ended, as for a record received with MSG_TRUNC. In internal/hostd/egress: TestMappingEntryInvalid, with the bounds lowered.
  • See entries kept until their release record, with wb-hostd’s receipt time: TestEntriesKeptUntilRelease. TestReleaseUnheld logs a release of an address the VM doesn’t hold with mapping-release-unheld, and the mapping stays as it was. TestRepeatsCountOnce and TestLifetime cover repeated debits and names, a stop, a restore and a new active period.
  • The other records (S07-06-name-mappingS07-06-name-mapping: Name MappingHow wb-proxyd keeps its own checked copy of the names wb-netd gave synthetic addresses: name reports, releases, replay, lifetime, the second count of the wildcard budget, and the copy wb-hostd keeps., “Kept by wb-hostd”). In internal/hostd/egress, TestRecordMalformed refuses a record that doesn’t decode, has a descriptor, is of another sender’s kind, names a VM that wasn’t started, is a mapping entry from wb-proxyd, or is a debit past the name bound, with accounting-record-malformed and its check. TestProxydNamesServedVM keeps a ProxydWildcardName for a stopped VM, or one restored with no acknowledged hand-off socket, logged with proxyd-name-unserved, and drops one after a start that cleared the counts. TestStaleProxydNameDropped sees the new run’s last name kept at the full budget. TestProxydNameAfterStopKeepsProxyd reads such a name after a stop or a restart, and sees wb-proxyd go on serving the other VM.
  • The reader (S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs., “Accounting and event channels”). In internal/hostd/egress, TestReaderKeepsRecords keeps records after the version record, and a sender that closes its channel ends nothing. TestRefusedRecordEndsSender ends the sender once, logged with the rule and check, and doesn’t read on. TestReaderVersionRefused and TestVersionSendFails end the sender for another version record, one with a descriptor, none within the version timeout, and one that can’t be sent. TestRecvErrorsEndSender ends it with fdchan’s rule as the check, or accounting-channel-failed. Once the sender is gone, over a channel whose sender’s end never closes, TestSenderGoneDrains and TestSenderGoneWakesRecv keep what is queued and stop, logged with accounting-sender-gone, and TestSenderGoneRefusedRecord still ends the sender for a refused record. TestSenderGoneDrainBound stops a drain that never empties after DrainMax records, logs the rest as refused, and closes the channel. In internal/hostd/netdproc, TestStopWithAccountingEndInFlight sees Stop return within its bound while a copy of wb-netd’s accounting end is in flight in an unread socket, and a write on that copy after the stop fails.
  • wb-proxyd’s control channel (S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., “One hand-off socket per VM”, S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves., “Control channels”). In internal/hostd/egress, over a fake channel, TestHandoffAfterAck returns wb-netd’s end only after the HandoffSocketAck. TestHandoffNoAck, TestHandoffProxydEnds, TestHandoffSendFails and TestHandoffRefusedBeforeSend fail the start with proxyd-setup-failed and each check, with no end left open, and ignore a late acknowledgment. TestControlMessageRefused and TestProxydVersionRefused end wb-proxyd with control-message-refused or the version rule. TestHandoffSocketClosed ends the VM’s wb-netd once with name-report-malformed, and logs a stale notice with handoff-notice-stale. TestPolicyWaitsForAck waits for the PolicyAck. TestHandoffNotStarted and TestHandoffPending fail the start with vm-not-started or pending before anything is sent. TestHandoffRetryAfterTimeout ignores the late acknowledgment of a timed-out attempt and returns the retry on its own. TestPayloadWriteFails ends wb-proxyd with control-channel-failed and the check payload-write.
  • Hand-off socket states (S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log., S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down.; built in I728I728 (closed): Hand-off socket contract of S07-20: socket number, HandoffSocketHeld, states, close reports, and a VM's endBuilds the hand-off socket contract of S07-20-handoff-sockets and the end exchange of S07-21-vm-end (#754, PR #758) in one change, before #480. and I512I512 (closed): wb-proxyd: the program, its confinement and start, hand-off sockets per VM, and restartsPackage M3.12 of docs/implementation-plan.md, part 3 of 4 (M3.12c).). Over fake channels, in internal/hostd/egress:
    • a wb-netd that withholds HandoffSocketHeld fails the start with held-timeout, and on a running VM is ended with handoff-netd-ended;
    • an ack-timeout on a running VM ends wb-proxyd with handoff-proxyd-ended, and no wb-netd restart is counted;
    • after a wb-netd crash and restart, a late HandoffSocketClosed for the old socket is stale and doesn’t end the new wb-netd;
    • a HandoffSocketAck or HandoffSocketHeld for a number never offered, or a second one, is refused;
    • each rule of “Closing a socket” ends the daemon it is charged to, and the other VM’s socket goes on;
    • at a VM stop, HandoffSocketEnd comes before wb-netd’s control channel closes, covers a socket that closed or failed first, and the VM’s events end only after the record its answer names;
    • a socket end and a stop end for the same number, after a failure and a stop, a failed start socket and a refused start, or a wb-netd exit just before the stop, each get their own answer, and wb-proxyd goes on;
    • no answer by the deadline ends wb-proxyd with handoff-end-timeout and writes proxyd-records-lost;
    • a wb-proxyd that exits with an end unanswered ends that wait, writes proxyd-records-lost and ends the VM’s events, and the new wb-proxyd gets no end;
    • a stop answer whose sequence is below the last record read that names the VM and generation is refused, a socket end’s answer with a sequence other than 0 is refused, and a read that doesn’t reach the sequence in time ends wb-proxyd with handoff-end-read-timeout;
    • with wb-proxyd’s queue and socket buffer full under a hold, the honest stop answer, past the allowance by the end’s records, is accepted and read to its sequence;
    • an answer with a sequence past the read’s bound is accepted, the read ends at its last sequence, and the cut is named in the stop record. Later records of the generation at or below the named sequence are dropped with event-stop-allowance up to the read’s bound, and one more, or one above the named sequence, ends wb-proxyd with event-record-invalid;
    • no PolicyChange or ActivePeriodStart for a VM, and no message that names its ended generation, goes out after its stop end;
    • a wb-netd that withholds HandoffSocketHeld after a wb-proxyd restart doesn’t delay the other VM’s socket, and one VM’s stop end doesn’t delay the other VM’s acknowledgment;
    • a wb-proxyd record that names a VM and generation outside its window ends wb-proxyd with event-record-invalid.
  • Block an accounting write past 100 ms, and see the lookup refused with accounting-write-failed.

Spec: S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs., “Logs and health”. Tests in internal/hostd/logpipe, on a fake clock:

  • 101 lines in one second write 100 lines and one daemon-log-rate record with the count 1.
  • A 5 KiB line is cut at 4 KiB with the truncation marker, and the next line is intact.
  • A line with a quote, a control byte and invalid UTF-8 becomes one well-formed JSON record of the spawn’s process.
  • Rotation at 10 MiB keeps 5 files.
  • A blocked file write doesn’t stop the reader from draining the pipe. The lines it drops are counted in daemon-log-backlog records.

Spec: S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from. (“Guest ports below 1024”), S06-12-guest-agentS06-12-guest-agent: Guest AgentWhat wb-guestd, the service in the guest, does for the host, and how it updates itself. (“The port”, “The hello”).

  • Listener (internal/platform/guestsock, with a fake socket and clock). Failed accepts are skipped and the next host connection is served. A connection from CID 3 and one from CID 0 are closed and logged with guestd-peer-not-host. Each kind logs one record per 10 s window with the count held back. EADDRINUSE is retried from 100 ms doubling to 2 s with guestd-bind-in-use, and EACCES is returned at once with guestd-bind-failed. Port 1023 is below 1024.
  • Hello (internal/guestlink). An empty version, one of 65 bytes, one with a control byte or a non-ASCII byte, another version, an answer over 4 KiB, a guest that never answers, one that answers UNIMPLEMENTED, and package lists that are empty, other, longer or out of form are each refused with their rule and the connection closed. A good answer passes, and wb-guestd’s Hello passes over a socketpair.

Spec: S06-12-guest-agentS06-12-guest-agent: Guest AgentWhat wb-guestd, the service in the guest, does for the host, and how it updates itself. (“Update at start”), S06-06-devices-and-warm-startS06-06-devices-and-warm-start: Devices, Warm Start and TimeA VM's devices and resources, saving and restoring its state, and how the guest clock follows the host. (“Step or slew”).

  • Update (internal/guestupdate, with a fake platform and temporary directories). A disk of wb-guestd’s own version doesn’t install anything. A disk of another version, and a wb-guestd without a version, install every program with the disk’s bytes, mode 0755, wb-guestd last, and run the installed wb-guestd. A link at a program’s name or at the temporary name is replaced, and its target left alone. A VERSION that is missing, empty, a link, a directory, over 64 bytes, ends in a newline or isn’t a version is refused with guestd-update-version-invalid. A program that is missing, a link, a directory or over the size cap is refused with guestd-update-program-invalid. Both refusals come before anything is installed. An installed wb-guestd that holds the disk’s bytes already is refused with guestd-update-no-effect, and one that differs in any byte is replaced. The update reads the disk only through the directory that passed its check. A wb-guestd that can’t be installed leaves the programs before it installed, and nothing runs. A disk that never passes its check is refused after the wait with the platform’s rule, and a stop during the wait ends it.
  • Tools disk and install directory (internal/platform/guesttools). Only an APFS volume mounted read-only by root at the mount point passes. One mounted read-write, by a user, or of another file system is refused with guestd-tools-untrusted, and a path with no volume mounted on it with guestd-tools-not-mounted. A directory that is a link or a file, has another owner, or is writable by its group or by others is refused with guestd-install-dir-unsafe. So is a path with such a parent, before anything is made under it. One that can’t be looked at fails with guestd-install-dir-failed. Installers that make a missing directory at once all pass and check it (TestMakeDirRace).
  • Clock (internal/guestd, with a fake clock over a socketpair). SetTime steps the clock for a boot, a restore and a wake, and for a periodic update more than 1 s off either way, and slews it by the offset otherwise. A time of 0 or less and a reason that isn’t one of TimeReason’s are refused with InvalidArgument, and leave the clock alone. A clock the OS doesn’t let wb-guestd set answers Internal. On the host, internal/platform/guestclock gets EPERM as a user other than root.

Spec: S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from. (“The host opens every connection”, “Caps and closing”), S06-11-reconnect-and-recoveryS06-11-reconnect-and-recovery: Reconnect, Loss and RecoveryWhat happens when the host-guest link drops, when a session is lost, and how a lost session's work is recovered or discarded. (“Reconnect”), S06-06-devices-and-warm-startS06-06-devices-and-warm-start: Devices, Warm Start and TimeA VM's devices and resources, saving and restoring its state, and how the guest clock follows the host. (“When the host sends the time”), S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs. (“Host work the guest can cause”, its row of RPCs from wb-guestd). Tests TestC11GuestLink* in internal/hostd/guestconn, with the VM manager, the fake provider, a fake clock, and wb-guestd’s GuestService serving the guest end of each socketpair:

  • A good hello links on port 1023 of the current generation, and the time hook runs after it, then every 60 s.
  • Time (TestC11GuestLinkTime*). The first time call of a generation has the reason boot, and every later one periodic: after 60 s, and after a reconnect. The next generation boots again. A call that fails with DeadlineExceeded or Unavailable drops the link with guest-time-unanswered, and the link connects again after 0.1 s. Any other failure logs guest-time-failed and keeps the link. Either way the next call is a boot again. SendTime, the hook of wb-hostd, makes wb-guestd’s clock step to the host’s time.
  • Data mount (TestC11GuestLinkSendMount, TestC11GuestLinkMountRefused, TestC11GuestLinkMountTimeout; S06-05-disksS06-05-disks: DisksA VM's system disk and data disk: how the data disk keeps what the guest flushes, and how the guest mounts it., “Mounting the data volume”). SendMount, the hook of wb-hostd, asks wb-guestd to mount the recorded volume with first_mount set, records the first success in state.db, and asks again without it after a reconnect. A refusal by the guest, or a record that is missing, not formatted, or unreadable (guest-mount-record), keeps the link. Every session start is then refused with the rule and a message that names wb vm stop. Only a refusal by the guest also names wb vm reset-data. A mount left unanswered (guest-mount-timeout) or failed with UNAVAILABLE (guest-mount-unavailable) reconnects, and the next link asks again. A session start is refused with session-no-link for another generation or without a link, and with session-mount-pending until the mount is answered, also after a reconnect (TestCheckSessionStartPending).
  • In internal/guestlink (TestMountData* and TestMountRefusalHidesGuestText), MountData takes only a FAILED_PRECONDITION with one ErrorInfo in the guest’s domain whose reason is a listed rule of wb-guestd. Anything else, an answer over 4 KiB included, is guest-reply-invalid, and the guest’s message is never shown. A call that fails with UNAVAILABLE is guest-mount-unavailable. The call’s deadline is 45 s.
  • Port 0, 22, 1022, 1024 and 65535 are refused with guest-port-unrouted before the provider is asked.
  • Each cap refuses at its limit with its rule: guest-conn-cap-vm, guest-conn-cap-project, and guest-reconnect-rate for the 21st open in a minute. A connection that opens after its run ended is closed with guest-conn-stale. After Close, an open is refused with guest-links-closed before the provider is asked.
  • While every try fails, by a failed connection or a refused hello, the waits are 0.1, 0.2, 0.4 s and so on up to 5 s. A guest that drops the link after each hello gets 20 connections, then the link waits for the window and logs guest-reconnect-rate once.
  • Closing the guest end logs guest-link-dropped once and reconnects after 0.1 s, the old connection closed, and grpc-go never asks the link’s dialer for a second connection (guest-redial-refused).
  • A VM stop ends the loop and closes every connection, and the next start links to the new generation. No goroutine of the link, its loop or a gRPC client transport is left after Close.

The gRPC limits, in internal/guestlink:

  • TestOptionsSetEveryLimit and TestLimitsValues: the client and the server options of a guest connection set every limit explicitly.
  • TestLinkNamesItself: the guest sees :authority wb-guestd and the user agent wb-hostd with grpc-go’s version, and no host path.
  • An answer over 64 KiB after the hello, and a request over 64 KiB to a server on a guest connection, are refused. One guest connection runs at most 16 requests at once.
  • Over a socketpair, a test handler refuses past the rate with guest-rpc-rate and past the bound of requests in flight per VM, over three connections, with guest-rpc-inflight.
  • A link closes itself and its connection when the connection leaves READY, and its dialer refuses a second call with guest-redial-refused.
  • Have wb-guestd report another build version, a version string that isn’t ASCII, one longer than 64 bytes, and one not of the fixed form. Connect a host peer of another build version, and one of an unstamped build. See each refused before any other request, with the version escaped and cut in the log. The guest cases are TestHelloRefuses and TestHelloUnstampedHost in internal/guestlink, and TestC11GuestLinkVersionRefused in internal/hostd/guestconn, which also checks that the link status keeps both versions for wb vm status.
  • Connect a host peer from a replaced bundle, and see wb-hostd exit with bundle-replaced. An unreadable installed version doesn’t make it exit.

Spec: S09-11-auditS09-11-audit: AuditWhat the audit log records, the budgets that bound it, and what happens when the log can't be written..

  • Exceed the per-class budget, and see no 5019, 2004, approval, returned-work, store-access, VM or session record dropped, and wb-netd and wb-proxyd refuse with audit-budget until the window turns.
  • Stop a VM with an open run of suppressed refusals, and see its count in the stop record (TestEndVMWritesOpenRuns, TestOpenRunsInStopRecord, TestOpenRunsPastTheCapAreWritten, TestEndForgetsTheVM).
  • Budgets: TestEventsBudget and TestBytesBudget in internal/hostd/audit see the rule and its end at the turn of the minute or day, with every record still written. That includes the 5019 and 2004 records past the budget. TestBudgetWithWriter in internal/hostd/events writes 6001 records and sees one notice that ends at the minute’s turn. In internal/eventchan, TestBudgetNoticeRefusesAndCounts and TestBytesNoticeRefuses see the sender refuse with audit-budget or audit-bytes and write one run per minute, and TestInvalidNoticeIgnored sees a notice for another VM ignored and logged. TestStatusAuditBudget checks both budgets in wb vm status.
  • In internal/hostd/audit: TestClassesRequired checks each record against the OCSF 1.8.0 subset in testdata, TestNoCredentialFields checks that no record type can hold a credential, and FuzzGuestLabel feeds guest labels. TestRetention and TestRetentionMinimum delete files by age only.
  • A failed write (TestFailedWrite, TestFailedWriteOfNoVM, TestFailedWriteStopsQueued, TestLastingFailure, TestWriteGivenUp, TestFailedOpen): see the VM of the record and of every queued record stopped first, then the audit-write-failed finding, and starts refused until a write succeeds.
  • In internal/hostd/vm (TestAudit*), a VM start is refused, or the VM stopped, when its record can’t be written. In internal/hostd/hostservice, a shell doesn’t open while the log refuses new sessions or its open record can’t be written (TestShellAuditRefusesOpen, TestShellAuditOpenNotWritten, TestShellNoAuditLog), and TestStatusAuditRefusal shows the refusal in wb vm status. In internal/hostd/kills, TestKillProcessesLeft and TestKillColdStop see the 2004 records.
  • On a fake volume, drop the free space below the floor, and see the VM whose data disk grew stopped before any write fails, and the reserve allocated again once space returns.
  • TestFloor, TestReserve, TestReserveAllocateFails and TestCanStartDisk in internal/hostd/audit use a fake volume. internal/platform/volspace reads a real one (TestStat, TestAllocate, TestAllocatedSparse, TestAllocatedLink).

Spec: S06-13-data-disk-formatS06-13-data-disk-format: Data Disk FormatHow the host formats a VM's new data disk, the one exception SEC15-no-guest-disk-mount makes, and the checks before a VM starts with its disk., S04-04-vm-processesS04-04-vm-processes: Per-VM ProcessesOne wb-vmd for each VM, the wb-vmd-layer entry of the Claude Code layer build, the wb-vmd-recipe entry of a named image's recipe, and wb-diskfmt, which formats a VM's new data disk. (“wb-diskfmt”), S05-03-management-commandsS05-03-management-commands: Management CommandsThe commands of wb other than the agent commands. (“wb vm reset-data”).

The steps, in internal/diskfmt, with a fake diskutil. In each case the fake diskutil is never asked to attach a file at the final name (SEC15-no-guest-disk-mountSEC15-no-guest-disk-mount: The host never mounts a guest-written diskA disk image is guest-written once a guest has run with it attached, and every copy or clone of a guest-written image is guest-written too.).

  • Leave a temporary file, and see it deleted, never attached.
  • Have the fake diskutil report another backing image path at the check after the attach, and at the check before eraseDisk.
  • Replace the temporary file with another file at the same path, or add a hard link to it, before the attach and before the format.
  • Put a file at the final name before the rename.
  • Ask for a size outside the bounds, and see diskfmt-size-invalid before any file is made.

In each failure, see wb-diskfmt fail with the rule and the file at the final name kept. A failure after the attach detaches that device, and one before it detaches nothing.

cmd/wb-diskfmt:

  • Start it with WB_DISKFMT_SLOT unset, with an unknown value, with an argument, with its bundle missing, and with its bundle a symbolic link to the other slot’s. See diskfmt-slot-missing, diskfmt-slot-unknown, diskfmt-arguments, diskfmt-bundle-missing and diskfmt-slot-bundle-mismatch logged before sandbox_init.
  • Confined by its own profile, it refuses a size outside the bounds, a request out of order, and a peer of another build version. It can’t read another file of its bundle, such as the system disk.
  • TestHostFormat, opt-in with WB_DISKFMT_HOST_TEST=1 and attended (I228I228 (closed): X08-data-disk follow-up: measure that a host-made data volume stays unencrypted and returns freed spaceX08-data-disk (PR #227) recommends option A: the host formats the data disk as APFS.): the steps with the real diskutil, confined, on a bundle under .scratch/. See a formatted image at the final name with far fewer blocks than its size, a canonical volume UUID, no device left attached, and a read outside the bundle denied.
  • Each data disk name ends in an extension that DiskImageMounter’s Info.plist doesn’t claim.

wb-hostd, with a fake wb-diskfmt and a temporary state.db:

  • Give it a file at the final name that state.db doesn’t record as formatted, and a link there, and see the VM start refused with data-disk-unrecorded and the file kept. Remove a disk recorded as formatted, and see data-disk-missing. No wb-diskfmt runs.
  • See the records written in the order of steps 7 and 9, and a crash between the rename and step 9 refused at the next start with data-disk-unrecorded.
  • Answer with a refusal of wb-diskfmt’s own, one of another rule, a UUID not in canonical form and another name, and see each refused, with nothing recorded as formatted.
  • A second format or reset of a slot while one runs is refused with data-disk-busy.

wb vm reset-data:

  • Refused without a terminal, and with a flag. A declined confirmation leaves the disk and its record as they were. While the VM runs, wb-hostd refuses with vm-running, and a start during a reset is refused with vm-resetting.
  • An accepted one deletes the old file, drops the record, and records a new disk with a new UUID. The log line holds the old and new UUID.

wb vm start, stop, suspend and status, in internal/hostd/hostservice and internal/vmcmd:

  • In refusing mode wb-hostd refuses every call of HostService with its rule, and a refusal of the manager arrives as the ErrorInfo reason. A wb of another build version is refused before the service, and wb names both versions.
  • start exits 0 once the guest is linked. A refused hello and a link that isn’t up by the deadline exit 255, and leave the VM running.
  • A guest version with escape sequences prints without them, cut to 64 bytes (FuzzGuestText). suspend is refused without a connection to wb-hostd. A usage error exits 2.

Status: Draft