Repository navigation
Description
Relevant area(s)
Windows
Brief description of your issue
Under the tier 1 BaseContainer runner, a sandboxed process cannot translate an NT path back to a drive-letter path. GetFinalPathNameByHandleW fails with ERROR_ACCESS_DENIED (5) for every VOLUME_NAME_DOS request, on a handle the process just opened successfully, while the same call with VOLUME_NAME_NT succeeds. GetVolumeNameForVolumeMountPointW("C:\\") is refused too. So the Mount Manager seems to be out of reach from the container, and the NT→DOS translation needs it.
No filesystem policy changes this: it fails with the working directory inside readwritePaths, and also with C:\ itself in readonlyPaths.
Ordinary developer tools depend on this call:
- Node.js:
fs.realpathSync.native/fs.promises.realpath(libuvuv_fs_realpath) fail withEPERMon any path, the cwd included. npm and many CLIs resolve paths this way. - Git for Windows (native
mingw64\bin\git.exe):mingw_getcwdcallsGetFinalPathNameByHandleW, then falls back toGetLongPathNameW. That fallback has to list every ancestor folder by name, so every command that needs the work tree (init,status,rev-parse, ...) dies withfatal: unable to get current working directory: Permission deniedunless the drive root is readable. MakingC:\readable means falling back to a deny list of everything beside the project, which defeats an allow-only policy.
git --version, cmd, PowerShell and NUL all work under tier 1, so this looks like the last thing between tier 1 and a usable git-based workflow.
Environment:
- Windows 11 Home 24H2, build 26100.9457, x64
@microsoft/mxc-sdk1.0.0,wxc-exec.exe(x64);--debugshowsselected isolation tier: base-container, runnerBaseContainer- Node 26.4.0, Git for Windows 2.45.1
- Run from the interactive console session
Steps to reproduce
- Make a working folder, e.g.
C:\mxc-lab\app. - Config (
ui.disable: falseso that console tools start):
{
"version": "1.0.0",
"containment": "processcontainer",
"process": {
"commandLine": "node -e \"console.log(require('fs').realpathSync.native('.'))\"",
"cwd": "C:\\mxc-lab\\app",
"timeout": 30000
},
"filesystem": { "readwritePaths": ["C:\\mxc-lab\\app"] },
"ui": { "disable": false }
}wxc-exec.exe config.json- Same config with
"commandLine": "git init -q repo". - To isolate the call, a small probe that calls
GetFinalPathNameByHandleWwith each flag,GetLongPathNameWandGetVolumeNameForVolumeMountPointWon the cwd: https://github.com/laurentftech/pi-outpost/blob/feat/confined-terminal/scripts/probes/path-apis.cs (csc.exefrom .NET Framework builds it; no SDK needed).
Expected behavior
realpathSync.native('.') prints C:\mxc-lab\app, git init creates the repository, and GetFinalPathNameByHandleW(h, ..., VOLUME_NAME_DOS) returns \\?\C:\mxc-lab\app, as it does outside the container. Resolving a path the process may already open should not need any extra grant.
Actual behavior
node realpath.native EPERM: operation not permitted, realpath 'C:\mxc-lab\app'
git init fatal: unable to get current working directory: Permission denied
(it leaves an empty `repo` folder behind)
path-apis.exe inside the container, cwd C:\mxc-lab\app:
GetVolumeNameForVolumeMountPointW(C:\) ERROR 5
GetLongPathNameW ERROR 5 (OK once C:\ is in readonlyPaths)
CreateFileW(access=0, BACKUP_SEMANTICS) OK
GetFinalPathNameByHandleW(normalized, DOS) ERROR 5
GetFinalPathNameByHandleW(opened, DOS) ERROR 5
GetFinalPathNameByHandleW(normalized, NT) OK \Device\HarddiskVolume3\mxc-lab\app
GetFinalPathNameByHandleW(opened, NT) OK \Device\HarddiskVolume3\mxc-lab\app
Outside the container, every line succeeds. With C:\ added to readonlyPaths, the DOS variants still fail. Only git starts working, through its GetLongPathNameW fallback.
Related: #1061 (MSYS2 runtimes); this one affects native, non-MSYS tools.
Activity
docs(investigations): link the Mount Manager report, microsoft/mxc#1464
feat(terminal): MXC tier 1 as the sandbox runner on Windows 11
permissions: ask first for other Windows drives and say where Windows…
Ahlabeeb commentedon Oct 13, 2026
Additional repro on Windows 11 25H2 (build 26200.9457), via OpenAI Codex CLI 0.162.1 with
[windows] sandbox = "mxc"(PSEC path).Inside the container, I opened a workspace file with
CreateFileW(path, 0, FILE_SHARE_ALL, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL). The open itself succeeds. Then:GetFinalPathNameByHandleW(h, ..., VOLUME_NAME_DOS)ERROR_ACCESS_DENIED(5)GetFinalPathNameByHandleW(h, ..., VOLUME_NAME_GUID)GetFinalPathNameByHandleW(h, ..., VOLUME_NAME_NT)/VOLUME_NAME_NONECreateFileW("\\\\.\\MountPointManager", 0, ...)QueryDosDeviceW("C:", ...)Because
QueryDosDeviceWis also denied, Rust std's NT-path fallback inget_path_fallbackcannot help either.The DACL of
\\.\MountPointManagerread on the host isD:(A;;FX;;;WD)(A;;FA;;;SY)(A;;FA;;;BA)(A;;FX;;;RC). It has no ALL APPLICATION PACKAGES or container-SID entry. Under a restricted (non-AppContainer) token, all of the calls above succeed.Impact beyond Node
fs.realpathSync.native(libuv usesVOLUME_NAME_DOS):Deno.readFileSync(p)fails withAccess is denied. (os error 5)under--allow-readbut works under-A, anddeno testanddeno evalfail at startup.EPERM ... realpathin rollup's commonjs resolver and the config loader.Minimal repro, from inside the container:
Result: EPERM.
fs.realpathSync(the JS implementation) works.Expected: a supported way for BaseContainer/PSEC processes to resolve DOS volume names, either by default or through a policy capability.
workspace: hold Windows native commands under MXC once a canary passes
nilleb commentedon Oct 18, 2026
Another data point: GitHub Copilot CLI 1.0.90 itself can't run inside a BaseContainer because of this.
Environment: Windows 11 25H2, build 26200, x64; tier
base-container(allowDaclMutation: false), unelevated.mxc-sdkatfda29ac(Rust, viaspawn_container_json). The whole Copilot CLI process runs in the container, with the project inreadwritePathsand its install and package cache inreadonlyPaths.Probe inside the container, on an open handle to a granted file:
GetFinalPathNameByHandleWflagVOLUME_NAME_DOS(0)ret=0, error 5VOLUME_NAME_GUID(1)ret=0, error 5VOLUME_NAME_NT(2)\Device\HarddiskVolume4\Users\<user>\dev\<project>\README.mdVOLUME_NAME_NONE(4)Reading files and listing granted folders work.
processContainer.filesystem.enumeratePathsis refused on this build ("not supported by this version of Windows"), so the #1109 route isn't available either.What breaks in Copilot CLI 1.0.90:
fs.realpathSyncfails withEPERM lstat 'C:\', and so doesfs.realpathSync.native. I could shim the JS side by falling back topath.resolveon EPERM, after which the CLI starts and signs in.runtime.node, Rustcanonicalize) can't be shimmed, and it makes the CLI unusable:Execution failed: Error: Request session.send failed with message: Shared writer storage I/O failed.Failed to initialize MCP host: Shared writer storage I/O failed., so there are no MCP servers, including the built-in GitHub one.-pmode exits withError: Directory does not exist or cannot be accessed: <cwd>, as does--add-dir <granted path>.Could not resolve instruction import '@AGENTS.md' from '<project>\CLAUDE.md': Access is denied. (os error 5)git root lookup failed ... fatal: Unable to read current working directory: Permission deniedI ruled out the DACL Copilot puts on its writer lock files (
D:P(A;;FA;;;OW)(A;;FA;;;SY)(A;;FA;;;BA)): the container can create a file with that exact protected descriptor, reopen it and write to it.Copilot CLI's own experimental
--sandboxruns on BaseContainer too, but it only contains the commands Copilot runs, not the CLI process itself, so it doesn't hit the runtime failures above. Its commands still hit the git and Clippy cases already reported in #694.nilleb commentedon Oct 27, 2026
#694 reported this same failure in AppContainer, and rsc found a workaround there. Granting the container capability read access to four objects makes
GetFinalPathNameByHandleW(VOLUME_NAME_DOS)succeed:\GLOBAL??DIRECTORY_QUERY | DIRECTORY_TRAVERSE | READ_CONTROL\GLOBAL??\C:(and each other drive)SYMBOLIC_LINK_QUERY | READ_CONTROL\GLOBAL??\MountPointManagerSYMBOLIC_LINK_QUERY | READ_CONTROL\\.\MountPointManagerFILE_GENERIC_READ#694 was closed because Tier 3 is being deprecated, not because it was fixed. rsc said there that they believed Tier 1 was affected too and asked for a Tier 1 test before closing. This issue shows that it is: BaseContainer fails the same way. Ahlabeeb's DACL dump above shows why:
\\.\MountPointManagerhas no ALL APPLICATION PACKAGES or container-SID entry.Questions:
realpath) looks like the same family of problem with mounted-volume path resolution. It may be worth handling the two together.This is the main blocker for running agent CLIs inside a ProcessContainer. git can't read its working directory, Node's
realpath.nativefails, and Copilot CLI's native runtime (Rustcanonicalize) fails. Since #1582 there is no fallback to an older isolation tier, so we have no workaround short of leaving the CLI uncontained.nilleb commentedon Oct 27, 2026
Microsoft's own regression test for #694 reproduces this on a public 25H2 build.
mxc-release-binaries.zip(x64\wxc-exec.exe).tests/regression_tests/test_cases/Invoke-Issue694-GetFinalPathNameByHandle.ps1frommain, i.e. the native BaseContainer version from Remove Tier2 and Tier3 ProcessContainer fallbacks #1558.Result:
The log confirms the container ran as
"tier":"base-container", so this is not a fallback to an older tier.Side note: under Windows PowerShell 5.1, the script stops at the probe's stderr (a
NativeCommandErrorunder$ErrorActionPreference = 'Stop'), before it reaches its own tier and result checks. pwsh 7 may behave differently.Since #1558 now expects this test to pass with no workaround, which Windows build is it expected to pass on? If the fix depends on an OS change, is it planned for a public 24H2/25H2 cumulative update? That's the deciding question for anyone running agent CLIs (git, Node, Copilot CLI) in a ProcessContainer on managed machines.
nilleb commentedon Nov 9, 2026
Follow-up to my last comment: this is fixed by the October cumulative update.
"tier":"base-container".Inside the container, with the repo in
readwritePathsand the Node and MinGit install directories inreadonlyPaths:node -e "require('fs').realpathSync.native('.')"(Node 24.21.0)git rev-parse --show-toplevel(git.exe, no MSYS shell)Unable to read current working directory: Permission deniedInvoke-Issue694-GetFinalPathNameByHandle.ps1VOLUME_NAME_DOS error: Access is deniedThis matches your nightly validation, where the #694 test passes on 26100.9711 (24H2) and 26200.9725 (25H2).
One suggestion:
docs/backends/process-container/os-version-support.mdlists 26100.9278 / 26200.9278 as the ProcessContainer minimum. On anything between .9278 and .9711, git, Noderealpath.nativeand Rustcanonicalizefail inside the container with access denied, and nothing points at the OS build. A note in that table, or a probe warning below .9711, would save the next person some debugging.Anything that starts the MSYS runtime (
sh.exe, script hooks, Git Bash) still fails. That's #1061 and unrelated to this issue.docs: Windows processcontainer without admin rights, and its OS build…
mrestrepo95 commentedon Nov 19, 2026
A related symptom we hit (same family, possibly not the same call):
node <script>itself fails inside the container,because Node's module loader resolves the main script's real path by looking at every ancestor folder up to the drive
root, which an allow-only policy does not grant. What we do meanwhile:
NODE_OPTIONS=--preserve-symlinks-main --preserve-symlinksforevery contained process, which makes Node take the path as given.
GenTang commentedon Nov 29, 2026
For the script-launch symptom above, I'd keep two regression checks: does
node script.jsreach the script body, and doesspawn()return with piped stdio or IPC? In our FinShield comparison with MXC’s AppContainer backend, the file entry failed during drive lookup, and a separatenode -eprobe worked with inherited stdio but stalled with pipes or IPC. A separate check on the patched BaseContainer would tell you which of those two paths is working there.