These notes describe the patch used to make Codex Mobile discover the unofficial Linux desktop port from https://github.com/ilysenko/codex-desktop-linux.
Important
You do not need to patch the Electron app to connect Codex Mobile to Codex Desktop. You can enable the bridge by adding these feature flags to the Codex config file, usually $HOME/.codex/config.toml:
[features]
remote_connections = true
remote_control = true
workspace_dependencies = falseThis config-only path can make mobile pairing work, but it may not make the connection visible under Settings > Connections. A renderer/UI patch can expose that settings surface; the helper flow below keeps the Linux port on a writable app install and applies the config/launcher pieces needed for the bridge.
./patch-codex-mobile-linux.sh
$HOME/.local/bin/codex-desktop-force-restartOn current codex-desktop-linux, plain nix run github:ilysenko/codex-desktop-linux launches the immutable Nix-store app directly. It no longer creates a writable codex-app folder by default. This script handles that by running the installer app when needed:
nix run github:ilysenko/codex-desktop-linux#installerIf the port is installed somewhere other than $HOME/codex-app, pass the path:
CODEX_APP_DIR=/path/to/codex-app ./patch-codex-mobile-linux.shor:
./patch-codex-mobile-linux.sh /path/to/codex-app-
Start the patched app with:
$HOME/.local/bin/codex-desktop-force-restart -
Sign in to Codex Desktop with the same ChatGPT account used by Codex Mobile.
-
Open
Settings > Connections. -
Press refresh if the mobile device does not appear immediately.
-
Do not use
+ Addfor mobile pairing. That dialog is for SSH hosts, not the Codex Mobile remote-control path.
When it works, a signed-in device or remote-control connection row appears automatically.
The Linux port packages the macOS Electron app. Older Nix behavior made nix run github:ilysenko/codex-desktop-linux create a writable app folder at:
$HOME/codex-app/content/webview
Current Nix behavior makes plain nix run github:ilysenko/codex-desktop-linux launch the app directly from /nix/store. To get a writable install, use the installer app:
CODEX_INSTALL_DIR="$HOME/codex-app" nix run github:ilysenko/codex-desktop-linux#installerThe script applies three config flags:
[features]
remote_connections = true
remote_control = true
workspace_dependencies = falseIt also adds --disable-http-cache to start.sh, fixes the launcher to pass arguments through to start.sh, and creates:
$HOME/.local/bin/codex-desktop-force-restart
That helper stops the running desktop/webview processes, clears Electron renderer caches, and relaunches the app.
Typical touched files:
$HOME/.codex/config.toml
$HOME/codex-app/start.sh
$HOME/.local/bin/codex-desktop-launch
$HOME/.local/bin/codex-desktop-force-restart
Before changing any app file, the script writes a sibling backup with a suffix like:
.bak-mobile-20260515-025200
If Settings > Connections is missing, first confirm the three feature flags are present, then restart through codex-desktop-force-restart. If the app still hides the page, that is the separate renderer/UI gate; mobile pairing can still work with the config-only bridge.
If the page exists but no mobile device appears:
-
Confirm Desktop and Mobile are signed into the same account.
-
Hit refresh in
Settings > Connections. -
Avoid
+ Add; that is the SSH-host path. -
Restart with:
$HOME/.local/bin/codex-desktop-force-restart
If the port updates or reinstalls, rerun the patch. The asset filenames are content-hashed and can change after updates.
For another agent applying this from scratch:
- Confirm whether the user is launching a writable install or plain Nix-store app. Plain
nix run github:ilysenko/codex-desktop-linuxdoes not create a writablecodex-appanymore. - Run
patch-codex-mobile-linux.sh, passing the install root if nonstandard. If$HOME/codex-appis missing, the script creates it throughgithub:ilysenko/codex-desktop-linux#installer. - Confirm the script reports patched or unchanged for the config flags and startup items.
- Launch with
$HOME/.local/bin/codex-desktop-force-restart. - Tell the user mobile pairing appears under
Settings > Connections; the+ AddSSH dialog is not used for mobile. - If pairing still fails, inspect
$HOME/.cache/codex-desktop.logand rerun the force restart after clearing caches.