Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Windows Sandbox on Windows 11: Enable, Configure, and Use

June 10, 2026

Windows Sandbox on Windows 11: Enable, Configure, and Use

Windows Sandbox is a built-in feature in Windows 10 and 11 that provides a temporary, lightweight, fully isolated environment for safely testing untrusted applications or opening suspicious files. When the Windows Sandbox is closed, all changes made within the environment are discarded. The next time it is launched, it starts from a clean, pristine state. Windows Sandbox is based on Windows virtualization and container-based isolation features. In this article, we’ll show how to enable, configure, and use Windows Sandbox in Windows 11.

Contents:
  • How to Enable Sandbox in Windows 11
  • Using the Windows Sandbox Feature in Windows 11
  • Customizing Windows Sandbox Using Configuration Files
  • Managing Windows Sandbox via Command Line Interface
  • How to Enable Sandbox in Windows 11 Home Edition

Unlike a traditional virtual machine, Windows Sandbox does not require you to install, configure, license, or activate a Windows image. The Sandbox container uses less disk space and fewer system resources by leveraging the host Windows image as its base layer. Changes made in such an isolated environment will not affect your main operating system. Once the Sandbox has been closed, all of its contents are cleared. A sandboxed container is useful for more than just running potentially risky apps; it can also be used for testing scripts and debugging app deployments.

How to Enable Sandbox in Windows 11

To use Windows Sandbox, your computer must meet the following minimum requirements:

  • A 64-bit CPU with a minimum of two cores
  • Enabled hardware virtualization support in the computer’s BIOS/UEFI firmware settings. When running Windows 11 OS in a virtual machine, support for nested virtualization must be enabled in the VM settings.
  • Windows 11 with Pro or Enterprise edition
  • At least 4 GB of memory (8 GB recommended) and 1 GB of free disk space (SSD preferred)

The Sandbox can be enabled using the classic ‘Turn Windows features on or off’ applet. Open it with the command:

optionalfeatures.exe

Check the Windows Sandbox feature for installation.

Enable the Windows Sandbox via optionalfeatures applet

Or install the Sandbox feature using PowerShell:

Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -All -Online

A reboot will be required after installation.

Enable-WindowsOptionalFeature Containers-DisposableClientVM

To use the Sandbox feature in Windows 11, it is not necessary to install the Hyper-V virtualization role, Windows Hypervisor Platform, or Containers features.

The Windows Sandbox base container image and virtual disks are stored in the C:\ProgramData\Microsoft\Windows\Containers\Sandboxes folder. Note that over time, the Sandbox container layer files (similar to those used by Docker) can accumulate in the C:\ProgramData\Microsoft\Windows\Containers\Layers directory and consume a significant amount of disk space. There is no straightforward method available for cleaning up or consolidating Sandbox layer files. So, to significantly reduce disk usage, the most effective approach is to disable the Windows Sandbox feature, clear the associated directories, and then re-enable it.

Using the Windows Sandbox Feature in Windows 11

To open the Windows Sandbox, either find the item in the Start menu or run the WindowsSandbox.exe command.

Run Windows Sandbox from the Start menu

A new window will open displaying a clean Windows desktop. This is a clean Windows 11 image with the default settings. It is dynamically generated based on the component files and libraries of your host operating system. The Windows version and build will remain the same.

Only one sandbox instance can be launched at a time. The following resources are assigned to the container:

  • The number of CPU cores is the same as that on the host
  • 4 GB of RAM
  • 80 GB hard drive

Inside the Sandbox, a network is enabled, configured, and connected to the Internet via a Hyper-V virtual switch with NAT through the host’s primary network adapter.

Running sandbox container in Windows 11

You can adjust certain settings by clicking the three-dot menu in the Windows Sandbox title bar. From here, you can enable audio/video redirection and clipboard sharing, expand the Sandbox window to full screen, or mount a local host folder into the Sandbox container.

Windows Sandbox dynamic settings

The sandbox console window can be used similarly to an RDP session. You can resize the Windows Sandbox window, and the Sandbox desktop resolution will automatically adjust to fit it.

The clipboard between the host and the Sandbox container is enabled by default, allowing you to transfer any file from your computer via drag-and-drop or the copy-and-paste (Ctrl+C and Ctrl+V).

If you close the Sandbox window, all changes made inside the container are discarded. A warning appears when you close the Sandbox console:

Are you sure you want to close Windows Sandbox? Once Windows Sandbox is closed all of its content will be discarded and permanently lost.

