Skip to content

Windows sandbox fails for workspaces on folder-mounted volumes #1548

Open

Description

Summary

Sandboxed execution fails when the working directory is on a Windows volume mounted to a folder rather than a drive letter. The same command succeeds with sandboxing disabled. This appears related to how mounted-volume paths are handled by the sandbox.

Reproduction steps

  1. On Windows, mount a volume (for example, a Dev Drive) to an empty NTFS folder such as C:\Mounts\SandboxRepro, without assigning the volume a drive letter.

  2. Create a project at C:\Mounts\SandboxRepro\NodeMain with these files:

    package.json

    {
      "name": "folder-mounted-volume-sandbox-repro",
      "version": "1.0.0",
      "private": true,
      "scripts": {
        "validate:version": "node ./tools/lib/validate-main.js"
      }
    }

    tools\lib\validate-main.js

    const fs = require("node:fs");
    
    console.log("Node entrypoint loaded successfully.");
    console.log("Node version:", process.version);
    console.log("Working directory:", process.cwd());
    console.log("Mount realpath:", fs.realpathSync("C:\\Mounts\\SandboxRepro"));
    console.log("Script realpath:", fs.realpathSync(__filename));
  3. Enable sandboxing in the host application and allow access to the project and mount-point folder.

  4. Run npm run validate:version through the sandbox from the project directory.

  5. Disable sandboxing and run the same command again for comparison.

Expected behavior

The command succeeds with sandboxing enabled when access is allowed, including resolving paths through the volume mount point.

Actual behavior

With sandboxing enabled, Node.js fails before the script executes:

Error: EPERM: operation not permitted, stat 'C:\Mounts\SandboxRepro'
    at Object.realpathSync (node:fs:2872:17)
    at toRealPath (node:internal/modules/helpers:67:13)
    at Module._findPath (node:internal/modules/cjs/loader:850:22)

With sandboxing disabled, the command exits successfully and resolves both the mount-point and script paths.

Notes

  • Observed on Windows with Node.js v24.20.0, through the VS Code Copilot SDK integration.
  • The related report confirms that explicitly allowing the mount-point folder does not resolve the failure. Allowing the underlying volume GUID path instead results in CreateProcessSecurityEnvironment failed (HRESULT = 0x8007000F).
  • A local retry also encountered CreateProcessSecurityEnvironment failed (HRESULT = 0x80070057); the configuration that triggered this separate error was not captured.

Related report: microsoft/vscode#343231

Activity

  1. added
    Needs-Triage
    on Oct 21, 2026
  2. changed the title [-]Windows sandbox: folder-mounted volume causes Node.js EPERM and process security environment failures[/-] [+]Windows sandbox fails for workspaces on folder-mounted volumes[/+] on Oct 21, 2026
  3. removed
    Needs-Triage
    on Oct 23, 2026
  4. added
    Issue-Bug
    Backend-ProcessContainer
    on Oct 23, 2026
  5. bbonaby commented on Oct 23, 2026

    @bbonaby
    Collaborator

    CC: Daniel (@daniedud-MSFT) can you take a look at this when you get the chance?

  6. added
    OS-Windows
    Backend-ProcessContainer-Filesystem
    on Oct 26, 2026
  7. removed
    Backend-ProcessContainer
    on Oct 27, 2026
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

    Backend-ProcessContainer-FilesystemIssue-BugOS-Windows

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions