Summary
On Windows Codex Desktop with a repository opened from WSL via a UNC path such as:
\\?\UNC\wsl.localhost\Ubuntu-24.04\home\<user>\project
there are three related problems in practice:
- The integrated terminal fails to open in the project directory when
integratedTerminalShell is set to wsl.
- The app continues to use Windows-side config/state in WSL mode.
- Worktrees need to live on the WSL filesystem, not under
C: / /mnt/c, otherwise performance becomes unacceptable.
I am filing this as a consolidated issue because the current user experience pushes teams into ad-hoc workarounds, and a documented workaround would already help a lot.
Environment
- Date observed: April 18, 2026
- Platform: Windows 11 + WSL2
- Distro: Ubuntu-24.04
- Repo location:
/home/<user>/... inside WSL
- Project opened in Codex Desktop through
\\wsl.localhost\Ubuntu-24.04\home\<user>\...
Problem 1: integrated terminal in WSL mode loses the project cwd
When the project is opened from a WSL UNC path, Codex Desktop appears to pass a Windows UNC path such as:
\\?\UNC\wsl.localhost\Ubuntu-24.04\home\<user>\project
into wsl.exe as the cwd.
In practice, this produces:
wsl: Failed to translate '\\?\UNC\wsl.localhost\Ubuntu-24.04\home\<user>\project'
and the terminal falls back to ~ instead of opening in the repo directory.
Expected behavior
If the project root is inside WSL, the terminal should open directly in the matching Linux directory, e.g.:
/home/<user>/project
Actual behavior
The terminal drops into home, and users need to manually cd back or use a custom wrapper.
Problem 2: Windows config/state still leaks into WSL mode
Even in WSL mode, the app can still reference Windows-hosted config.toml / state instead of the WSL-native location.
This creates confusion about which config is actually active and makes sharing MCP / terminal setup across teammates much harder.
Problem 3: worktrees must live inside WSL
When CODEX_HOME points at the Windows location, worktrees can end up under /mnt/c/Users/<user>/.codex/... instead of a Linux-native directory.
That is a major performance problem for Git-heavy workflows. In real usage, teams keeping repos in WSL want worktrees under something like:
/home/<user>/.codex-app/worktrees/...
not on the Windows filesystem.
Practical workaround that worked for us
1. Keep the agent in WSL, but set the integrated terminal back to PowerShell
Using integratedTerminalShell = "wsl" is the part that breaks terminal startup for UNC-backed WSL repos.
Switching the integrated terminal back to powershell avoids the broken cwd translation path.
2. Force a WSL-native CODEX_HOME only for Codex Desktop
In ~/.profile inside WSL:
# Keep Codex Desktop state/worktrees on the Linux filesystem when the
# Windows app launches its WSL runtime.
if [ "${CODEX_INTERNAL_ORIGINATOR_OVERRIDE:-}" = "Codex Desktop" ]; then
export CODEX_HOME="$HOME/.codex-app"
fi
Then create the directory once:
mkdir -p ~/.codex-app/worktrees ~/.codex-app/sessions ~/.codex-app/tmp
This keeps worktrees and internal Codex state on the Linux filesystem, which is much faster for WSL-hosted repos.
3. Add a PowerShell helper that jumps from the current UNC path into WSL in the same directory
In the Windows PowerShell profile:
function Enter-WslHere {
param(
[string]$Path = (Get-Location).Path
)
$p = $Path -replace '^\\\\\?\\UNC\\', '\\'
if ($p -match '^\\\\wsl(?:\.localhost)?\\([^\\]+)\\(.+)$') {
$distro = $matches[1]
$linuxPath = '/' + ($matches[2] -replace '\\', '/')
wsl.exe -d $distro --cd $linuxPath
return
}
Write-Error "Current path is not a WSL UNC path: $Path"
}
Set-Alias wslhere Enter-WslHere
This gives a reliable bridge:
- Codex integrated terminal opens as PowerShell in the project UNC path
- running
wslhere opens WSL in the matching Linux project directory
Why this matters
For teams developing in WSL, the current behavior makes the Windows app feel half-configured even when the repo is already correctly placed inside Linux.
The desired setup is straightforward:
- repo in WSL
- agent in WSL
- worktrees in WSL
- terminal opens in the exact project directory
Today, that still requires manual tweaks and user-discovered workarounds.
Requested improvements
- If a project path is a WSL UNC path, convert it to its Linux path before launching
wsl.exe for the integrated terminal.
- In WSL mode, default the runtime
CODEX_HOME / worktree root to a WSL-native location.
- Make it unambiguous which config file is active in WSL mode.
- If a full fix takes time, document the above workaround in official Windows + WSL guidance.
Related reports
These look closely related:
Happy to provide more exact local details if useful.
Summary
On Windows Codex Desktop with a repository opened from WSL via a UNC path such as:
\\?\UNC\wsl.localhost\Ubuntu-24.04\home\<user>\projectthere are three related problems in practice:
integratedTerminalShellis set towsl.C://mnt/c, otherwise performance becomes unacceptable.I am filing this as a consolidated issue because the current user experience pushes teams into ad-hoc workarounds, and a documented workaround would already help a lot.
Environment
/home/<user>/...inside WSL\\wsl.localhost\Ubuntu-24.04\home\<user>\...Problem 1: integrated terminal in WSL mode loses the project cwd
When the project is opened from a WSL UNC path, Codex Desktop appears to pass a Windows UNC path such as:
\\?\UNC\wsl.localhost\Ubuntu-24.04\home\<user>\projectinto
wsl.exeas the cwd.In practice, this produces:
wsl: Failed to translate '\\?\UNC\wsl.localhost\Ubuntu-24.04\home\<user>\project'and the terminal falls back to
~instead of opening in the repo directory.Expected behavior
If the project root is inside WSL, the terminal should open directly in the matching Linux directory, e.g.:
/home/<user>/projectActual behavior
The terminal drops into home, and users need to manually
cdback or use a custom wrapper.Problem 2: Windows config/state still leaks into WSL mode
Even in WSL mode, the app can still reference Windows-hosted
config.toml/ state instead of the WSL-native location.This creates confusion about which config is actually active and makes sharing MCP / terminal setup across teammates much harder.
Problem 3: worktrees must live inside WSL
When
CODEX_HOMEpoints at the Windows location, worktrees can end up under/mnt/c/Users/<user>/.codex/...instead of a Linux-native directory.That is a major performance problem for Git-heavy workflows. In real usage, teams keeping repos in WSL want worktrees under something like:
/home/<user>/.codex-app/worktrees/...not on the Windows filesystem.
Practical workaround that worked for us
1. Keep the agent in WSL, but set the integrated terminal back to PowerShell
Using
integratedTerminalShell = "wsl"is the part that breaks terminal startup for UNC-backed WSL repos.Switching the integrated terminal back to
powershellavoids the broken cwd translation path.2. Force a WSL-native CODEX_HOME only for Codex Desktop
In
~/.profileinside WSL:Then create the directory once:
This keeps worktrees and internal Codex state on the Linux filesystem, which is much faster for WSL-hosted repos.
3. Add a PowerShell helper that jumps from the current UNC path into WSL in the same directory
In the Windows PowerShell profile:
This gives a reliable bridge:
wslhereopens WSL in the matching Linux project directoryWhy this matters
For teams developing in WSL, the current behavior makes the Windows app feel half-configured even when the repo is already correctly placed inside Linux.
The desired setup is straightforward:
Today, that still requires manual tweaks and user-discovered workarounds.
Requested improvements
wsl.exefor the integrated terminal.CODEX_HOME/ worktree root to a WSL-native location.Related reports
These look closely related:
Happy to provide more exact local details if useful.