Once Windows Sandbox is closed all of its content will be discarded and permanently lost

Customizing Windows Sandbox Using Configuration Files

The settings for Windows Sandbox can be managed using configuration files. The Windows Sandbox configuration file is an XML-formatted file with the .WSB extension (Windows Sandbox Configuration). The following options (tags) can be set in the WSB file:

  • vGPU – access to the host video card (GPU)
  • Networking – network access from the Sandbox
  • MappedFolders – share a folder from the host operating system with the sandbox (can be made available for either read or write access)
  • LogonCommand — a command or script to run when the Sandbox starts
  • AudioInput
  • VideoInput
  • ProtectedClient – enhanced security mode features for host workstation protection (using AppContainer isolation execution environment)
  • PrinterRedirection – enabling printer redirection from the host OS
  • ClipboardRedirection – clipboard redirection
  • MemoryInMB – the amount of available RAM (in MB) in the Sandbox environment

Most of these options are set to Enable, Disable, or Default.

Below is a sample Windows Sandbox configuration file, which is used for:

  • Enable access to the network.
  • The amount of RAM available in the container has increased to 6 GB.
  • Mount the local folder C:\WSB from the host OS to C:\HostShare\ in the Sandbox container. The target path in the sandbox will be created automatically.
  • When the Sandbox environment boots up, the logon script runs automatically (in our case, this is a PowerShell script).
<Configuration>
<Networking>Enable</Networking>
<MemoryInMB>6144</MemoryInMB>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\WSB</HostFolder>
<SandboxFolder>C:\HostShare\Tools</SandboxFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command> powershell.exe -NoExit -ExecutionPolicy Bypass -File C:\HostShare\Tools\PrepareSandbox.ps1
</Command>
</LogonCommand>
</Configuration>

Sample Windows Sandbox configuration file (WSB extension)

To run the Sandbox with a custom configuration, simply double-click the WSB file.

Using WSB configuration files, you can create multiple sandbox configurations with different environments. For example, the following PowerShell script can be executed automatically when the sandbox starts. It installs the WinGet package manager, which is missing from the Sandbox container, as well as the specific apps that I need within my test Sandbox environment.

$SRCDir="C:\HostShare\Tools\WinGet"
Add-AppxPackage -Path $SRCDir\Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64.appx
Add-AppxPackage -Path $SRCDir\Microsoft.VCLibs.140.00_14.0.33519.0_x64.appx
Add-AppxPackage -Path $SRCDir\Microsoft.WindowsAppRuntime.1.8_8000.616.304.0_x64.appx
Add-AppxPackage -Path $SRCDir\winget.msixbundle -ForceApplicationShutdown
Start-Sleep -Seconds 5
'7zip.7zip', 'Telerik.Fiddler', 'PuTTY.PuTTY', 'Notepad++.Notepad++', 'FileZilla.FileZilla'| % {
winget install $_ --source winget --force --silent --accept-source-agreements --accept-package-agreements
}

The script first installs the WinGet APPX dependencies that were previously downloaded and saved to a local folder. You can download the WinGet dependency files from the official project page https://github.com/microsoft/winget-cli/releases/ -> Assets -> DesktopAppInstaller_Dependencies.zip.

Preparing WSB configuration file with the PowerShell logon script

You can also use winget configuration files to deploy a pre-configured Windows Sandbox environment. This can be achieved using the built-in WinGet DSC provider:

Microsoft.WindowsSandbox.DSC/WindowsSandbox

Find out how to use WinGet with Desired State Configuration (DSC) to deploy software and configure Windows settings automatically.

You can create multiple WSB configuration files to quickly provision required Sandbox environments with their own distinct settings and tool sets.

Managing Windows Sandbox via Command Line Interface

The wsb.exe (Windows Sandbox CLI) console command is available for managing the Sandbox starting with Windows 11 24H2. This command-line tool can be used in automation scripts and various other scenarios to start, stop, connect to, and configure a sandbox instance.

The following options are available:

  • start – start the Sandbox
  • list – get the ID of a running Windows Sandbox instance
  • exec – execute a command (script) within the running Sandbox environment
  • share – share a local folder between the host and the Windows Sandbox
  • stop – power off a running Sandbox instance
  • connect – connect to the Windows Sandbox environment by opening a console window
     Windows Command Line Interface (CLI) tool

To run a Windows Sandbox instance in the background with a custom configuration, specify the environment settings using the --c ( --config ) option. For example, in order to start the Sandbox container with 8 GB of RAM, run the command:

