Customizing Windows Sandbox


Windows 10 introduced a neat features called the Windows Sandbox. It creates a temporary (ephemeral) Windows VM (same version as host) that when closed is destroyed along with the contents. When you open Windows Sandbox it is pretty bare with no extras. However, it is possible to create it with a bit of customizations added. This is accomplished by creating a wsb (Windows SandBox) file.

Example wsb that creates a shared folder (downloads/wsb_files) on the host in my user (canut) home directory.

<Configuration>
<VGpu>Default</VGpu>
<Networking>Default</Networking>
<MappedFolders>
   <MappedFolder>
     <HostFolder>C:\Users\canut\Downloads\wsb_files</HostFolder>
     <ReadOnly>false</ReadOnly>
   </MappedFolder>
</MappedFolders>
<LogonCommand>
   <Command>C:\Users\WDAGUtilityAccount\desktop\wsb_files\startup.bat</Command>
</LogonCommand>
</Configuration>

The startup.bat file is executed at “logon” to the VM after creation. The contents are:

C:\Users\WDAGUtilityAccount\desktop\wsb_files\SurfsharkSetup.exe /exenoui /qn
C:\Users\WDAGUtilityAccount\desktop\wsb_files\qbittorrent_4.6.4_x64_setup.exe /S
explorer.exe C:\Users\WDAGUtilityAccount\desktop\wsb_files
"C:\Program Files\qBittorent\qbittorrent.exe"

This .bat script will run the installer for surfshark’s VPN, then install qbittorrent, -both of which need to be downloaded first – and then it will open explorer to the wsb_files location and finally run qbittorrent application.

There is a lot of potential customizations that can be done and you can review further examples to get a better idea of the possibilities.


Leave a Reply