TMD Server 2026.1 - macOS

TMD Server shares an existing logged-in user's console desktop with TMD Viewer
or the HTTPS browser viewer. macOS virtual sessions and access to the login
screen before the owner logs in are not supported by this release.
Examples below use the existing short account name alice.

1. Set the console owner
------------------------
A first installation creates tmd.conf for the account running sudo. Existing
configuration is preserved. To check or change the owner, edit tmd.conf:

  sudo mkdir -p /etc/tmd/server
  sudo nano /etc/tmd/server/tmd.conf

Merge these keys into its [session-management] section:

  [session-management]
  create-session = 1
  owner = alice

Specify the desktop user explicitly: the server daemon runs as root. A root
daemon with no explicit owner does not create an automatic console session.
To create sessions manually instead, set create-session = 0 and use tmdtool after install.

2. Install from the desktop owner's account
------------------------------------------
Log into macOS as the intended owner. Extract the server package and, in its
TmdServer directory, run:

  sudo ./install-tmdserver.sh

Use sudo from that account: the script installs its per-user LaunchAgent using
SUDO_USER. The binaries are installed in /Library/TMDServer, with a system
LaunchDaemon com.tmdserver and a per-user LaunchAgent com.tmdagent. launchd
starts the agent in that user's Aqua (graphical) login session and restarts it
after a crash. The server does not launch the macOS agent directly. The
installer starts both jobs immediately when the user is logged into the desktop;
otherwise the agent starts at the next graphical login.

3. Grant capture and input permissions
-------------------------------------
In System Settings > Privacy & Security, add and enable:

  /Library/TMDServer/tmdagent

under both Accessibility and Screen & System Audio Recording (named Screen
Recording on some macOS versions). Relaunch the agent after changing permission;
logging out and back in also starts its LaunchAgent. If an upgraded binary no
longer has permission, remove its stale entry and add the installed tmdagent
again. Keep the owner's graphical session logged in and the host awake.

4. Check the session
--------------------
  sudo launchctl print system/com.tmdserver
  launchctl print gui/$(id -u)/com.tmdagent
  sudo /Library/TMDServer/tmdtool list-sessions

If automatic creation was disabled:
  sudo /Library/TMDServer/tmdtool create-session console --owner alice --type console

There can be only one console definition. Stored definitions are in
/Library/Application Support/TMD. If an old definition has the wrong owner,
close it with tmdtool close-session console, then create it for the intended
owner. This disconnects its viewers; editing configuration alone does not
rewrite an existing definition's owner.

Connect from another computer
----------------------------
1. Make the server reachable on TCP 8191 for HTTPS/WebSocket (WSS).
   TCP 4815 is needed only for viewers using the native TCP/OpenSSL transport.
   Configure the host firewall and, where applicable, router/cloud access rules.
2. Check that the intended session is active with tmdtool list-sessions.
3. In a web browser, open https://server.example.com:8191/#console.
   Replace server.example.com with the host name/IP and console with the session
   ID. The server package must contain the browser viewer bundle. A page saying
   only "The TLS certificate has been accepted" means that bundle is missing;
   install a package with a populated browser directory.
4. Alternatively, launch TMD Viewer and enter server.example.com:8191#console
   in its host field. WSS is the default transport. For native TCP instead, run:

   tmdviewer --use-tcp --host "server.example.com:4815#console"

   On Windows use tmdviewer.exe; on macOS use the executable inside TmdViewer.app.
5. Trust the server certificate after verifying it belongs to the expected host.
   TMD creates a self-signed certificate by default. The browser viewer needs
   HTTPS. Then authenticate with the session owner's operating-system username
   and password (the default system authentication mode).
6. Choose the desired monitor in the viewer's display controls. Closing a viewer
   disconnects that viewer; it does not close the desktop session.

A session ID is not a username. Specifying #console or #work selects that exact
session. Without an ID, the server selects an accessible active session; specify
an ID when several sessions exist. Unknown, inactive or inaccessible IDs fail
instead of silently selecting a different desktop.

Uninstall
---------
Run from the extracted server package, using the same desktop user:
  sudo ./uninstall-tmdserver.sh

FFmpeg
------
The macOS package does not use or distribute FFmpeg. Hardware video encoding
and decoding use Apple's VideoToolbox where available.

Documentation and support
-------------------------
https://www.texturemind.com/tmd/documentation/
support@texturemind.com

Created by Gianpaolo Ingegneri
2026-2030 (c) All rights reserved
https://www.texturemind.com/

Third-party notices
-------------------
See THIRD-PARTY-LICENSES.txt for third-party license texts.
This software is based in part on the work of the Independent JPEG Group.

macOS agent launch and troubleshooting
-------------------------------------
The agent must run inside the desktop owner's graphical login session. A
fork/setuid/exec child of the root server does not acquire that session context.
Reinstall using sudo from the desktop owner's account to update the LaunchAgent
and load it into the gui/<uid> launchd domain. Do not start tmdagent with sudo.

To restart the agent after granting permissions, while logged in as its owner:
  launchctl kickstart -k gui/$(id -u)/com.tmdagent

Existing viewers wait for a replacement agent while the same console session
remains available. Logging out or closing the TMD session invalidates access.

Agent startup/stderr log:
  ~/Library/Logs/TMD/tmdagent-launchd.log
Timestamped agent logs:
  ~/Library/Application Support/TextureMind/TMD/Server/log/tmdagent_*.log
Server startup/stderr log:
  /var/log/tmdserver.log
