Test Malicious Files in Windows 10 Sandbox
In this article
Yes, you can safely test potentially malicious files or untrusted software using Windows 10 Sandbox, a built-in lightweight virtual machine that isolates programs from your main system. It provides a disposable, temporary desktop environment where you can run suspicious executables, open attachments, or install unknown apps without risking your host OS. This article explains exactly how to use it, what its limits are, and how to get the most protection from it.
What Is Windows Sandbox?
Windows Sandbox is a feature included in Windows 10 Pro, Enterprise, and Education editions (version 1903 and later). It creates a fresh, isolated desktop session that runs in a hypervisor-based virtual machine. Each time you open it, you get a clean Windows environment with no persistence: anything you do inside is discarded when you close it. It uses the same kernel as your host but with separate memory and disk space, so malware that runs inside cannot directly access your real files, registry, or network (unless you configure networking).
It is not a separate download; it is an optional Windows feature you enable through the Control Panel or PowerShell. Once enabled, you launch it from the Start menu like any app. The sandbox is fast because it uses the host's memory and CPU directly, without the overhead of a full hypervisor like VirtualBox or VMware.
How to Enable and Launch Windows Sandbox
Before you can use it, your system must meet these requirements:
- Windows 10 Pro, Enterprise, or Education (not Home edition).
- Virtualization enabled in BIOS/UEFI (VT-x for Intel, AMD-V for AMD).
- At least 4 GB of RAM (8 GB recommended).
- At least 1 GB of free disk space.
To enable it, follow these steps:
- Open Control Panel → Programs → Turn Windows features on or off.
- Check the box for Windows Sandbox and click OK.
- Restart your computer when prompted.
- After reboot, type "Windows Sandbox" in the Start menu and launch it.
If the option is grayed out, your CPU may not support virtualization or it is disabled in BIOS. You can check by opening Task Manager → Performance → CPU → Virtualization: it should say "Enabled."
How to Test a Suspicious File Inside the Sandbox
Once the sandbox is running, you have a few ways to bring the file in:
- Copy and paste: Copy the file from your host (Ctrl+C) and paste it into the sandbox (Ctrl+V). This works for small files.
- Drag and drop: Drag the file from your host's Explorer into the sandbox window. This also works, but be careful not to drag it onto a host window by mistake.
- Share a folder: For larger files or many files, you can configure a shared folder in the sandbox's settings file (a .wsb file). This is more advanced but useful for testing a whole directory.
After the file is inside, run it normally. Because the sandbox is isolated, any changes it makes (files, registry, services) are temporary and vanish when you close the sandbox. You can safely observe its behavior, check for network connections, or see what files it creates.
What Windows Sandbox Does NOT Protect Against
While Windows Sandbox is a strong isolation tool, it is not a perfect security solution. Be aware of these limitations:
- Network access: By default, the sandbox has network access. Malware could spread to other devices on your local network or contact a command-and-control server. You can disable networking via a .wsb configuration file (set
NetworkingtoDisable). - Host file system: The sandbox cannot directly access your host files, but if you share a folder, malware inside could read or modify those files. Never share your entire C: drive.
- Kernel exploits: If the malware exploits a vulnerability in Windows itself, it could potentially break out of the sandbox. This is extremely rare but not impossible.
- Persistence: The sandbox resets every time, so malware that tries to survive a reboot is defeated, but it also means you cannot test scenarios that require a reboot.
How to Configure a More Secure Sandbox
You can customize the sandbox by creating a .wsb configuration file. This is a simple XML file that you can edit with Notepad. For example, to disable networking and shared folders, create a file named secure.wsb with:
<Configuration> <Networking>Disable</Networking> <MappedFolders></MappedFolders> </Configuration>
Then double-click the file to launch the sandbox with those settings. You can also set MemoryInMB to limit RAM, or LogonCommand to run a script automatically. This is useful for testing malware that requires specific network conditions or for ensuring no data leaks.
Alternatives to Windows Sandbox
If you are on Windows 10 Home, or if you need more advanced features, consider these alternatives:
- VirtualBox or VMware Workstation Player: Full virtual machines that let you install any OS, snapshot states, and use virtual networks. They are heavier but more flexible.
- Sandboxie: A third-party application that runs programs in a sandboxed environment on your existing Windows, without a full VM. It is now open-source (after being acquired by Sophos and later released).
- Windows Defender Application Guard: For Edge browser, it isolates untrusted websites in a container.
- Third-party online malware scanners: Services like VirusTotal let you upload a file and scan it with many engines without executing it locally.
Common Problems and Troubleshooting
If Windows Sandbox fails to start, here are common causes and fixes:
- Virtualization disabled: Enable VT-x/AMD-V in BIOS. Check Task Manager to confirm.
- Insufficient RAM: Close other programs or add more RAM. The sandbox needs at least 4 GB free.
- Windows version: Ensure you have Windows 10 Pro/Enterprise/Education, not Home.
- Corrupted installation: Disable and re-enable the feature, or run
sfc /scannowin an elevated command prompt. - Hyper-V not enabled: Windows Sandbox requires Hyper-V. If you have disabled it for other reasons, re-enable it.
Frequently Asked Questions
Is Windows Sandbox safe for testing ransomware?
Yes, but with caution. Ransomware inside the sandbox cannot encrypt your real files, but it could encrypt the sandbox's virtual disk, which is fine because it resets. However, if you have shared folders, it could encrypt those. Always disable networking and shared folders when testing ransomware.
Can I test 64-bit malware in Windows Sandbox?
Yes, Windows Sandbox runs a 64-bit version of Windows (if your host is 64-bit), so it can run both 32-bit and 64-bit executables.
Does Windows Sandbox protect against keyloggers?
Yes, a keylogger running inside the sandbox will only capture keystrokes made inside the sandbox, not on your host. However, if you type your passwords in the sandbox, they could be captured.
How do I transfer a file from the sandbox to my host?
You can copy-paste or drag-and-drop files from the sandbox to the host, just like the other way. This is useful if you want to save a sample or a log file.
Can I use Windows Sandbox on Windows 11?
Yes, Windows 11 also includes Windows Sandbox, with the same requirements and functionality. The steps are nearly identical.
Is Windows Sandbox free?
Yes, it is a built-in feature of Windows 10 Pro, Enterprise, and Education. There is no extra cost.