3

There are some settings in the registry that can require a reboot before they take effect. Changing these settings in a Windows Sandbox and rebooting will not work since they will be reset when the sandbox starts up again. How can I run Windows 10 Sandbox with pre-configured registry keys?

Manga Lee
  • 1,393

4 Answers4

3

You can achieve this by following the tutorial here. https://www.systanddeploy.com/2021/08/how-to-customize-default-windows.html

In a nutshell:

  1. Mount the Windows Sandbox .vhdx.

  2. Open regedit

  3. Go to HKLM

  4. Click on File

  5. Click on Load hive

  6. Browse E:\Files\Users\WDAGUtilityAccount\ntuser.dat

  7. Type a name like 'test'

  8. Change what you want

  9. Click on File

  10. Click on Unload hive

When you load the Sandbox, your reboot changes will be included.

YorSubs
  • 1,087
0

Sandbox goes away at every restart. That is the Sandbox design and I have not seen any changes to it. It is designed to be completely temporary.

If you need a degree of permanence, consider a virtual machine. Hyper-V should come with the machine you have if Sandbox is running.

0

Windows Sandbox does not persist beyond a reboot.

If you wish a persistent sandbox, use the free and open-source Sandboxie.

You should note that any changes to Windows that require a reboot are useless, since the reboot will boot the unmodified Windows. Whether the changes done in the sandbox will have any effect, this depends only on the nature of the changes, so the newly installed features may not be usable.

harrymc
  • 498,455
0

The accepted answer from @YoSubs was no doubt correct at the time it was posted, but with later versions of Win 11 (I'm on 23H2), I have found the sandbox architecture has changed.

The registry files no longer appear to be stored within Sandbox's .vhdx. As a heads up, just mounting it on my system corrupted the set of disk / difference files sandbox uses, and it would no longer start until an uninstall / install cycle of the feature.

The files now APPEAR (see below) to be on the host system, located in subfolders of

C:\ProgramData\Microsoft\Windows\Containers\BaseImages\<GUID>\BaseLayer\Files\

Like the registry in a normal Windows installation, the data is split over a number of files and I got great help from this answer.

User keys are in:

C:\ProgramData\Microsoft\Windows\Containers\BaseImages\<GUID>\BaseLayer\Files\Users\WDAGUtilityAccount\ntuser.dat

and Local Machine keys can be found in several files with no extension here:

C:\ProgramData\Microsoft\Windows\Containers\BaseImages\<GUID>\BaseLayer\Files\Windows\System32\config\

such as SOFTWARE, SECURITY, SYSTEM, etc.

HOWEVER, for the change I was attempting to make, alterations to the Software hive did not show up in the sandbox machine, so your mileage with this information may vary!