2

I need to do some mui test, and i need to change the language of the windows sandbox. The problem is that it's not possible to reboot or logout, as it will close and erase the sandbox. In the official documentation there's no mention of this: I wonder if there's a workaround to allow that, for example to modify the master image

Magnetic_dud
  • 3,612
  • 1
    "The problem is that it's not possible to reboot or logout" - is it not? I was able to change system locale inside sandbox after booting it once. After I tried to click "OK", I got "reboot needed" message, clicked "Reboot now", then sandbox window disappeared, sandbox logo appeared, and then it changed back to sandbox window. I checked system locale settings and it indeed changed. Yes, after I close sandbox window, my locale changes will disappear, but I did manage to change locale and "reboot" sandbox without losing my changes. – izogfif Mar 30 '24 at 16:20

1 Answers1

2

It is possible to change many settings of the Windows Sandbox.

As Windows Sandbox is a virtual machine that is discarded when closed, you should modify the base image of the virtual machine itself in its .vhdx file.

See the article How to customize the default Windows Sandbox (files, folders, registry, wallpaper) without using WSB file.

In a nutshell :

  • Mount the VHDX by stopping the Windows system service "Container Manager Service", and double-click on BaseLayer.vhdx in C:\ProgramData\Microsoft\Windows\Containers\BaseImages\GUID
  • Modify the registry using regedit menu File > Load hive to load \Files\Users\WDAGUtilityAccount\ntuser.dat and use File > Unload hive when finished.

For all language settings in the registry, see :

It would perhaps be simpler to setup your Windows to the wanted language and export the registry items of interest, then import these changes to the registry of the base image.

harrymc
  • 480,290
  • It works, thanks – Magnetic_dud Jan 07 '23 at 06:05
  • @Magnetic_dud hi, could you kindly share how you get it work? I have tried all the registry keys listed in above links but none of them work. What I would like to do is to change the Windows displaying language, which normally can be changed from control panel but would requires re-login the account. – YAC Nov 04 '23 at 13:51
  • @YAC the registry changes were to be applied on the BaseLayer.vhdx image by mounting it and then to edit the hive on that file, not the host system. Don't really remember clearly as it was one year ago and then i didn't touch it anymore – Magnetic_dud Nov 04 '23 at 18:10
  • Thanks for your hints. I tried to modify the BaseLayer.vhdx but it still did not seem to work. :( One weird thing is that when I launch the sandbox and inspect the registry from inside the sandbox, I find some values are different from the ones of BaseLayer.vhdx. I suspect that Windows Sandbox overwrites some of the values behind the scenes. I might just give it up by now as I cannot figure out what exactly Windows does to the Sandbox. No matter what, thanks for your help! – YAC Nov 05 '23 at 04:18
  • this is no longer work, latest windows 11 (version 22H2) There's no BaseLayer.vhdx in here C:\ProgramData\Microsoft\Windows\Containers\BaseImages\GUID. do we have the workaround for this? – nanangarsyad Nov 11 '23 at 09:48