# CachyOS → Debian Remote Desktop Deployment

Session-specific reference for setting up Hermes Desktop on **CachyOS** (client, 192.168.1.111) to connect to a Hermes gateway running on **Debian** (host, 192.168.1.50).

## Topology

```
CachyOS (192.168.1.111)                Debian (192.168.1.50)
┌─────────────────────┐               ┌─────────────────────┐
│ Hermes Desktop      │  WebSocket    │ hermes-gateway      │
│ (Electron)          │ ────────────→ │   :18789 (aiohttp)  │
│                     │               │                     │
│ ~/.config/hermes/   │               │ hermes-dashboard    │
│   connection.json   │               │   :9119 (FastAPI)   │
└─────────────────────┘               └─────────────────────┘
```

## Config Summary (Client)

**`~/.config/Hermes/connection.json`** — Electron's `userData` on Linux uses capital-H `Hermes`. Lowercase `~/.config/hermes/` is ignored.
```json
{
  "mode": "remote",
  "remote": {
    "url": "http://192.168.1.50:9119",
    "authMode": "token",
    "token": {
      "encoding": "plain",
      "value": "Szo2MT...NRUbNDA"
    }
  }
}
```

## Config Summary (Host)

**Dashboard systemd user service** at `~/.config/systemd/user/hermes-dashboard.service`:
```ini
[Unit]
Description=Hermes Agent Dashboard - Remote WebSocket Gateway
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/home/rurouni/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main dashboard --port 9119 --host 0.0.0.0 --insecure --tui
WorkingDirectory=/home/rurouni/.hermes
Environment=PATH=/home/rurouni/.hermes/hermes-agent/venv/bin:/usr/bin:/usr/local/bin
Environment=HERMES_HOME=/home/rurouni/.hermes
Restart=always
RestartSec=10

[Install]
WantedBy=default.target
```

**UFW rule** for LAN access:
```bash
sudo ufw allow from 192.168.1.0/24 to any port 9119 proto tcp comment 'Hermes dashboard WS'
```

## Client Environment

- **Shell:** fish (default on CachyOS) — causes heredoc, glob, and quoting issues
- **Python:** 3.14.5 (externally-managed — pip install fails without `--break-system-packages`)
- **Node:** v26.1.0
- **No display server** when SSH'd in — desktop app requires `$DISPLAY` or `$WAYLAND_DISPLAY`
- **RTX 3070** GPU

## Host Environment (debian-ai)

- **OS:** Debian 13 (6.12.85+deb13-amd64)
- **Python:** 3.11.15
- **Node:** v24.15.0
- **Networking:** Port 9119 opened via UFW to 192.168.1.0/24
- **Existing services:** `hermes-gateway.service` on port 18789 (unchanged, runs alongside dashboard)

## Client Cleanup

After confirming remote mode connected, the local Python backend on CachyOS was stripped:
- Removed: `venv/`, `node_modules/`, `.git/`, all Python source dirs, desktop dev src
- Kept: `apps/desktop/release/linux-unpacked/` (Electron binary + app.asar)
- Created standalone launcher `~/.local/bin/hermes-desktop`
- Final size: ~330MB (from ~2GB+)
