Hooks
Hooks are executable files that Orble runs inside a box after resume, fork or snapshot restore. Use a script or compiled binary to re-establish an SSH tunnel, remount a FUSE filesystem or initialize application state.
Place user hooks in ~/.config/orble/on-resume.d/ inside the box; these run as the agent user. For hooks that require root privileges, use /etc/orble/on-resume.d/.
Create a hook
Inside the box, create the user hook directory and save the following script as ~/.config/orble/on-resume.d/10-record-event.sh.
$ mkdir -p ~/.config/orble/on-resume.d#!/bin/sh
set -eu
printf '%s %s\n' "$(date -u +%FT%TZ)" "$ORBLE_EVENT" \
>> "$HOME/hook-events.log"
printf 'Recorded %s\n' "$ORBLE_EVENT"
Enable and test the hook
Make the file executable, then test it inside the box by setting ORBLE_EVENT=resume. The script appends a UTC timestamp and event name to ~/hook-events.log and prints Recorded resume. Your log will contain a line like the example below, with the timestamp of your test.
$ chmod +x ~/.config/orble/on-resume.d/10-record-event.sh$ ORBLE_EVENT=resume ~/.config/orble/on-resume.d/10-record-event.sh$ tail -n 1 ~/hook-events.log
2026-11-19T12:00:00Z resume
Execution order
Orble runs system hooks as root before running user hooks as agent. Within each directory, executable files are processed in filename order. Use prefixes such as 10-prepare and 20-connect when one hook depends on another. Files without execute permission are skipped.
Timing
The node starts hooks after the guest clock and network have been initialized. Hook execution is asynchronous: Orble does not wait for hooks to finish before making the box available. Applications that depend on a connection or resource initialized by a hook should check that the resource is ready before using it.
Timeout
Orble applies a five-minute timeout to each hook. If a hook times out or exits with a nonzero status, the exit status is logged and execution continues with the next hook.
Logging
For each lifecycle-triggered execution, Orble writes the timestamp, event name and executable path to /var/log/orble-on-resume.log, followed by the hook's standard output and standard error. Nonzero exit codes are recorded in the same file.
After the resume example below, inspect this log inside the box with sudo tail -n 20 /var/log/orble-on-resume.log. The example hook also keeps its own event history in ~/hook-events.log.
Run after a resume
From your local machine, suspend and resume the box, replacing <box> with its name. After the hook finishes, another resume entry will be present in ~/hook-events.log, and Recorded resume will be present in Orble's hook log.
The same executable is run with ORBLE_EVENT=fork in a forked box or ORBLE_EVENT=restore in a box created from a snapshot.
$ orble suspend <box>$ orble resume <box>