Temporarily Disable Hyper-V, WSL2 Network Adapters in Windows 11

JON DAVIDSON 21 Reputation points
2022-10-12T00:43:31.81+00:00

I'd like to temporarily disable all Hyper-V, WSL2 network adapters in Windows 11 Pro. I PC games w/my kids sometimes in the evenings and when those adapters are enabled, I cannot join LAN matches (I presume due to subnet scanning of 172.** instead of 192.168.* for my LAN).

When I disable Hyper-V, all problems go away, but that's sort of a pain to have to do. I'd rather have a script that I can run to enable and disable all Hyper-V/WSL2 adapters.

Is there a way to do this?

Thanks,
Jon M. Davidson

Windows for business Windows Client for IT Pros Storage high availability Virtualization and Hyper-V
Windows for business Windows Server User experience PowerShell
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-10-12T00:51:31.667+00:00

    Try creating and using an external vSwitch instead of NATing via the default switch.

    --please don't forget to upvote and Accept as answer if the reply is helpful--


1 additional answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2022-10-12T09:48:01.84+00:00

    Hi Jon,

    You can use a command prompt to enable and disable hyper-v, so you could use a batch file:

    dism.exe /Online /Disable-Feature:Microsoft-Hyper-V

    and

    dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

    --------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.