windows-subsystem-for-linuxqemu

Run WSL2 in Windows 10 guest VM running on a Linux host


I've got a Windows VM that I am using for testing in lieu of a real WIndows machine. I'd like to enable WSL2 inside that VM.

So far I've:

Still no dice. As soon as I enable "Virtual Machine Platform" feature, as required for WSL2, my VM starts freezing on boot.

Has anyone managed to do this successfully?


Solution

  • The answer here - to pass through specific flags that make Windows think it is on the metal, but can do nested virt, saved the day for me:

    https://superuser.com/a/1589286/916009 - please note this link was posted by @JCallicoat - just saying it should be the answer

    cpu definition in your virtual machine emu like so:

    <cpu mode="custom" match="exact" check="partial">
        <model fallback="allow">Skylake-Client-noTSX-IBRS</model>
        <feature policy="disable" name="hypervisor"/>
        <feature policy="require" name="vmx"/>
    </cpu>