The Windows Sandbox can be useful, but since it was never there in the first decades of my Windows usage, I forgot it was added.
I wonder how it is implemented, as it is really useful to test out new stuff, but I wonder what it protects against.
A few years back, I bumped into this because the [WayBack] Desktop Goose by samperson got viral (it can be downloaded from [WayBack/Archive.is] Desktop Goose v0.2.zip)
via [Archive.is] Samperson on Twitter: “I made a goose that destroys your computer Download it free here: samperson.itch.io/desktop-goose” / Twitter
So here are some links (you need at least build 1903 ([WayBack] Windows 10 May 2019 or 19H1) or Insider Preview Build 18305):
- [Archive.is] Jen Gentleman 🌺 on Twitter: “Thank you, Windows Sandbox, for enabling me to play with this ridiculous desktop destroying goose in an isolated container 😂 https://t.co/EPqM1FROg3” / Twitter
- [WayBack] Jen Gentleman 🌺 on Twitter: “If you’re not familiar with Windows Sandbox, it’s something we shipped with Windows 10 version 1903 😊👉 …” / Twitter
- [WayBack] Windows Sandbox – Microsoft Tech Community – 301849
- Sandbox in [WayBack] Announcing Windows 10 Insider Preview Build 18305 | Windows Experience Blog
Windows Sandbox has the following properties:
- Part of Windows – everything required for this feature ships with Windows 10 Pro and Enterprise. No need to download a VHD!
- Pristine – every time Windows Sandbox runs, it’s as clean as a brand-new installation of Windows
- Disposable – nothing persists on the device; everything is discarded after you close the application
- Secure – uses hardware-based virtualization for kernel isolation, which relies on the Microsoft Hypervisor to run a separate kernel which isolates Windows Sandbox from the host
- Efficient – uses integrated kernel scheduler, smart memory management, and virtual GPU
To install Windows Sandbox, go to Settings > Apps > Apps & Features > Programs and Features > Turn Windows Features on or off, and then select Enable Windows Sandbox.
To start Windows Sandbox, open the Start menu, enter Windows Sandbox and then select it.
You can install it even if your Windows machine itself is a VM. For a physical machine, hardware virtualisation needs to be enabled (usually in the BIOS); for a VM, nested virtualisation enabled (check that in your virtualisation environment: Hyper-V, ESXi and others vary slightly on how to enable this).
Installation inside the Windows machine can be done via PowerShell (or the UI):
- [WayBack] Enable Windows 10 Sandbox with PowerShell and Dism
-
To Enable Windows 10 Sandbox with PowerShell,
- Open PowerShell as Administrator.Tip: You can add “Open PowerShell As Administrator” context menu.
- Type or copy-paste the following command:
Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -All -Online
- When prompted to restart the computer, type Y, and press Enter.
- The change can be undone with the following command:
Disable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -Online
You are done.
-
Enable Windows 10 Sandbox with DISM
- Open an elevated command prompt.
- Type or copy-paste the following command:
dism /online /Enable-Feature /FeatureName:"Containers-DisposableClientVM" -All
- Restart the computer when prompted.
- To disable the Sandbox feature, use this command:
dism /online /Disable-Feature /FeatureName:"Containers-DisposableClientVM"
That’s it.
-
- These two also discussies WSB configuration files (which can passed as first parameter to
C:\WINDOWS\System32\WindowsSandbox.exe "%1"
):
Note that starting the SandBox from an x86 process might require you to run a different WindowsSandBox.exe
; see [WayBack] Launching Wsb (Windows Sandbox Config file) gives error – Total Commander:
you can use
C:\WINDOWS\Sysnative\WindowsSandbox.exe
in stead ofC:\WINDOWS\System32\WindowsSandbox.exe
in TC 32bit.Also see:
[WayBack] On 64-bit Windows versions, some files and folders shown by Windows Explorer are not shown by Total Commander![WayBack] Windows x64: Explorer vs TC: Content of System32 different
–jeroen