Skip to main content
On this page

Host-Guest Socket Protocol

Wire Format

Length-prefixed JSON over a Unix stream socket:

Message wire format

Socket Location

SocketPathCreated by
Host socket$XDG_RUNTIME_DIR/podbox/<name>.sock.socket Quadlet unit
Local guest socket/run/podbox/guest-<name>.sockpodbox-guest --daemon

The host socket is created by systemd before the container starts and persists across restarts. The guest socket is used by interceptor processes to communicate with the local daemon.

Handshake

Guest sends:

json
1{
2 "type": "hello",
3 "version": "0.1.0",
4 "container": "myenv",
5 "capabilities": ["notify", "xdg_open", "clipboard", "host_exec"]
6}

Host responds:

json
1{
2 "type": "hello_ack",
3 "accepted": ["notify", "xdg_open"],
4 "rejected": ["clipboard", "host_exec"],
5 "idle_timeout_secs": 0
6}

The handshake decides which capabilities the guest may use (0 timeout = disabled). The guest only installs interceptor symlinks for accepted ones.

Message Types

Guest → Host

TypeFields
helloprotocol_version, guest_version, container, capabilities
notifysummary, body, urgency, actions (optional), app_name (optional)
xdg_openuri
clipboard_settext
clipboard_get—
host_execcmd, args
register_session— (pidfd via SCM_RIGHTS)
busy—
idle_timeout—

Host → Guest

TypeFields
hello_ackaccepted, rejected, idle_timeout_secs
clipboard_datatext
host_exec_stdoutdata
host_exec_stderrdata
host_exec_doneexit_code
notify_action_resultnotification_id, action_key
ping—
check_idle—
shutdown—

Notify actions

actions is an optional array of {key, label}. The host replies with notify_action_result carrying the notification_id and the chosen action_key.

json
1{
2 "type": "notify",
3 "summary": "Build complete",
4 "body": "Exit code: 0",
5 "actions": [
6 { "key": "open", "label": "Open project" },
7 { "key": "dismiss", "label": "Dismiss" }
8 ]
9}

Older guests omit actions/app_name — both default empty server-side.

Capabilities

One interceptor symlink per capability. Rejected ones are skipped silently — no symlink, no retries.

CapabilityInterceptorDescription
notifynotify-sendDesktop notification forwarding
xdg_openxdg-openURI opening via host
clipboardpodbox-clipboardClipboard sharing
host_exechost-execExecute commands on host
podbox — declarative Linux container environments
Licensed under MIT. Open Source by bethropolis.