My .wslconfig for Docker Desktop

I was running some tests within my Docker Desktop and it started not responding. I restarted it and it failed to start. So I thought, OK this is a resource problem. I opened the panel to configure the resources. But since it is integrated with WSL2, it said it needed a .wslconfig file. I’d never configured that before and where would I place it? It resides in %PROFILE%\.wslconfig thankfully and my quick googling around revealed a set of options that made it work:

[wsl2]
memory=8GB
processors=4
swap=8GB
pageReporting=false
localhostforwarding=true
nestedVirtualization=false

Moving from vagrant+VirtualBox to WSL2

The past two years I had been working on Windows 10 Home. I had a setup that was really easy for me, using a vagrant box per project and using minikube as my docker host. But …

… I wanted to upgrade to Windows 10 Pro. The Windows upgrade was relatively easy and then started the issues. Hyper-V does not play nice with VirtualBox which was the provider for my vagrant boxes. One option was to

> bcdedit /set hypervisorlaunchtype off

which allowed me to work as before, but one of the reasons to make this upgrade to Pro was to run Docker Desktop natively. With hypervisorlaunchtype set to off this is not possible since WSL2 does not run.

So I took a tarfile of each ~vagrant user per virtual machine, then bcdedit /set hypervisorlaunchtype auto, rebooted and I had both WSL2 and docker desktop operational. You can also have minikube run on top of Hyper-V and of course you can always run the kubernetes that comes with the docker desktop.

Because I did not have an elaborate setup with my VMs, the transition seems to have happened without many issues. I now have one user per project in my WSL and still can keep tarfile backups or whatever else if needed.

As for VMs, I am thinking of giving multipass a chance.