New
#1
Windows Sandbox - personalized base image?
Hi,
I was wondering if anyone had found a way to use a personalised base image in Windows Sandbox. The version of Windows it uses is the 2004 Enterprise (19041.1503). Through wsb configuration file it is possible to do many things to personalize the sandbox (mount a local folder, apply themes, run startup commands, apply reg configs, etc.), but the base image is stuck on 2004 Enterprise.
As far as I know this tecnology is based on Windows Containers and all the files it uses are found in ProgramData\Microsoft\Windows\Containers (attached the structure of the folder made with snap2html).
In particular in the subfolder PortableBaseLayer is found the base image in the form of a VHDX file: WindowsDefenderApplicationGuard.vhdx (this file is hardlinked as BaseLayer.vhdx under BaseImages subfolder) .
There are also two other files (SystemTemplateBase.vhdx and SystemTemplate.vhdx) that seems to be snapshot vhds, maybe used as layers on top of the base image.
using fsutil volume list it turns out that the sub folder BaseLayer is a mount point of a VHDXmost probably WindowsDefenderApplicationGuard.vhdx or BaseLayer.vhdx. If you try to explore the BaseLayer folder Windows will complain of missing permissions, but through Disk Manager->Mount VHD the folder is browsable. In fact most of the vhds in these folders can be actually mounted in Disk Manager.Code:fsutil volume list \\?\Volume{629458e4-0000-0000-0000-010000000000}\ C:\ProgramData\Microsoft\Windows\Containers\BaseImages\af4dcbf9-b553-4d86-8a8b-e825ff729191\BaseLayer\
In the registry, there are also key values, as attached in Containers.reg, that point to C:\WINDOWS\Containers\serviced\WindowsDefenderApplicationGuard.wim which is hardlinked to C:\Windows\WinSxS\amd64_microsoft-windows-dynamic-image_31bf3856ad364e35_10.0.19041.1503_none_b4e081eeeaa333a6\WindowsDefenderApplicationGuard.wim
It would be interesting to dig more and find a way to use in original ways this technology, maybe using a Windows 11 sandbox on windows 10?
Last edited by artioni81; 05 Feb 2022 at 09:33.