Docker -> How to switch between Hyper-V and WSL directly in the settings.json file.

Tony Mucci
Code Kings
Published in
1 min readFeb 14, 2024
Prompt: Create a hyper-realistic photo of a person writing code on a computer in Jurrasic Park, located by the Santa Monica Pier

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!

--

--

Tony Mucci
Code Kings

Co-founder of SimpliCourt, dree, My Company Tools, and Eklect Enterprises