Overview
Connect Codex in the ChatGPT desktop app to a remote Windows virtual machine over SSH, with the project in WSL, so builds and tests run on that machine instead of your laptop.
Problem or Objective
- Which agents write or run tests against an application?
- Which agents take on multi-step tasks in the background and report back when they finish or need approval?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Codex · ChatGPT · WSL
- Prerequisites
- The ChatGPT desktop app with Codex, a Windows virtual machine with WSL reachable over SSH (set up per your provider's and Windows' documentation), and Codex installed and signed in on that remote environment.
How It Works
Set up a Windows virtual machine with WSL and the project's toolchain, and make the WSL environment reachable over SSH with a least-privilege account and key-based login; check your VM provider's and Windows' own documentation for that part. Install and sign in to Codex on that remote environment so the codex command is on the login shell's PATH. On your own computer, add the host to ~/.ssh/config and confirm a plain ssh login works. In the ChatGPT desktop app, open Settings, then Connections, enable the SSH host and choose the remote project folder. Ask Codex to run the build and the test suite there, fix failures on a branch, and report the commands it ran. Review the diff before anything is merged.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Codex CLI.
- Connect the toolsConnect the tools this workflow relies on: Codex, ChatGPT, WSL.
- Check the prerequisitesThe ChatGPT desktop app with Codex, a Windows virtual machine with WSL reachable over SSH (set up per your provider's and Windows' documentation), and Codex installed and signed in on that remote environment.
- Gather your detailsCollect what the prompt asks for: Project folder in WSL on the remote machine, SSH host alias from your SSH config, Command that builds the project, Command that runs the tests, Branch for fixes.
- Run the starter promptPaste the starter prompt below into Codex CLI and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at developers.openai.com before you rely on it.
Practical Starter Prompt: Build and test on the remote machine
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
In the remote project [Project folder in WSL on the remote machine] on [SSH host alias from your SSH config], run [Command that builds the project] and then [Command that runs the tests]. If anything fails, create a branch named [Branch for fixes], fix the cause, and rerun both commands. Report every command you ran with its result and a summary of each change. Do not merge, push to the main branch or change anything outside the project folder; I will review the diff and approve before merging.Confirm a plain SSH login reaches the WSL shell before connecting Codex. Review the diff and test output and approve before merging.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. OpenAI's remote connections page says the desktop app can add remote projects from an SSH host, that remote project chats run commands, read files and write changes on that host, and that the app starts the remote Codex app server through SSH. It does not cover Windows or WSL hosts specifically, so confirm a plain SSH session reaches the WSL shell before connecting Codex.
Limitations and Considerations
OpenAI says to keep the remote host to the usual SSH standards: trusted keys, least-privilege accounts and no unauthenticated public listeners, and to use a VPN or mesh network rather than exposing the app server to the internet. Codex can change files on the remote host, so keep the project in version control and review every diff. Codex is included across ChatGPT plans with usage limits that vary by plan; the virtual machine's running costs are separate. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)developers.openai.com
Related Videos
About openai/codex
Meet the New Codex CLI (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Remote connections | ChatGPT Learn (opens in a new tab)
Project documentation · developers.openai.com · Undated · Source checked 27 Nov 2026, 10:59 UTC
What this source supports
- In the ChatGPT desktop app, you can add remote projects from an SSH host and run chats against the remote filesystem and shell; remote project chats run commands, read files, and write changes on the remote host.
- Codex reads concrete host aliases from ~/.ssh/config; Codex must be installed and authenticated on the remote host, and the app starts the remote Codex app server through SSH using the remote user's login shell.
- Keep the remote host configured with trusted keys, least-privilege accounts, and no unauthenticated public listeners; to reach a machine outside your network, use a VPN or mesh networking tool instead of exposing the app server to the internet.
- Using Codex with your ChatGPT plan | OpenAI Help Center (opens in a new tab)
Project documentation · help.openai.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Codex is included across ChatGPT plans, including Free and Go; usage limits vary by plan.
