guidox / Security

Test a Suspicious File in Windows Sandbox

TL;DR

Enable the **Containers-DisposableClientVM** feature, reboot, then drag the file into the sandbox window. When you close the window, the whole machine state is discarded.

Before you start

Requirements

  • Windows 11 Pro, Enterprise or Education
  • Virtualization enabled in firmware
  • 10 minutes
Step by step

Instructions

01

Check that the edition supports it

Windows Sandbox is not available on Home. The edition string from DISM is the reliable check, and the optional feature list shows whether the sandbox is installable at all.

DISM /online /Get-CurrentEdition
Get-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM | Select-Object FeatureName,State
Get-ComputerInfo -Property HyperVRequirementVirtualizationFirmwareEnabled,HyperVisorPresent
02

Enable the feature

**Enable-WindowsOptionalFeature** needs a restart. The sandbox uses the same hypervisor layer as Hyper-V, so a machine with Hyper-V already on can run both.

Enable-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM -All -NoRestart
Get-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM | Select-Object State
Restart-Computer
03

Decide what the sandbox can reach

The defaults give the sandbox network access and a read-only view of the host through a mapped folder. Both settings change what a sample can do, so set them deliberately.

$cfg = @'
<Configuration>
  <Networking>Disable</Networking>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Samples</HostFolder>
      <ReadOnly>true</ReadOnly>
    </MappedFolder>
  </MappedFolders>
</Configuration>
'@
$cfg | Set-Content "$env:USERPROFILE\sandbox.wsb" -Encoding UTF8
04

Start the sandbox and open the sample

The sandbox window is a clean Windows desktop. The mapped folder appears on the desktop as **C:\Users\WDAGUtilityAccount\Desktop\Samples** and is read-only by design.

Start-Process "$env:USERPROFILE\sandbox.wsb"
# inside the sandbox:
# open the Samples folder on the desktop
# run the installer or the document there, never on the host
05

Watch what the sample does

Task Manager and the sandbox's own Event Viewer show the processes and services the sample created. Anything that survives the session is gone at close, but what it tried to reach is worth noting.

# inside the sandbox:
Get-Process | Sort-Object StartTime -Descending | Select-Object -First 10 Name,Id,StartTime
eventvwr.msc
# Windows Logs > Application, look for the sample's process name
06

Close the window and confirm the reset

Closing the sandbox window discards the state, including files written to its desktop. The next start is a fresh image, which is the entire point of the tool.

# close the sandbox window with the X
Get-Process -Name WindowsSandboxClient -ErrorAction SilentlyContinue
Test-Path "$env:LOCALAPPDATA\Microsoft\Windows\Sandbox"
Start-Process "$env:USERPROFILE\sandbox.wsb"
Troubleshooting

Common issues

The feature is not listed

The edition is Home, or the firmware has virtualization disabled. Check the edition first, then enable VT-x or AMD-V in the firmware setup.

The sandbox window opens and stays black

The hypervisor is not running. Check with systeminfo that a hypervisor is detected, then make sure no other virtualization product holds the CPU extensions.

A mapped folder does not appear

The path in the .wsb file must exist on the host. A folder with a space in the name works; a missing folder fails silently.

The sample behaves differently than on the host

It is a clean Windows image without your software. Behaviour that depends on your installed apps cannot be reproduced there.

FAQ

Frequently asked

Is the sandbox a real virtual machine?

It is a lightweight container built on the same hypervisor technology, with a disposable image. It is not a Hyper-V VM you can keep.

Can malware escape?

The design isolates it, but the network is shared unless you disable it. Turn networking off for anything you do not trust.

Can I install software permanently in it?

You can install it, but the next session starts clean. For a persistent test machine use a Hyper-V VM instead.

How to undo this

Disable the feature with Disable-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM -NoRestart and reboot. Delete the .wsb file in your profile.

Changelog · 1 entry
  1. 2026-11-01
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress