Invocation and privilege
Run the matching release's tmdtool locally as root on Linux/macOS or from an elevated Windows terminal. It uses a local administration endpoint, not the public viewer port. Normal system-registry administration is not a remote network API.
| Platform | Installed tool | Session registry |
|---|---|---|
| Linux | /opt/tmd/server/tmdtool; optional /usr/local/bin/tmdtool symlink | /var/lib/tmd/sessions.sqlite3 |
| macOS | /Library/TMDServer/tmdtool | /Library/Application Support/TMD/sessions.sqlite3 |
| Windows | tmdtool.exe in the installed Server directory | %ProgramData%\TMD\sessions.sqlite3 |
Examples omit the executable path and privilege prefix for readability. Add sudo on Unix. Use tmdtool --help to inspect the installed version.
Commands
| Syntax | Effect |
|---|---|
create-session ID --owner USER --type console|virtual [--autostart] | Create a definition and request runtime availability. --autostart is virtual-only. |
define-session ID --owner USER --type console|virtual [--autostart] | Save a definition without requesting desktop startup. Can run offline. |
list-sessions [--json] [--offline] | List live sessions or stored definitions. |
describe-session ID [--json] [--offline] | Inspect a single session or definition. |
start-session ID | Start a saved virtual desktop. |
stop-session ID | End a virtual desktop and retain its definition. |
set-session-autostart ID --enable|--disable | Change virtual boot policy; does not start/stop the current desktop. Also works offline. |
close-session ID | Stop the runtime, disconnect viewers, and remove the definition. |
delete-session ID | Use live closure when possible, otherwise remove the stored definition. |
Runtime states
| State | Meaning |
|---|---|
active | The verified agent is available, or the agentless console is available. Viewers can bind to it. |
starting | Agent launch has started but registration is incomplete. |
inactive | The console is unavailable or the virtual desktop has not been started. |
failed | Startup/supervision failed or the virtual desktop ended. |
unsupported | The requested desktop type is unavailable on this platform or mode. |
Live reads return JSON with runtime fields such as state and agent_pid. An active agent is not proof that the compositor has finished painting or that the selected codec works.
Offline definitions
tmdtool define-session work --owner alice --type virtual
tmdtool list-sessions --offline --json
tmdtool describe-session work --offline --json
Offline output has no runtime readiness or agent PID fields. When the service is unreachable, read commands can fall back to definitions and emit a warning. state:defined in text output does not mean the desktop is active. Live create/start/stop/close operations require the running server.
Private registry directories
For development or a deliberately separate registry, place the global option before the command:
tmdtool --state-dir /path/to/private-registry list-sessions --offline --json
The server must use the same directory via --session-state-dir or TMD_SERVER_SESSION_STATE_DIR. Its parent must exist. Do not assume this private registry describes the installed service's sessions.
Common examples
tmdtool create-session console --owner alice --type console
tmdtool create-session work --owner alice --type virtual --autostart
tmdtool set-session-autostart work --disable
tmdtool stop-session work
tmdtool start-session work
tmdtool close-session work
These are separate administrative actions, not a script to run blindly in sequence. Review the effect of stopping and closing a desktop before applying them.