Windows Sandbox

On this page 7

Windows Sandbox is a lightweight, disposable desktop environment built into Windows 10 and Windows 11 Pro, Enterprise and Education that runs applications in isolation from the host operating system. Each session starts from a clean, pristine copy of Windows, and when the window closes, all software, files and state are permanently deleted.

Within Windows security, the feature belongs to the family of virtualization-based protections. It uses the Microsoft hypervisor to separate a guest kernel from the host, which makes it a practical tool for opening suspicious attachments, testing installers or browsing untrusted sites without risking the main system.

How Windows Sandbox isolates untrusted code

Windows Sandbox runs a separate kernel inside a Hyper-V virtual machine, so code inside it cannot directly access host memory, processes or files. Unlike a conventional virtual machine, it needs no separate installation image or license: it builds its environment from the host’s own Windows files.

Several design choices keep it fast and small. A dynamic base image links most unchanged system files to the host as read-only references, so the sandbox occupies only around 25 MB on disk when idle and roughly 100 MB when running. Direct map memory sharing lets the guest reuse host pages for identical system binaries, and an integrated kernel scheduler treats sandbox threads like host processes, which lets the host reclaim memory and CPU when needed.

The table below describes the core components and the role each plays in the isolation model.

ComponentFunctionSecurity effect
Hyper-V hypervisorRuns the guest kernel in its own partitionHardware-enforced boundary
Dynamic base imageReuses host system files as immutable linksClean start on every launch
Direct map memoryShares identical read-only pagesLow overhead without write access
Integrated schedulerSchedules guest work as host threadsResponsive host under load
WDAGUtilityAccountDefault local account inside the guestNo host credentials exposed
Core components of the sandbox architecture

Requirements and configuration options

Windows Sandbox requires a supported edition, hardware virtualization enabled in firmware and enough resources for a second running Windows instance. It is not available on Windows Home editions, and it is enabled through Turn Windows features on or off or with the Enable-WindowsOptionalFeature cmdlet using the feature name Containers-DisposableClientVM.

RequirementMinimumRecommended
EditionWindows 10 or 11 Pro, Enterprise, EducationCurrent supported release
Architecture64-bit (AMD64 or ARM64)64-bit with SLAT support
Memory4 GB RAM8 GB RAM or more
Free disk space1 GBSSD storage
CPU cores2 cores4 cores with hyperthreading
Minimum and recommended system requirements

Behavior is customized with Windows Sandbox configuration files, plain XML documents with the .wsb extension. Opening such a file launches a sandbox with the specified settings, which makes repeatable test environments easy to share within a team.

SettingPurposeSecurity consideration
vGPUEnables or disables virtual GPUDisable to reduce attack surface
NetworkingTurns network access on or offDisable for offline malware analysis
MappedFoldersShares host folders, optionally read-onlyAlways prefer read-only mapping
LogonCommandRuns a script after sign-inAutomates tool setup
ClipboardRedirectionAllows copy and paste with the hostDisable to block data transfer
MemoryInMBSets guest memoryPrevents host resource exhaustion
Common configuration settings in a .wsb file

Recent Windows 11 releases also added command-line control through the wsb tool, which can start, list and stop sessions and execute commands inside them, and some builds allow state to persist across a guest restart until the sandbox itself is closed.

Windows Sandbox is a whole-desktop disposable environment, which distinguishes it from features that protect individual processes or credentials. It complements, rather than replaces, other virtualization-based security components.

FeatureWhat it isolatesPersistence
Windows SandboxEntire temporary desktopDiscarded on close
Hyper-V virtual machineFull installed operating systemPersistent with checkpoints
Credential GuardSecrets of the LSA processPermanent host protection
Memory integrityKernel-mode code integrity checksPermanent host protection
Smart App ControlBlocks untrusted apps before executionPolicy on the host
How Windows Sandbox differs from related tools

A full Hyper-V virtual machine remains the better choice when an analyst needs a specific Windows version, snapshots or long-running persistent tooling. Windows Sandbox wins when the priority is speed, zero maintenance and a guaranteed clean state.

Practical uses in administration and security work

The most common use is safe detonation of unknown files: opening an unexpected email attachment, testing a downloaded utility or inspecting a script before running it on production machines. Administrators also use it to test software deployments, validate installer switches and check how an application behaves on a clean profile.

  • Triage of suspicious files with networking disabled and a read-only mapped folder.
  • Installer testing to confirm silent switches and dependencies on a clean system.
  • Browsing untrusted sites in a session that leaves no cookies or downloads behind.
  • Training and demonstrations that must start identically every time.
  • Reproducing user issues without contamination from a technician’s own profile.

In managed environments, administrators can control availability through Group Policy or Intune, for example disabling clipboard sharing, printer redirection or networking for every sandbox session in the organization.

Limitations and security caveats

Windows Sandbox is strong isolation, not perfect isolation. Any enabled channel, such as networking, a writable mapped folder or clipboard redirection, is a potential path back to the host or the local network. Malware with network access can still reach internal systems or exfiltrate data that the user pastes into the guest.

Some advanced malware detects virtualized environments and stays dormant, so a file that appears harmless in the sandbox may still be malicious. The environment also lacks the instrumentation of a dedicated malware analysis lab, such as API tracing or memory forensics. Because everything is deleted on close, any evidence must be copied out deliberately before the session ends.

ProblemLikely causeFix
Feature cannot be enabledVirtualization disabled in firmwareEnable VT-x or AMD-V in UEFI
Sandbox fails to startConflicting hypervisor or low memoryFree resources, check Hyper-V state
Malware reached the networkNetworking left enabledDisable it in the .wsb file
Host files were modifiedMapped folder was writableSet ReadOnly to true
Results lost after closingDisposable designExport logs to a mapped folder first
Typical problems and how to address them

A plain-language summary

Windows Sandbox is like a brand-new spare computer inside your computer that appears in a window whenever you need it. You can open a strange file or install an unknown program there, and whatever happens stays inside that window.

When you close it, the spare computer vanishes completely, along with anything you did in it. Next time you open it, it is clean again. It is a quick way to try something risky without putting your real files at stake, as long as you do not open doors between the two, such as shared folders or the network.

An example from practice

An IT administrator at a mid-sized accounting firm receives a report from staff about an email with an attachment named as an overdue invoice. Rather than opening it on a workstation, the administrator launches a prepared .wsb configuration file that disables networking, clipboard redirection and the virtual GPU, and maps a quarantine folder as read-only.

Inside the sandbox, the administrator opens the document, which immediately tries to run a macro that drops a script into the temporary folder. With no network connection, the script fails to download its payload. The administrator records the file names and the process behavior, copies notes to a separate writable log folder, then closes the window.

The entire check takes about ten minutes, the host and network remain untouched, and the firm uses the gathered indicators to block the sender and the attachment hash across its email filtering and endpoint protection.