How to Configure Windows Sandbox and Advanced Networking Profiles in Windows 11

Opening unverified executables, testing untrusted PowerShell scripts, or browsing suspicious URLs poses severe security hazards to production Windows workstations. Windows Sandbox provides a lightweight, ephemeral desktop environment powered by Hyper-V virtualization. Every time Sandbox is closed, the entire guest operating system, filesystem changes, and memory allocations are permanently deleted, ensuring zero persistent contamination of the host machine.

Enabling Windows Sandbox in Windows 11

Windows Sandbox requires Windows 11 Pro, Enterprise, or Education edition with hardware virtualization enabled in system UEFI/BIOS.

  1. Press Windows Key + R, type optionalfeatures.exe, and press Enter to open the Turn Windows features on or off dialog.
  2. Scroll down and locate Windows Sandbox and Hyper-V Platform.
  3. Check the box next to Windows Sandbox and click OK.
  4. Windows will download required virtualization files and prompt for a system reboot. Restart your PC to complete installation.

Understanding .wsb Sandbox Configuration Files

By default, launching Windows Sandbox from the Start Menu starts a vanilla instance with internet access and basic display resolution. However, by creating custom XML-formatted configuration files with the .wsb extension, you can control Sandbox hardware access, startup commands, and network interfaces.

Configuring Advanced Networking Profiles in WSB

You can adjust network boundaries based on the nature of your diagnostic workload:

1. Isolated Offline Testing Sandbox: When testing suspected malware or destructive scripts, completely sever network connectivity to prevent command-and-control communication:

<Configuration>
  <Networking>Disable</Networking>
  <VGpu>Disable</VGpu>
  <ProtectedClient>Enable</ProtectedClient>
</Configuration>

2. Online Developer Sandbox with Shared Diagnostic Folders: For testing software builds with internet connectivity and read-only host folder mounts:

<Configuration>
  <Networking>Default</Networking>
  <VGpu>Enable</VGpu>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Tools\DiagnosticBinaries</HostFolder>
      <SandboxFolder>C:\Users\WDAGUtilityAccount\Desktop\Tools</SandboxFolder>
      <ReadOnly>true</ReadOnly>
    </MappedFolder>
  </MappedFolders>
  <LogonCommand>
    <Command>powershell.exe -ExecutionPolicy Bypass -Command "Write-Host 'Sandbox Initialized' -ForegroundColor Green"</Command>
  </LogonCommand>
</Configuration>

Configuring Virtual GPU Acceleration (vGPU)

By default, Windows Sandbox uses software rendering, which can result in sluggish frame rates during graphic-heavy application tests. In your .wsb configuration:

  • Set <VGpu>Enable</VGpu> to leverage host hardware GPU virtualization. This delegates DirectX rendering to the host graphics card while maintaining hypervisor boundaries.
  • Set <VGpu>Disable</VGpu> if analyzing graphics drivers or software that could trigger host GPU vulnerabilities.

Automating Startup Scripts via LogonCommand

To streamline repetitive diagnostic environments, configure the <LogonCommand> node to execute automated deployment routines upon sandbox launch:

<LogonCommand>
  <Command>cmd.exe /c start https://digitash.com</Command>
</LogonCommand>

Save your configuration file as DiagnosticLab.wsb. Double-clicking this file directly launches Windows Sandbox with all specified networking, folder mappings, and execution scripts applied instantly.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.