Windows 指南
Section titled “Windows 指南”在 Windows 上运行 Codex 的实用技巧
在 Windows 上使用 Codex 桌面应用、CLI 或 IDE 扩展。
Codex 桌面应用支持 Windows 上的核心工作流:并行智能体线程、工作树、自动化、Git 功能、应用内浏览器、产物预览、插件和技能。
![]()
推荐。使用专用低权限沙箱用户、文件系统权限边界、防火墙规则和本地策略更改。
[windows]sandbox = "elevated"如果 elevated 不可用,使用降级模式:
[windows]sandbox = "unelevated"Windows 版本矩阵
Section titled “Windows 版本矩阵”| 版本 | 支持等级 | 说明 |
|---|---|---|
| Windows 11 | ✅ 推荐 | 最佳基线 |
| Windows 10(最新更新) | ⚠️ 尽力支持 | 需 1809 或更新版本 |
| 旧版 Windows 10 | ❌ 不推荐 | 缺少所需控制台组件 |
当需要 Linux 原生环境时使用。Codex 在 WSL2 中运行,使用 Linux 沙箱。
安装 WSL:
# 以管理员身份运行 PowerShellwsl --install从 VS Code 连接 WSL:
# 在 WSL 终端中cd ~/code/your-projectcode .在 WSL 中安装 Codex:
# 安装 nvm 和 Node.jscurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bashnvm install 22
# 安装 Codexnpm i -g @openai/codexcodex在完全访问模式下运行 Codex 意味着 Codex 不受项目目录限制,可能执行意外破坏性操作。为更安全的自动化,保持沙箱边界并使用规则处理特定例外。
| 问题 | 建议 |
|---|---|
| 原生沙箱设置失败 | 检查 Windows 版本、策略错误和沙箱设置 |
| Codex 切换到降级沙箱 | 以管理员身份运行设置 |
| Windows 错误 1385 | 检查登录权限 |
| 沙箱命令无法访问网络 | 检查防火墙规则 |
| VS Code 在 WSL 中找不到 Codex | 确保在 WSL 中全局安装了 Codex |
| WSL 中大仓库运行缓慢 | 将仓库放在 Linux 目录,而非 /mnt/c |