Skip to content

Windows Remote Control fails in both daemon and foreground modes despite valid private socket ACL #47416

Closed as duplicate

Description

@benailjamim

What issue are you seeing?

Windows Remote Control fails in both daemon and foreground modes despite valid private socket ACL

Summary

On native Windows, Codex Remote Control cannot be started using either the daemon-managed path or the foreground path.

Two distinct failures occur:

codex remote-control start copies the daemon package into staging under ~/.codex/packages/app-server-daemon but terminates with:
Error: Access is denied. (os error 5)

codex remote-control starts the foreground app-server but immediately exits with:
socket directory is not private to the current user

The socket directory ACL was manually verified and matches the current Windows user:

owner = current user

DACL protected = True

exactly one ACE

Allow

FullControl

ContainerInherit, ObjectInherit

not inherited

owner SID and ACE SID match the current user's SID

Despite that, the foreground path still rejects the directory as not private.

Environment

Native Windows x64

OS build: 26200

Codex CLI: 0.156.0

Codex Desktop: 26.917.6896.0

Standalone Codex CLI path:
C:\Users<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe

Authentication: ChatGPT

PowerShell used for Remote Control: non-elevated

Controlled Folder Access: disabled

codex doctor: overall warning, no fatal install/config/connectivity errors

Reproduction

Foreground path

Run from a non-elevated PowerShell:

codex remote-control

Actual result:

Starting app-server with remote control enabled...
Error: foreground app-server exited before remote control became ready

Caused by:
socket directory is not private to the current user

Daemon path

Run from the same non-elevated PowerShell:

codex remote-control start

Actual result:

Starting app-server daemon with remote control enabled...
Installing daemon from CLI version 0.156.0 into C:\Users<USER>.codex\packages/app-server-daemon...
Error: Access is denied. (os error 5)

Socket directory ACL

Get-Acl ~/.codex/app-server-control reports:

Owner : <WINDOWS_USER>
AreAccessRulesProtected : True
Access.Count : 1

IdentityReference : <WINDOWS_USER>
FileSystemRights : FullControl
AccessControlType : Allow
InheritanceFlags : ContainerInherit, ObjectInherit
PropagationFlags : None
IsInherited : False

The SDDL contains a single current-user ACE with full access.

Additional observations

The user can create and delete test directories/files under ~/.codex/packages, so generic write access to the package parent directory works.

Daemon installation creates install.lock, releases, and multiple .staging.* directories and copies the package contents, including codex.exe and helper executables, before failing. This suggests the os error 5 happens after ordinary file creation/copy begins.

Windows Code Integrity events collected around the failure did not identify Codex as the blocked executable.

A manually launched app-server was able to create the control socket artifacts in earlier testing, but codex remote-control still fails its privacy check.

codex doctor reports the background server as not running and the daemon pid/settings files as missing.

Connectivity/authentication checks are healthy.

Expected behavior

On a non-elevated Windows terminal, one of these should successfully expose Remote Control:

codex remote-control

or:

codex remote-control start

The host should then be pairable from the mobile app.

Diagnostic bundle

A sanitized diagnostic bundle is attached with:

environment/version

codex doctor --json

process inventory

socket directory ACL/SDDL

foreground Remote Control failure

daemon Remote Control failure

daemon staging inventory

Code Integrity events

Defender Controlled Folder Access state

Potentially related issue: #44581 (Windows socket-directory validation / app-server-control ACL interaction).

What steps can reproduce the bug?

On Windows 11 x64 with Codex CLI 0.156.0, Remote Control fails in both daemon and foreground modes.

Steps to reproduce:

  1. Open a non-elevated PowerShell.
  2. Confirm Codex CLI version:
codex --version

Expected output:

codex-cli 0.156.0
Try to start Remote Control using the daemon:
codex remote-control start

Actual result:

Starting app-server daemon with remote control enabled...
Installing daemon from CLI version 0.156.0 into C:\Users\<USER>\.codex\packages/app-server-daemon...
Error: Access is denied. (os error 5)
Try the foreground Remote Control path:
codex remote-control