wsb start --config "<Configuration><MemoryInMB>8192</MemoryInMB></Configuration>"

You can connect to the Sandbox instance running in the background by its ID:

wsb list

wsb connect --id 6f446955-fba4-455f-af60-4da1c64f8b3b

wsb commands to start and connect sandbox

Run a command with SYSTEM privileges in the Sandbox environment:

wsb exec --id 6f446955-fba4-455f-af60-4da1c64f8b3b --run-as System --command 'sc stop wuauclt'

Exit code 0 means that the command has been successfully executed.

wsb exec - executing commands in Windows Sandbox

Map a local folder to the Sandbox environment with read-write access:

wsb share --id 6f446955-fba4-455f-af60-4da1c64f8b3b --host-path C:\Docs --sandbox-path C:\HOST\Docs --allow-write

This command transparently mounts a folder from the host Windows system into a directory inside the Sandbox.

Find out what IP address has been assigned to the SandboxL

wsb ip --id 6f446955-fba4-455f-af60-4da1c64f8b3b

How to Enable Sandbox in Windows 11 Home Edition

Although Windows Sandbox is not officially supported in Windows Home editions, you can enable this feature by running the following script:

dir /b %SystemRoot%\servicing\Packages\*Containers*.mum >sandbox_cont.txt
for /f %%i in ('findstr /i . sandbox_cont.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del sandbox_cont.txt
DISM /online /enable-feature /featurename:Containers-DisposableClientVM /LimitAccess /ALL
pause

However, it is not guaranteed that the Windows Sandbox feature will work when installed on the Home edition of Windows 11.

To remove the Sandbox, use the following PowerShell command:

Disable-WindowsOptionalFeature –FeatureName "Containers-DisposableClientVM" -Onlin

Thus, a configured Windows Sandbox environment can be used to safely test third-party software in an isolated context, rapidly deploy test configurations, and debug scripts and scenarios without impacting the host OS. In many scenarios, the Windows 11 Sandbox can be more convenient than deploying a separate virtual machine.

0 comment
0
Facebook Twitter Google + Pinterest
Questions and AnswersWindows 11
previous post
How to Extract Your Windows Product (License) Key from a Computer

Related Reading

How to Move (Migrate) Windows Shares to a...

February 26, 2026

How to Detect Which User Installed or Removed...

June 25, 2025

Security Warnings When Opening RDP Files in Windows...

April 20, 2026

Find a Process Causing High Disk Usage on...

July 16, 2025

Monitor Windows Log Files in Real Time with...

March 26, 2026

SMB over QUIC: Mount File Share over Internet...

December 24, 2025

Automate Software and Settings Deployment with WinGet Configure...

November 20, 2025

Windows Stucks at ‘Getting Windows Ready, Don’t Turn...

September 24, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • How to Monitor Windows Machines with Zabbix

    May 26, 2026
  • Fixing Duplicate Security Identifier (SID) Issues in Windows

    May 25, 2026
  • Monitor a Folder for File Changes Using PowerShell and FileSystemWatcher

    May 15, 2026
  • Protect Windows Server from DDoS and Brute-Force Attacks with IPBan

    May 12, 2026
  • How to Force Uninstall ANY Stubborn Program in Windows

    May 7, 2026
  • How to Safely Disable IPv6 on Windows

    April 30, 2026
  • Updating UEFI Secure Boot Certificates on Windows Devices Explained

    April 20, 2026
  • Security Warnings When Opening RDP Files in Windows 11

    April 17, 2026
  • Find Computers with Pending Reboot Status Using PowerShell

    April 15, 2026
  • Mounting NFS Shares in Windows Using the Built-in Client

    March 26, 2026

Follow us

  • Facebook
  • Twitter
  • Youtube
  • Telegram
Popular Posts
  • Converting Windows 10 to Enterprise LTSC Without Losing Data
  • How to Remove ‘Some Settings are Managed by Your Organization’ on Windows 11 or 10
  • Remove the Max Path Length Limit (260-Characters) on Windows
  • Installing Windows without USB/DVD or Other External Drives
  • How to Pause (Delay) Update Installation on Windows 11 and 10
  • How to Cancel Windows Update Pending Restart Loop
  • VMware Workstation: Slow VMs Performance on Windows
Footer Logo

@2014 - 2026 - Windows OS Hub. All about operating systems for sysadmins


Back To Top