Windows Sandbox with Chocolatey, Scoop, Git, VisualStudio Code and more
I recently wrote an article to introduce Windows Sandbox. I explained how the Sandbox can have folders mapped from the host, have network interactions with the host (and the rest of the world) and use the clipboard for exchanging objects to and from the host. I also mentioned the logon script that can be configured in a Windows Sandbox configuration file ( wsb extension); this logon script can be for example a cmd file or a ps1 file — the latter with a PowerShell script. This script is executed automatically, as soon as the sandbox is initialized.
Through the combination of the wsb and the logon script, it becomes easy to share definitions of Windows playground environments for R&D and workshops. Instead of sharing elaborate instructions for installing software on a laptop that can start out in any state and can therefore end up in any state, I share two small files and be assured that all my students have the exact same Windows environment to do the labs in. Even easier than preparing a Docker container — and on Windows as well.
I have collected a few examples of logon-scripts that can be used to prepare the Windows Sandbox with various combinations of tools. You can check out these scripts in a GitHub repository.
The Sandboxes currently provisionable using the scripts in my GitHub repo:
- VisualStudio Code (very straightforward curl based download and silent install)
- Chocolatey — Windows package management tool, somewhat similar to yum, home brew and apt-get, installed in a very simple and straightforward way — and Azure CLI, VisualStudio Code and Git
- Chocolatey — Windows package management tool, somewhat similar to yum, home brew and apt-get, installed somewhat elaborately using PowerShell 7 — and Linqpad, Git, VS Code and Node ; these four packages are installed through chocolatey
- Scoop — Windows package management tool, somewhat similar to yum, home brew and apt-get and chocolatey (but simpler than chocolatey), in a very straightforward Powershell installation operation — and the Git client
- DBeaver — generic tool for Database development and administration (very straightforward curl based download and silent install)
Note: the scripts should be located on the Windows Host in directory C:\SandboxScripts before starting the Windows Sandbox from the wsb file.
AMIS Blog Article: Windows Sandbox — light weight playground for R&D, tutorials and workshops https://technology.amis.nl/2020/04/25/windows-sandbox-light-weight-playground-for-rd-tutorials-and-workshops/
GitHub Repository with Sandbox scripts: https://github.com/AMIS-Services/code-cafe-20200504/tree/master/WindowsSandbox
GitHub Repo on Chocolatey in Windows Sandbox: https://github.com/OTvedt/Scripts-For-Sharing/blob/master/Sandbox/Chocolatey
Check https://scoop.sh/ for details on Scoop
Originally published at https://technology.amis.nl on May 5, 2020.