Windows Sandbox • ScoopBox • Boxer • Documentation • Download • Contribute
Technically Windows Sandbox is a lightweight virtual machine created on demand which a user can safely run applications in isolation. This virtual machine is using the same OS image as in the host machine. Software installed inside the Windows Sandbox environment remains "sandboxed" and runs separately from the base machine.
Windows sandbox should be enabled before first use. Check how here.
ScoopBox is a C# library that helps you launch the Windows Sandbox with preinstalled applications using package managers Scoop and Chocolate.
You can find more information about Windows Sandbox and ScoopBox in my blog.
Boxer is a cli tool that launches Windows Sandbox with preinstalled applications or execute scripts at startup. It takes full advantage of the ScoopBox library implementing and exposing all the functionalities to the end user.
Start Windows Sandbox with predefined applications using Chocolatey:
boxer script --chocolatey "git,fiddler,vscode"
Start Windows Sandbox with predefined applications using Scoop:
boxer script --scoop "git,fiddler,vscode"
Start Windows Sandbox with startup scripts:
boxer script -f "C:/Script1.ps1; C:/Script2.ps1"
Start Windows Sandbox with startup scripts and applications:
boxer script -f "C:/PrepareSandbox.ps1" --chocolatey "git,vscode" -f "C:/CloneRepository.ps1;C:/PrepareDevEnvironment.ps1"
- script - Executes scripts and installs aplications in sandbox.
- --chocolatey - Applications that will be installed with Chocolatey, should be separated by comma (,).
- --scoop - Applications that will be installed with Scoop, should be separated by comma (,).
- -f, --file-script - Full path of the script file including the extension. Supported extensions are .ps1, .bat, .cmd
- -s, --literal-script - Single powershell command.
- config - Launch Windows Sandbox using configuration file.
- -f, --file - Path to the config file. Only json configuration is supported.
- version - Displays the version of the project in the format: MAJOR.MINOR.BUILD.REVISION
- help - Displays help for commands and arguments.
The configuration should be in the following structure:
[
{
"args":[],
"type":""
}
]
Supported types in the schema:
- type: File
- args: - Full script file paths
- type: Chocolatey
- args: - Applications to install using Chocolatey package manager
- type: Scoop
- args: - Applications to install using Scoop package manager
- type: Literal
- args - Powershell commands that will be executed
Here are some valid configuration files that you can use:
Configuration that installs git and fiddler using Chocolatey and vscode using Scoop package managers:
[
{
"args":["git", "fiddler"],
"type":"Chocolatey"
},
{
"args":["vscode"],
"type":"Scoop"
}
]
Configuration that runs PrepareEnvironment.ps1 script. After the preparation installs vs code and cleans up all the resources. Latsly when everything is done starts notepad.
[
{
"args":["C:\\PrepareEnvironment.ps1"],
"type":"File"
},
{
"args":["vscode"],
"type":"Scoop"
},
{
"args":["C:/Cleanup.ps1"],
"type":"File"
},
{
"args":["Start-Process 'C:\\windows\\system32\\notepad.exe'"],
"type":"Literal"
}
]
The order matters. All the scripts are ran in the order they are defined.
Coming soon as dotnet tool, chocolatey, scoop and winget
Ensure the bug was not already reported by searching on GitHub under Issues. If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible.
Open a new GitHub pull request with the patch. Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
Open a new GitHub pull request with the patch.