Actual result:

Starting app-server with remote control enabled...
Error: foreground app-server exited before remote control became ready

Caused by:
    socket directory is not private to the current user
Verify the socket directory ACL:
$dir = "$env:USERPROFILE\.codex\app-server-control"
$acl = Get-Acl $dir

$acl | Format-List Owner,AreAccessRulesProtected,Sddl
$acl.Access.Count
$acl.Access | Format-List IdentityReference,FileSystemRights,AccessControlType,InheritanceFlags,PropagationFlags,IsInherited

The ACL is:

Owner                   : <current Windows user>
AreAccessRulesProtected : True
Access.Count             : 1

IdentityReference : <current Windows user>
FileSystemRights  : FullControl
AccessControlType : Allow
InheritanceFlags  : ContainerInherit, ObjectInherit
PropagationFlags  : None
IsInherited       : False

The owner SID and ACE SID also match the current Windows user SID.

Additional observations:

The user can create and delete files under ~\.codex\packages.
codex remote-control start creates install.lock, releases, multiple .staging.* directories, and copies Codex binaries before failing with os error 5.
A manually started app-server can create app-server-control.sock.
The failure persists even after reinstalling Codex using the standalone Windows installer.

**What is the expected behavior?**

```markdown
On a non-elevated Windows terminal, Remote Control should start successfully using either:

```powershell
codex remote-control

or:

codex remote-control start

The app-server/daemon should become ready, the Windows PC should be registered as a Remote Control host, and the host should be pairable from the ChatGPT/Codex mobile app.

A socket directory owned by the current user, with a protected DACL and a single non-inherited FullControl ACE for that same user, should be accepted as private.


**Additional information**

