Windows-Sandbox icon indicating copy to clipboard operation
Windows-Sandbox copied to clipboard

[Bug]: Environment variables do not working in Mapped Folder

Open HUMORCE opened this issue 8 months ago • 1 comments

Windows Sandbox version

0.5.0.0

Windows build number

10.0.26100.0 | 24H2

Other software

No response

Steps to reproduce the bug

Run with this config:

<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>%USERPROFILE%\workspace</HostFolder>
      <SandboxFolder>C:\Users\WDAGUtilityAccount\workspace</SandboxFolder>
    </MappedFolder>
  </MappedFolders>
</Configuration>

Expected result

Correct mapping and working.


I can confirm it was working before, because I have multiple wsb configs that use environment variables in mapped folder, they were created in Aug, 2023.

And the documentation notes that:

... Beginning in Windows 11, version 23H2, you can use environment variables in the path.

https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-configure-using-wsb-file#mapped-folders

Actual result

Image

Included System Information

No response

HUMORCE avatar May 23 '25 02:05 HUMORCE

It looks like the path format has been restricted in the new version for some reason, this will works correctly.

<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Users\%USERNAME%\workspace</HostFolder>
      <SandboxFolder>C:\Users\WDAGUtilityAccount\workspace</SandboxFolder>
    </MappedFolder>
  </MappedFolders>
</Configuration>

Close if this is the expected behavior of program design.

HUMORCE avatar May 23 '25 03:05 HUMORCE

This issue is resolved in the latest version of Windows Sandbox. Release date tbd, but I will update as soon as we have that information.

kvega005 avatar Jul 01 '25 23:07 kvega005