Skip to content

Instantly share code, notes, and snippets.

@daemonhorn
Created October 8, 2022 21:08
Show Gist options
  • Save daemonhorn/42627a78bd258c1ff7a5b179ae6ba5d1 to your computer and use it in GitHub Desktop.
Save daemonhorn/42627a78bd258c1ff7a5b179ae6ba5d1 to your computer and use it in GitHub Desktop.
Windows Sandbox configuration example
<!-- See https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-configure-using-wsb-file -->
<Configuration>
<VGpu>Disable</VGpu>
<Networking>Enable</Networking>
<MemoryInMB>5096</MemoryInMB>
<ClipboardRedirection>Enable</ClipboardRedirection>
<PrinterRedirection>False</PrinterRedirection>
<ProtectedClient>False</ProtectedClient>
<VideoInput>False</VideoInput>
<AudioInput>False</AudioInput>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Users\daemo\host_read\</HostFolder>
<!-- Note: Any HostFolder definitions require that these paths already exist or the Sandbox will not start with "The configuration file was invalid" error -->
<SandboxFolder>C:\Users\WDAGUtilityAccount\sandbox_read\</SandboxFolder>
<!-- If Sandboxfolder is not defined, this defaults to the Desktop of the WDAGUtilityAccount inside the sandbox, will be created dynamically as needed -->
<ReadOnly>true</ReadOnly>
</MappedFolder>
<MappedFolder>
<HostFolder>C:\Users\daemo\host_write\</HostFolder>
<SandboxFolder>C:\Users\WDAGUtilityAccount\sandbox_write\</SandboxFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass c:\Users\WDAGUtilityAccount\sandbox_read\script.ps1 *>&#38;1 ^| tee-object -FilePath c:\Users\WDAGUtilityAccount\sandbox_write\session.log </Command>
<!-- Note: &38; is used as an XML compatible variant of the normal Ampersand "&" character in the redirection for all of the stdout/error/verbose levels "*>&1" -->
</LogonCommand>
</Configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment