Configuracion avanzada de Windows Sandbox

En un post anterior comento como instalar y la utilizacion basica de Windows Sandbox.

Si comenzamos a utilizarlo habitualmente, veremos que debido a la reinicializacion total, estaremos repitiendo ciertos pasos cada vez que iniciamos la aplicacion.

Para evitar algunos de estos pasos repetitivos, podemos utilizar un archivo de configuracion. Windows Sandbox nos permite escribir archivos de configuracion, formateados como XML, los mismos utilizan la extension .wsb.

Utilizando cualquier editor de texto que nos permita trabajar con texto plano, podemos crear nuestro archivo de configuracion.

En el siguiente archivo de configuracion de ejemplo, vemos las opciones que tenemos disponibles, como la posibilidad de mapear una carpeta de la maquina host en una carpeta del Sandbox, o ejecutar un comando en el sandbox luego de que inicia. En el ejemplo, estamos ademas iniciando la instalacion de Visual Studio Community 2022 que ya tenemos previamente descargado en la computadora host.

<Configuration>
    <vGPU>Default</vGPU><!--Enable|Disable|Default-->
    <Networking>Default</Networking><!--Disable|Default-->
    <MappedFolders>
        <MappedFolder> 
            <HostFolder>D:\VS\Preview\Community2022</HostFolder><!--absolute path to the host folder-->
            <SandboxFolder>C:\VS</SandboxFolder><!--absolute path to the sandbox folder-->
            <ReadOnly>false</ReadOnly> <!--true|false-->
        </MappedFolder>
    </MappedFolders>
    <LogonCommand>
        <Command>C:\VS\vs_community.exe --passive --norestart --includeOptional</Command> <!--command to be invoked-->
    </LogonCommand>
    <AudioInput>Default</AudioInput><!--Enable|Disable|Default-->
    <VideoInput>Default</VideoInput><!--Enable|Disable|Default-->
    <ProtectedClient>Default</ProtectedClient><!--Enable|Disable|Default-->
    <PrinterRedirection>Default</PrinterRedirection><!--Enable|Disable|Default-->
    <ClipboardRedirection>Default</ClipboardRedirection><!--Disable|Default-->
    <MemoryInMB>4096</MemoryInMB>
</Configuration>

Luego de guardar el archivo en nuestro disco local con la extension .wsb podemos hacer doble click sobre el mismo, lo que iniciara Windows Sandbox y cargara las opciones establecidas.

Podemos de esta manera tener distintos archivos de configuracion que nos daran acceso a diferentes configuraciones de prueba en forma muy rapida y sencilla.

Aqui les dejo el enlace a la documentacion oficial para que puedan ver los detalles de los distintos parametros.

Installing Docker for Windows 10

Docker Desktop for Windows is Docker for Windows 10, you can get the installer from here.

I started the installer, and continue using the default options.

After the installation is completed (reboot required), I needed to download and install the WSL 2 Linux Kernel and reboot again.

One of the advantages of using WSL is that we can now run Hyper-V (I use Hyper-V for android emulators) side by side with Linux containers, this was not possible before when Docker needed to use VirtualBox.

At this point Docker is installed and we can follow the provided tutorial.

To check that everything is working as expected, we can open a powershell window and execute the docker -v command.

Also in the context menu from the docker taskbar icon, we can switch to Windows Containers

And that is all! I hope this was useful and let me know what do you think in the comments!