[{"data":1,"prerenderedAt":451},["ShallowReactive",2],{"en-post-174":3},{"id":4,"title":5,"body":6,"description":443,"extension":444,"meta":445,"navigation":446,"path":447,"seo":448,"stem":449,"__hash__":450},"content/post/174.md","174",{"type":7,"value":8,"toc":433},"minimark",[9,24,29,35,51,57,61,64,84,92,96,99,116,119,123,126,137,140,195,199,202,237,264,359,363,369,372,377,380,385,394,399,407,411,414,420,424,429],[10,11,12,13,17,18,23],"p",{},"Opening Windows Sandbox by hand each time means reinstalling software and resetting the network, only to lose it all when you close it. Testing the same thing over and over gets tedious. A ",[14,15,16],"code",{},".wsb"," config file starts a sandbox built to your settings in one double click, then wipes it on close so the next run is clean again. This guide picks up from ",[19,20,22],"a",{"href":21},"/post/45/","Run Virtual Machines on Windows"," and covers the config syntax, isolation tests, and the errors that come up.",[25,26,28],"h2",{"id":27},"what-is-a-wsb-file","What Is a .wsb File",[10,30,31,32,34],{},"A ",[14,33,16],{}," file is an XML configuration for Windows Sandbox. Double click it and a sandbox built to your settings starts. It is a startup sheet that spells out the graphics, network, memory, mapped folders, and the command to run after sign-in.",[36,37,38,42,48],"ul",{},[39,40,41],"li",{},"Start with no config and you get the default sandbox, fresh each time, fine for a quick look.",[39,43,44,45,47],{},"Write a ",[14,46,16],{}," and you have saved a fixed environment as a file, ready to reuse without rebuilding it.",[39,49,50],{},"Close the sandbox and every change is destroyed, leaving no trace on the host, so trying risky things is safe.",[10,52,53,54,56],{},"Create a text file, change the suffix to ",[14,55,16],{},", and edit it in Notepad. No extra tools are needed; right click the file and choose Open with Windows Sandbox to launch it.",[25,58,60],{"id":59},"what-it-does","What It Does",[10,62,63],{},"The config can set a lot, but a handful of options cover most jobs.",[36,65,66,69,72,75,78,81],{},[39,67,68],{},"Graphics virtualisation. Turn it off for old or faulty graphics drivers, and compatibility often improves.",[39,70,71],{},"Network switch. Set it to offline for isolation tests so a sample cannot phone home.",[39,73,74],{},"Memory cap. Bound the sandbox so it cannot starve the host of RAM.",[39,76,77],{},"Folder mapping. Hang a host directory inside the sandbox, optionally read-only.",[39,79,80],{},"Logon command. Automatically install software or open a folder after the desktop appears.",[39,82,83],{},"Whether the microphone, camera, and clipboard pass through, switched off as privacy needs.",[10,85,86,87,91],{},"Combine these and the sandbox becomes a clean testing chamber for checking files and trying installers. For a Linux environment you want to keep between sessions, that is a job for ",[19,88,90],{"href":89},"/post/46/","Install and Set Up WSL2"," instead.",[25,93,95],{"id":94},"when-to-use","When to Use",[10,97,98],{},"These are the jobs it fits best.",[36,100,101,104,107,110,113],{},[39,102,103],{},"You downloaded a questionable installer and want to see what it changes before putting it on the host.",[39,105,106],{},"A document or archive arrived and you want to scan it first, then copy it back if it is safe.",[39,108,109],{},"You are testing whether a program runs offline or tries to connect out.",[39,111,112],{},"You need to demo or test the same thing repeatedly from a clean start.",[39,114,115],{},"You want to cap memory for a heavy task so the sandbox does not slow the host.",[10,117,118],{},"For a quick look that you will throw away, nothing beats the sandbox.",[25,120,122],{"id":121},"before-you-start","Before You Start",[10,124,125],{},"Confirm three things first and save a detour.",[36,127,128,131,134],{},[39,129,130],{},"The system is Pro or Enterprise. Home does not include Sandbox.",[39,132,133],{},"Virtualisation is on in the BIOS, either VT-x or AMD-V.",[39,135,136],{},"The host folder you will map is ready, with a path free of Chinese characters and spaces.",[10,138,139],{},"The mechanism is the same on Windows 10 and Windows 11.",[141,142,143,159],"table",{},[144,145,146],"thead",{},[147,148,149,153,156],"tr",{},[150,151,152],"th",{},"Item",[150,154,155],{},"Windows 10",[150,157,158],{},"Windows 11",[160,161,162,174,184],"tbody",{},[147,163,164,168,171],{},[165,166,167],"td",{},"Built-in Sandbox",[165,169,170],{},"Pro and above",[165,172,173],{},"Same",[147,175,176,179,182],{},[165,177,178],{},"Virtualisation",[165,180,181],{},"BIOS VT-x / AMD-V",[165,183,173],{},[147,185,186,189,193],{},[165,187,188],{},"Config suffix",[165,190,191],{},[14,192,16],{},[165,194,173],{},[25,196,198],{"id":197},"step-by-step","Step-by-Step",[10,200,201],{},"Build a sandbox that opens your test package automatically.",[203,204,205,212,219,225,228,231],"ol",{},[39,206,207,208,211],{},"Create a text file, paste the template at the end, save it as ",[14,209,210],{},"test.wsb"," with UTF-8 encoding.",[39,213,214,215,218],{},"Put the installer you want to check in the host folder ",[14,216,217],{},"C:\\Temp\\test",", matching the path in the config.",[39,220,221,222,224],{},"Right click ",[14,223,210],{},", choose Open with, and pick Windows Sandbox. It starts to your settings.",[39,226,227],{},"At the desktop, the mapped folder appears and opens on its own; run the installer inside it.",[39,229,230],{},"When you are done, close the sandbox window. Every change is destroyed and the host is untouched.",[39,232,233,234,236],{},"To reuse it, double click the same ",[14,235,16],{}," and you have a clean set again, with nothing to rebuild.",[10,238,239,240,243,244,247,248,251,252,255,256,259,260,263],{},"In the template, ",[14,241,242],{},"VGpu"," and ",[14,245,246],{},"Networking"," are ",[14,249,250],{},"Disable"," for compatibility and isolation, ",[14,253,254],{},"MappedFolders"," mounts the host directory read-only, ",[14,257,258],{},"LogonCommand"," opens it, and ",[14,261,262],{},"MemoryInMB"," caps the RAM. Each switch works on its own, so get this template running first, then change one option at a time.",[265,266,271],"pre",{"className":267,"code":268,"language":269,"meta":270,"style":270},"language-xml shiki shiki-themes github-light github-dark","\u003CConfiguration>\n  \u003CVGpu>Disable\u003C/VGpu>\n  \u003CNetworking>Disable\u003C/Networking>\n  \u003CMemoryInMB>4096\u003C/MemoryInMB>\n  \u003CMappedFolders>\n    \u003CMappedFolder>\n      \u003CHostFolder>C:\\Temp\\test\u003C/HostFolder>\n      \u003CReadOnly>true\u003C/ReadOnly>\n    \u003C/MappedFolder>\n  \u003C/MappedFolders>\n  \u003CLogonCommand>\n    \u003CCommand>explorer.exe C:\\Users\\WDAGUtilityAccount\\Desktop\\test\u003C/Command>\n  \u003C/LogonCommand>\n\u003C/Configuration>\n","xml","",[14,272,273,281,287,293,299,305,311,317,323,329,335,341,347,353],{"__ignoreMap":270},[274,275,278],"span",{"class":276,"line":277},"line",1,[274,279,280],{},"\u003CConfiguration>\n",[274,282,284],{"class":276,"line":283},2,[274,285,286],{},"  \u003CVGpu>Disable\u003C/VGpu>\n",[274,288,290],{"class":276,"line":289},3,[274,291,292],{},"  \u003CNetworking>Disable\u003C/Networking>\n",[274,294,296],{"class":276,"line":295},4,[274,297,298],{},"  \u003CMemoryInMB>4096\u003C/MemoryInMB>\n",[274,300,302],{"class":276,"line":301},5,[274,303,304],{},"  \u003CMappedFolders>\n",[274,306,308],{"class":276,"line":307},6,[274,309,310],{},"    \u003CMappedFolder>\n",[274,312,314],{"class":276,"line":313},7,[274,315,316],{},"      \u003CHostFolder>C:\\Temp\\test\u003C/HostFolder>\n",[274,318,320],{"class":276,"line":319},8,[274,321,322],{},"      \u003CReadOnly>true\u003C/ReadOnly>\n",[274,324,326],{"class":276,"line":325},9,[274,327,328],{},"    \u003C/MappedFolder>\n",[274,330,332],{"class":276,"line":331},10,[274,333,334],{},"  \u003C/MappedFolders>\n",[274,336,338],{"class":276,"line":337},11,[274,339,340],{},"  \u003CLogonCommand>\n",[274,342,344],{"class":276,"line":343},12,[274,345,346],{},"    \u003CCommand>explorer.exe C:\\Users\\WDAGUtilityAccount\\Desktop\\test\u003C/Command>\n",[274,348,350],{"class":276,"line":349},13,[274,351,352],{},"  \u003C/LogonCommand>\n",[274,354,356],{"class":276,"line":355},14,[274,357,358],{},"\u003C/Configuration>\n",[25,360,362],{"id":361},"faq","FAQ",[10,364,365],{},[366,367,368],"strong",{},"Double clicking the .wsb does nothing or errors",[10,370,371],{},"Usually the BIOS has virtualisation off, or Hyper-V is not enabled. Tick Hyper-V and Virtual Machine Platform under Windows features, then restart.",[10,373,374],{},[366,375,376],{},"The mapped folder will not open or reports no permission",[10,378,379],{},"The host directory has tight permissions. Move it to a more open path, or right click the folder and add yourself under Security with read access.",[10,381,382],{},[366,383,384],{},"The sandbox is slow to start or goes black",[10,386,387,388,390,391,393],{},"Try setting ",[14,389,242],{}," to ",[14,392,250],{},"; it is usually a clash between the graphics driver and the sandbox.",[10,395,396],{},[366,397,398],{},"Home edition wants to use it",[10,400,401,402,406],{},"Home has no built-in Sandbox. Use a light virtual machine from VirtualBox or VMware instead, or see ",[19,403,405],{"href":404},"/post/172/","How to Choose Windows Home or Pro"," to upgrade to Pro when that makes sense for your work.",[25,408,410],{"id":409},"how-it-works","How It Works",[10,412,413],{},"Sandbox is a disposable, lightweight environment. It pulls a clean image from the system at launch, and every write lands in that session only, so closing it throws the whole thing away.",[10,415,416,417,419],{},"The ",[14,418,16],{}," is a parameter sheet read before startup, and each switch decides what that environment looks like. Graphics and memory are allocations of virtual hardware; a mapped folder is an entry point for hanging a host directory inside, and the read-only flag stops the sandbox writing back to the host. See that and it is clear the sandbox was never meant to keep state. For a system you want to keep, use Hyper-V or a full virtual machine instead.",[25,421,423],{"id":422},"conclusion","Conclusion",[10,425,31,426,428],{},[14,427,16],{}," turns rebuilding an environment by hand into a double click. Graphics, network, memory, mapped folders, and the logon command all go in the file; close it and everything clears, so the next run is clean again. For isolation checks and trying installers it is far lighter than a full VM, and if you need to keep state, a virtual machine is the right tool. Save the template, run it once, then change the switches you need.",[430,431,432],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":270,"searchDepth":283,"depth":283,"links":434},[435,436,437,438,439,440,441,442],{"id":27,"depth":283,"text":28},{"id":59,"depth":283,"text":60},{"id":94,"depth":283,"text":95},{"id":121,"depth":283,"text":122},{"id":197,"depth":283,"text":198},{"id":361,"depth":283,"text":362},{"id":409,"depth":283,"text":410},{"id":422,"depth":283,"text":423},"Opening Windows Sandbox by hand each time means reinstalling software and resetting the network, only to lose it all when you close it. Testing the same thing over and over gets tedious. A .wsb config file starts a sandbox built to your settings in one double click, then wipes it on close so the next run is clean again. This guide picks up from Run Virtual Machines on Windows and covers the config syntax, isolation tests, and the errors that come up.","md",{},true,"/post/174",{"description":443},"post/174","5av9heSDtEFl19repbjcnlcfv3JxqiewzES9voUvTeQ",1794378305192]