Docker -> How to switch between Hyper-V and WSL directly in the settings.json file.
THE PROBLEM
I installed Docker Desktop on Win 11 and it shits the bed while using WSL2. Don’t ask me why, I think my tech dept fucked up the upgrade from Win 10 and now WSL is borked. Docker Desktop now hangs during startup. However, it works fine with Hyper-V but I cannot switch the engines because its in the settings area of the UI. However, where there is a UI, there is usually a settings file somewhere if its designed well.
So, as usual. I kept pounding away at my problem until a solution presented itself.
THE SOLUTION
In the settings.json file of your docker install. (Usually found in C:\Users\YOUR_USERNAME\AppData\Roaming\Docker\settings.json)
you will find two different entries. One for Hyper-V and one for WSL. You want to enable Hyper-V and disable WSL.
#Hyper-V True/False
useVirtualizationFramework:true,
#WSl True/False
wslEngineEnabled:false,
Then restart Docker Desktop. Make sure to have the Docker Desktop Service running. It may take several minutes to boot up, but it should boot up. If it still hangs, try a reboot and restart Docker Desktop.
Happy Coding!