Windows Sandbox: Safest Way to Test Unknown Files?
In this article
Yes, Windows Sandbox is one of the safest ways to test unknown files on Windows 10 and 11, and it does completely delete itself—every trace of the session, including the file you ran, is wiped when you close it. This makes it an excellent tool for safely opening suspicious downloads or testing software you don't fully trust, but it's not a foolproof security solution and has some important limitations you should understand before relying on it.
What Is Windows Sandbox?
Windows Sandbox is a lightweight, built-in virtual machine feature in Windows 10 Pro, Enterprise, and Education editions (and Windows 11 Pro/Enterprise). It creates a temporary, isolated desktop environment that runs a fresh copy of Windows, separate from your host system. When you open a file or install a program inside the Sandbox, it operates in that isolated space—it can't access your main files, folders, or network unless you explicitly allow it.
The key selling point is its ephemeral nature: every time you launch Windows Sandbox, you get a pristine, clean Windows instance. When you close it, the entire virtual environment is discarded, including any malware, changes to system settings, or files you placed inside. No remnants remain on your host machine.
How Windows Sandbox Works
Windows Sandbox uses hardware-based virtualization through Hyper-V, the same technology that powers Windows' more full-featured virtual machine platform. Here's a simplified breakdown of the process:
- Isolation: The Sandbox runs in its own isolated kernel, separate from your host OS. It has its own memory, processes, and virtual disk.
- Snapshot-based reset: When you start Sandbox, it creates a fresh instance from a base image. Any changes you make (installing software, creating files, running malware) are written to a temporary overlay disk.
- Complete teardown: When you close the Sandbox window, Windows discards the entire overlay disk and all associated memory. The next launch starts from the same clean base image again.
This design means that even if a virus or ransomware infects the Sandbox, it cannot escape to your host system because the virtual machine has no access to your actual drives, and the network is isolated by default (though you can enable networking if needed).
How to Enable and Use Windows Sandbox
Windows Sandbox isn't enabled by default—you need to turn it on first. Here's how:
- Press Windows Key + R, type
optionalfeatures.exe, and press Enter. - Scroll down to Windows Sandbox, check the box, and click OK.
- Restart your computer when prompted.
- After restart, search for "Windows Sandbox" in the Start menu and launch it.
Once the Sandbox window opens (it looks like a clean Windows desktop), you can drag and drop any file into it or copy-paste it. Run the file inside the Sandbox, observe its behavior, and when you're done, simply close the Sandbox window. Windows will ask for confirmation—click OK, and everything is gone.
Limitations and Common Problems
While Windows Sandbox is powerful, it has several limitations you should know:
- Not available on Windows Home: You need Pro, Enterprise, or Education edition. Home users can't use it without upgrading.
- Requires virtualization support: Your CPU must support virtualization (VT-x/AMD-V) and it must be enabled in BIOS/UEFI. Many older or budget machines lack this.
- No persistence: Anything you save inside the Sandbox is lost when you close it. That's by design, but it means you can't use it for long-term testing or keep results.
- Network isolation by default: The Sandbox has no internet access unless you enable networking (which you can do in the Sandbox's settings). This is good for safety but limits testing of online-dependent software.
- Performance overhead: Running a full virtual machine consumes RAM and CPU. Microsoft recommends at least 8GB of RAM (4GB minimum) and 1GB of free disk space.
A common misconception is that Windows Sandbox is a full antivirus replacement. It's not—it's a tool for testing unknown files, not for scanning your system. If you suspect a file is malicious, running it in Sandbox can show you what it does, but it won't detect or remove malware from your main system.
Windows Sandbox vs. Third-Party Virtual Machines
Windows Sandbox competes with tools like VirtualBox, VMware Workstation Player, and Hyper-V Manager. Here's a quick comparison:
- Windows Sandbox: Free, built-in, extremely fast to start (usually under 10 seconds), and automatically resets. Best for quick tests of a single file.
- VirtualBox/VMware: Free (for personal use), more configurable, can create persistent VMs, supports snapshots, and works on Windows Home. However, they require manual setup, more disk space, and take longer to boot.
- Hyper-V Manager: More powerful, but complex and not intended for casual file testing.
For most users who just want to safely open a suspicious attachment or test a downloaded installer, Windows Sandbox is the easiest and fastest option. For developers or advanced users who need a persistent test environment, traditional VMs are better.
Safety Considerations and Best Practices
Even with Windows Sandbox, you should follow these safety practices:
- Disable networking by default: Keep network access off unless you absolutely need it. This prevents malware from communicating with command-and-control servers.
- Don't share files back to the host: If you copy a file from the Sandbox back to your main system, you could bring malware with you. Only copy files you're confident are clean.
- Use it for analysis, not just execution: Watch what the file does—check for registry changes, network connections, or unusual processes. Tools like Process Monitor (from Sysinternals) can be run inside the Sandbox for deeper analysis.
- Keep Windows updated: Sandbox relies on the host's security features. Regular updates patch vulnerabilities in both the host and the virtualized environment.
Remember that no sandbox is 100% secure. Sophisticated malware designed to escape virtual machines exists, though it's rare and typically used by nation-state actors. For most home users, Windows Sandbox provides a very high level of safety.
Frequently Asked Questions
Does Windows Sandbox delete itself automatically?
Yes, when you close the Windows Sandbox window, the entire virtual environment is discarded. All files, installed programs, and settings are permanently deleted. There's no way to recover anything from a closed session.
Can I use Windows Sandbox on Windows Home?
No, Windows Sandbox is only available on Windows Pro, Enterprise, and Education editions. Home users can either upgrade their edition or use a third-party virtual machine like VirtualBox.
Is Windows Sandbox safe for testing ransomware?
Generally yes, because the Sandbox is isolated from your host system. However, ransomware that attempts to encrypt network drives could affect other computers on your network if networking is enabled. Always disable networking when testing potentially destructive software.
What happens if malware in the Sandbox tries to access my files?
It can't. The Sandbox has no access to your host file system. By default, it only sees its own virtual disk. Files are only transferred when you explicitly drag-and-drop them into the Sandbox window.
How much RAM does Windows Sandbox need?
Microsoft recommends at least 8GB of RAM total, with 4GB being the minimum. The Sandbox itself uses about 1-2GB of RAM. If you have less than 4GB, the Sandbox may not start or may be very slow.
Can I run Windows Sandbox alongside other virtual machines?
Yes, but you need enough system resources. Windows Sandbox uses Hyper-V, which can conflict with other hypervisors like VirtualBox if they're not configured correctly. In practice, you may need to disable one or the other to avoid performance issues.