```markdown
Environment:

- Windows 11 Pro x64
- OS build 26200
- Codex CLI 0.156.0
- Codex Desktop 26.917.6896.0
- Standalone Codex CLI installation
- ChatGPT authentication
- Remote Control commands executed from a non-elevated PowerShell
- Controlled Folder Access disabled
- OpenAI connectivity and WebSocket checks succeed
- `codex doctor` no longer reports a fatal sandbox/configuration error

Two separate failures are reproducible:

1. Daemon mode:
   `codex remote-control start`
   → `Access is denied. (os error 5)`

2. Foreground mode:
   `codex remote-control`
   → `socket directory is not private to the current user`

The socket ACL was verified to have:
- current user as owner
- protected DACL
- exactly one ACE
- Allow / FullControl
- ContainerInherit + ObjectInherit
- not inherited

A sanitized diagnostic ZIP containing the doctor output, ACL details, process inventory, daemon staging contents, Defender state, and Code Integrity events is attached.

This may be related to issue #44581, but this report also includes a separate daemon-i

### What is the expected behavior?

_No response_

### Additional information

Related issue: #44581

Activity

  1. added
    bug
    on Sep 23, 2026
  2. added
    CLI
    windows-os
    app-server
    on Sep 23, 2026
  3. sntdckbn82-arch commented on Sep 25, 2026

    @sntdckbn82-arch

    Additional reproduction from a Windows 11 machine (build 26200):

    • Codex Desktop: 26.917.9434.0 (MSIX installed under WindowsApps).
    • Invoked CLI: codex-cli 0.155.0-alpha.16.4, at %LOCALAPPDATA%\OpenAI\Codex\bin\13995fba801849b0\codex.exe. The executable has a valid OpenAI OpCo, LLC digital signature. where.exe codex and PowerShell Get-Command codex -All each find only this one CLI on PATH.
    • That CLI directory contains codex.exe, codex-code-mode-host.exe, codex-command-runner.exe, and codex-windows-sandbox-setup.exe. %USERPROFILE%\.codex\packages\standalone is absent; %USERPROFILE%\.codex\packages\app-server-daemon is empty.
    • Foreground codex remote-control exits 1 immediately:
      Error: foreground app-server exited before remote control became ready
      Caused by:
          socket directory is not private to the current user
      
    • Daemon codex remote-control start exits 1 immediately with a different error:
      Error: this CLI has no complete local package; install a packaged Codex CLI or use the standalone installer
      
    • The desktop Remote Control switch also returns to Off after briefly loading. codex doctor reports that the desktop app-server initialized successfully; ChatGPT HTTPS is reachable. No account credentials or tokens are included here.

    This looks like two separate local startup failures. Is the CLI extracted into the desktop app's user-level bin directory expected to support daemon bootstrap? Also, could the foreground temporary socket directory validation on Windows surface the rejected path and ACE so the privacy failure can be diagnosed?

  4. mschfh commented on Sep 25, 2026

    @mschfh

    same issue, on Ubuntu 26.04, codex remote-control fails after upgrade:

    Starting app-server with remote control enabled...
    Error: foreground app-server exited before remote control became ready
    
    Caused by:
        socket parent must be owned by the user or root and prevent other users from replacing socket entries
    
  5. antoniooreany commented on Sep 25, 2026

    @antoniooreany

    I can investigate and prepare a fix for this Windows Remote Control issue, including a regression test for the socket-directory ACL validation.

  6. antoniooreany commented on Sep 25, 2026

    @antoniooreany

    Initial root-cause hypothesis from source inspection: run_foreground_remote_control creates its temporary socket directory with tempdir_in("/tmp") and only falls back to the platform temp directory. On Windows, the resulting directory can fail the Windows private-ACL validation even when the user-owned Codex socket directory itself is valid. I have a local fork and branch ready for investigation. Please let me know if the team would like an external PR for this targeted fix and regression coverage, given the repository contribution policy.

  7. applmanwx commented on Sep 27, 2026

    @applmanwx

    Same root cause, full forensics → #48043 (comment: #48043 (comment))

  8. Robird commented on Sep 27, 2026

    @Robird

    Additional evidence for the daemon installation failure on Windows with npm-installed Codex CLI 0.157.1: both codex and codex app-server daemon start failed with Access is denied (os error 5).

    The installer lock could be opened exclusively, the user had FullControl on releases, and creating/deleting files there worked. A FileSystemWatcher observed the complete staging tree being created and then removed, without a final release directory.

    In a separate probe, I copied the package into a staging directory, successfully ran its bin/codex.exe --version, and then tried to rename the directory. Rename failed immediately and after 1 second, but succeeded after another 3 seconds. The handle owner is unknown. This strongly points to a transient failure at the staging-to-release rename after the executable version check.

    A bounded retry with backoff for transient Windows rename errors may fix this while preserving the install lock and package verification. As a workaround, copying and SHA-256-verifying the complete package directly into the final release directory, then creating the current junction, allowed the daemon to start successfully.

  9. jeonkimin commented on Sep 29, 2026

    @jeonkimin

    Update after further Windows testing:

    I was able to get Windows-to-Windows Remote Control working successfully through the ChatGPT/Codex Desktop application.

    Verified setup:

    Successfully verified through Desktop Remote:

    • remote filesystem browsing
    • remote project folder selection
    • PowerShell/system command execution
    • file create/read/delete
    • Python and Git execution
    • multiple Windows remote hosts connected simultaneously

    Important distinction:

    This successful path is the ChatGPT/Codex Desktop Remote implementation.

    It does NOT confirm that the standalone CLI path reported in this issue is fixed.

    On NQ-3080-TTS I found multiple Codex installations:

    • npm codex.cmd: 0.153.0
    • standalone/local codex.exe: 0.153.4
    • Desktop bundled runtime: 0.158.0-alpha.2.1

    The working Remote session is driven by the Desktop application, not by directly running:

    codex remote-control
    

    or
    codex remote-control start

    Therefore I believe this issue should remain open until the native Windows standalone CLI Remote Control path is verified independently.

    The Desktop Remote success does show that the account, network, Windows-to-Windows pairing, remote filesystem access, and remote command execution can all work correctly on the same machines.

  10. etraut-openai commented on Oct 3, 2026

    @etraut-openai
    Contributor

    This appears to be a duplicate of #49449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIapp-serverbugremotewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions