I am doing exactly like this,
When I need VM, I run
PowerShell Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All bcdedit /set hypervisorlaunchtype off
Work in VM
PowerShell Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All bcdedit /set hypervisorlaunchtype auto start
I was asked about it too many times, so I even created a hint to paste URL😀 https://hinty.io/devforth/wsl-2-starter-guide-must-read/
Yes WSL 2 is cool, but seams like for now it is easier to buy another PC if you need a VirtualMachines for development
📢 Actions Speak Louder Than Words!