Testing Software Installation with Windows Sandbox
What This Guide Is About
This guide shows you how to safely test software installations using Windows Sandbox - a feature that creates a temporary, isolated copy of Windows on your computer. Think of it as a practice area where you can install programs without affecting your main system.
We'll be using a tool called Winget (Windows Package Manager) to automatically install multiple programs simultaneously, which is significantly faster than downloading and installing each program individually.
Important Notes Before Starting
Different versions of Windows behave differently with Sandbox. If something doesn't work as described, it might be due to your Windows version.
Windows 11 24H2 users: You'll need to add --source winget
to the commands because the Microsoft Store isn't accessible in Sandbox. This means you can't install apps that are only available through the Store.
Step 1: Enable Windows Sandbox
- Press the Windows key
- Type "features"
- Click "Turn Windows features on or off"
- Check the box next to "Windows Sandbox"
- Restart your computer when prompted
Helpful tip: You can copy and paste text between Sandbox and your main computer, but you can't drag and drop files.
Step 2: Create the Necessary Folders
Open Command Prompt and create these folders on your main computer:
mkdir C:\Sandbox
mkdir C:\Sandbox\winget_install
The C:\Sandbox
folder will be shared with your Sandbox environment, and winget_install
will contain the installation files.
Step 3: Download Required Files
You'll need to download three files from the Microsoft Winget GitHub page:
* 1 & 2 are a single zip file. Open the 64 folder and extract the two files.
- Microsoft.VCLibs file (a dependency)
- Microsoft.UI.Xaml file (a dependency)
- Microsoft.DesktopAppInstaller file (the main Winget installer)
Place all three files in your C:\Sandbox\winget_install
folder.
Step 4: Create Configuration Files
Basic Sandbox Configuration
Create a file called Sandbox.wsb
with this content:
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Sandbox</HostFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
</Configuration>
This tells Sandbox to share your C:\Sandbox folder.
Advanced Configuration (Auto-Install)
For automatic installation when Sandbox starts, use this version instead:
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Sandbox</HostFolder>
<SandboxFolder>C:\Users\WDAGUtilityAccount\Desktop\Sandbox</SandboxFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>powershell.exe -ExecutionPolicy Bypass -NoExit -File "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\install.ps1"</Command>
</LogonCommand>
</Configuration>
This automatically runs the installation script when Sandbox starts.
Step 5: Create Installation Scripts
install.cmd (Simple Launcher)
Create install.cmd
in your C:\Sandbox\winget_install
folder:
powershell.exe -ExecutionPolicy Bypass -File install.ps1
install.ps1 (Main Installation Script)
Create install.ps1
in your C:\Sandbox\winget_install
folder:
# Install required dependencies
Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64.appx"Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.UI.Xaml.2.8_8.2310.30001.0_x64.appx"Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
# Wait for winget to be ready
Start-Sleep -Seconds 10
# Remove Microsoft Store source to avoid errors
winget source remove msstore
# Install programs
This guide shows you how to safely test software installations using Windows Sandbox - a feature that creates a temporary, isolated copy of Windows on your computer. Think of it as a practice area where you can install programs without affecting your main system.
We'll be using a tool called Winget (Windows Package Manager) to automatically install multiple programs simultaneously, which is significantly faster than downloading and installing each program individually.
Important Notes Before Starting
Different versions of Windows behave differently with Sandbox. If something doesn't work as described, it might be due to your Windows version.
Windows 11 24H2 users: You'll need to add --source winget
to the commands because the Microsoft Store isn't accessible in Sandbox. This means you can't install apps that are only available through the Store.
Step 1: Enable Windows Sandbox
- Press the Windows key
- Type "features"
- Click "Turn Windows features on or off"
- Check the box next to "Windows Sandbox"
- Restart your computer when prompted
Helpful tip: You can copy and paste text between Sandbox and your main computer, but you can't drag and drop files.
Step 2: Create the Necessary Folders
Open Command Prompt and create these folders on your main computer:
mkdir C:\Sandbox
mkdir C:\Sandbox\winget_install
The C:\Sandbox
folder will be shared with your Sandbox environment, and winget_install
will contain the installation files.
Step 3: Download Required Files
You'll need to download three files from the Microsoft Winget GitHub page:
* 1 & 2 are a single zip file. Open the 64 folder and extract the two files.
- Microsoft.VCLibs file (a dependency)
- Microsoft.UI.Xaml file (a dependency)
- Microsoft.DesktopAppInstaller file (the main Winget installer)
Place all three files in your C:\Sandbox\winget_install
folder.
Step 4: Create Configuration Files
Basic Sandbox Configuration
Create a file called Sandbox.wsb
with this content:
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Sandbox</HostFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
</Configuration>
This tells Sandbox to share your C:\Sandbox folder.
Advanced Configuration (Auto-Install)
For automatic installation when Sandbox starts, use this version instead:
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Sandbox</HostFolder>
<SandboxFolder>C:\Users\WDAGUtilityAccount\Desktop\Sandbox</SandboxFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>powershell.exe -ExecutionPolicy Bypass -NoExit -File "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\install.ps1"</Command>
</LogonCommand>
</Configuration>
This automatically runs the installation script when Sandbox starts.
Step 5: Create Installation Scripts
install.cmd (Simple Launcher)
Create install.cmd
in your C:\Sandbox\winget_install
folder:
powershell.exe -ExecutionPolicy Bypass -File install.ps1
install.ps1 (Main Installation Script)
Create install.ps1
in your C:\Sandbox\winget_install
folder:
# Install required dependencies
Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64.appx"Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.UI.Xaml.2.8_8.2310.30001.0_x64.appx"Add-AppxPackage "C:\Users\WDAGUtilityAccount\Desktop\Sandbox\winget_install\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
# Wait for winget to be ready
Start-Sleep -Seconds 10
# Remove Microsoft Store source to avoid errors
winget source remove msstore
# Install programs
What This Does
When you run the Sandbox with these configurations:
- Creates a safe testing environment - Nothing you do in Sandbox affects your main computer
- Automatically installs Winget - Sets up the package manager in the isolated environment
- Tests software installation - Installs Notepad++ and 7-Zip as examples
- Validates your setup - If programs install successfully in Sandbox, they should work on your real computer
Why This Is Useful
- Safety first - Test potentially problematic software without risk
- Batch testing - Try installing multiple programs at once
- Clean environment - Start fresh each time without leftover files
- Time saving - Automate repetitive installation tasks
Getting Started
- Enable Windows Sandbox
- Create the folder structure
- Download the required files
- Create the configuration and script files
- Double-click your
Sandbox.wsb
file to start
Your Sandbox will open and automatically begin installing the test programs. If everything works, you should be able to continue testing and manipulating other software and scripts.