Can’t install Windows Sandbox on Windows 10
Windows Sandbox is a great little completely isolated environment in which to test out software you’re not sure is safe or for experiments that might corrupt your environment/installations. It pops up a virtual machine running Windows 10/11, is completely isolated, and then deletes everything when shut down.
However, it’s not always easy to get started. Even after installing the latest Windows 10 updates and turning all on virtualization features in bios, I still could not see the Windows Sandbox feature in the Turn Windows Features On and Off program.
It turns out you may need to do some extra setup, and the entire process is here in tenforums. They have a script (below) that helps, but there may even be other steps to follow and they’re all outlined on the post.
@echo off
echo Checking for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
echo Permission check result: %errorlevel%
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
echo Running created temporary "%temp%\getadmin.vbs"
timeout /T 2
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
echo Batch was successfully started with admin privileges
echo .
cls
Title Sandbox Installer
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Containers*.mum >sandbox.txt
for /f %%i in ('findstr /i . sandbox.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del sandbox.txt
Dism /online /enable-feature /featurename:Containers-DisposableClientVM /LimitAccess /ALL
pause
adf