Codex CLI does not execute cmd.exe /c build.bat under WSL
Resolved 💬 8 comments Opened Sep 28, 2025 by morganavr Closed Jan 10, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.42.0
Which model were you using?
gpt-5-codex high
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
Launch codex cli under wsl in Windows 10, ask Codex to launch this command:
cmd.exe /c build.bat
Codex fails with this error:
Ran cmd.exe /c build.bat
└ <3>WSL (931 - ) ERROR: UtilBindVsockAnyPort:307: socket failed 1
What is the expected behavior?
command is run
What do you see instead?
Ran cmd.exe /c build.bat
└ <3>WSL (931 - ) ERROR: UtilBindVsockAnyPort:307: socket failed 1
Additional information
_No response_
8 Comments
I noticed that when Codex CLI adjusted command timeout - command worked successfully. Maybe there is a way to setup command timeouts in config file?
yeah I came across this issue too, and I also found that letting codex adjust bash tool timeout argument solved the problem, kind of weird
same issue
I found that wrapping the actual command in double quotes fixes the issue
cmd.exe /c "tasklist | findstr build"same issue for "git status"
wsl2, codex 0.48
seems in my case in my wsl i somehow (mobaxterm terminal) i've got git from windows not local wsl ubuntu git
when i use local ubuntu git it works
We've made a bunch of improvements for WSL in recent versions. I think this issue may no longer be relevant. I'll keep it open until someone is able to confirm.
As of v0.80.0 this problem still exists. I tried wrapping the command in double-quotes and without, same result.
I encountered this problem, but solved changing permission to full access.