ManualRemote
Connect from Chan Desktop
Add a devserver with its connect script, use the control terminal, recover from dropped connections, and open remote windows.
What you can do
- Add a devserver with the script that reaches it: ssh, Eternal Terminal, Lima, WSL, or none.
- Connect with one key. Chan Desktop reads the devserver's token, so you never copy it.
- Open the devserver's terminals and workspaces as native windows.
- Disconnect, sleep, or quit, and find everything still running when you connect again.
- Script it all with
chan devserver.
Add a devserver
Install chan on the other machine first: see Run a devserver.
-
Open the form
Open the Computers screen with Cmd+P on macOS or Ctrl+Shift+P on Windows and Linux, turn to the last card, and click Add devserver.
-
Fill it in
Field Enter Name (optional) The card's title, also the name chan devservercommands accept.Address Where Chan Desktop dials: localhost:9901,127.0.0.1:8787, or a full URL with its token,http://host:8787/?t=TOKEN.Connect script (optional) A command that brings the devserver up and holds the tunnel open. It runs in a control terminal. See Recipes. Auto-hide control terminal on success Tick it to hide the control terminal once connected. -
Add and connect
Click Add devserver. The new card comes to the front, selected: click the connection control in its header, or press o.
Recipes
Copy the Address and Connect script for your route. Replace user@host with your ssh destination.
| Route | Address | Connect script |
|---|---|---|
| ssh | localhost:9901 | ssh -L localhost:9901:127.0.0.1:8787 user@host '~/.local/bin/chan devserver join --port 8787' |
| Eternal Terminal | localhost:9901 | et --tunnel 9901:8787 --command '~/.local/bin/chan devserver join --port 8787' user@host |
| Lima, from macOS | localhost:8787 | limactl shell default ~/.local/bin/chan devserver join |
| WSL, from Windows | localhost:8787 | wsl ~/.local/bin/chan devserver join |
| Direct: LAN, a VM or container port | http://host:8787/?t=TOKEN | None |
9901is the tunnel's local end and must match the Address;8787is the devserver's port. For a second devserver, pick another free local port and use it in both.- Eternal Terminal must be installed on both machines: see its setup guide.
- For a direct address, bind the devserver where the local machine reaches it, or publish its port, and copy the URL from
chan devserver statusthere.
The control terminal
Connecting opens a window titled Control Terminal - NAME that runs the connect script through your login shell. Answer ssh's prompts there. join prints a CHAN_DEVSERVER_TOKEN= line; Chan Desktop reads the token from it and dials the Address.
The control terminal is the connection: it stays open while the script runs, as the first row on the devserver's card.
| You do | The connection |
|---|---|
| Tick Auto-hide control terminal on success | Stays up; the control terminal hides once connected. Show it again from its row. |
| Close the connected control terminal, then choose Hide | Stays up. |
| Close the connected control terminal, then choose Close | Ends with the script, and the devserver's windows here close. Everything keeps running on the devserver. |
Disconnect and reconnect
| When | You see | Do |
|---|---|---|
| You press Disconnect, o on the card | The devserver's windows close here. Terminals, programs, workspaces and layouts keep running there. | Connect again: every shown window reopens where it was. |
| The tunnel drops while the script still runs | The windows show reconnecting to the chan server and keep trying, with Show in Computers (see connection health). Once the drop has lasted 8 s, the cover adds Restart connection and Abandon. | Wait, press Show in Computers to see the devserver's card, Restart connection to run the script again, which closes and reopens the devserver's windows, or Abandon to disconnect. |
| The script exits with an error, as ssh does when the network goes | The windows close. The control terminal stays, with the script's last words and process exited (255); press Ctrl+D to close this tab, and its row flashes. | Read why, close the control terminal, and connect again. |
An ssh tunnel dies when the laptop sleeps or the Wi-Fi changes; Eternal Terminal reconnects across both. Chan Desktop does not connect devservers by itself at start.
Open remote terminals and workspaces
| On the devserver's card | Key | Opens |
|---|---|---|
| New terminal, in the header | t | A terminal window on the devserver. |
| New window, on a workspace row | w | A window of that workspace. |
| New terminal window, on a workspace row | t | A window of that workspace that starts with a terminal. |
| The power button, on a workspace row | o | Turns the workspace on or off. |
The command launcher's Computers scope does the same from any window on the devserver. To add a workspace, run chan open PATH in a devserver terminal, or this here:
$chan serve /srv/notes --on labRemote windows survive a disconnect and a restart of Chan Desktop: connect again and carry on. On a Linux devserver run by systemd, its terminals also survive a restart or an upgrade of the devserver: see Restart without losing terminals. To copy, move files and forward ports across the connection, see Tunnels, transfers and clipboard.
From a terminal
These need Chan Desktop running. NAME is the name or URL chan devserver ls shows.
| Command | What it does |
|---|---|
chan devserver register URL --name NAME --script CMD | Adds a devserver, as the form does, without connecting. |
chan devserver ls | Lists the devservers with their state. --json for scripts. |
chan devserver connect NAME | Connects, as o does. Prompts appear on the Computers screen. |
chan devserver disconnect NAME | Disconnects. The devserver keeps running. |
chan devserver forget NAME | Removes it and its stored token. A connected one is refused unless you add --force. |
chan serve PATH --on NAME | Serves a directory of the devserver as a workspace. |
chan close PATH --on NAME | Stops serving it. It stays registered there. |
chan workspace forget PATH --on NAME | Unregisters it on the devserver. Its files stay. |
Details and limits
- Keep connect scripts in the foreground, as the form's tip says (
ssh -N). A script that exits cleanly right after connecting, such as one that starts a background tunnel, leaves the connection up; one that exits cleanly later disconnects. - A token in the Address is stored and wins over the one the script prints, so a script can be only the tunnel, such as
ssh -N -L ..., to a devserver already running as a service. Afterrotate-token, edit the devserver and paste the new URL. - The stored token is never shown again. An edit with a bare
host:portkeeps it, and a URL with an empty?t=clears it. - With no script and no token, Chan Desktop reads the token and port of the devserver that shares its own chan home on the local machine.
- Click a devserver's name on its card to edit it. A connected devserver's settings are read-only: disconnect first.
- While a dead control terminal is open, Connect stays off and says to close it first.
- A devserver whose window feed stays silent is marked unreachable on its card; disconnect and connect again.
- The control terminal's title uses the Name, or
host:portwhen there is none. - A devserver's first start opens one terminal window, titled with the remote host's name.
- In the Lima recipe,
defaultis the name of the Lima instance. - Eternal Terminal signs in over ssh, then reconnects on its own port, normally 2022.
- Chan Desktop and the devserver must speak the same management protocol; on a mismatch, update whichever is older.
- Devservers that come from a gateway are listed by
chan devserver lsand marked, but only the Gateways screen manages them.