If you’ve lost internet access inside a Hyper-V virtual machine or a WSL2 distribution, the first thing to check is the virtual switch configuration, followed by the Windows firewall and the WSL2 NAT settings. These two environments share the same underlying networking stack, so a misconfigured switch or a stale WSL NAT rule will cut off connectivity even when the host is online. This guide walks through the exact checks in order, from the most common cause to the more obscure.
Background: How Hyper-V and WSL2 Networking Works
Hyper-V uses a virtual switch to connect VMs to the host’s physical network. There are three switch types: External (bridged to your physical NIC), Internal (only the host and VMs can talk), and Private (only VMs can talk). For internet access, an External switch is required, and it must be bound to the correct physical adapter.
WSL2, on the other hand, runs inside a lightweight utility VM that uses a NAT (Network Address Translation) service. The host translates traffic from WSL2’s virtual network to the physical network. This NAT is managed by the Windows Hyper-V Host Compute Service (HCS). If that service stops or the NAT rule is deleted, WSL2 loses internet even though the host is fine.
Check 1: Virtual Switch Binding
The most common cause of no internet in Hyper-V is an External switch bound to the wrong adapter or not bound at all. To check:
- Open Hyper-V Manager.
- Click Virtual Switch Manager (right-hand pane).
- Select your External switch and click Edit.
- Under Connection type, ensure External network is selected and the correct physical NIC is chosen from the dropdown.
- Check the box Allow management operating system to share this network adapter if you want the host to also use that NIC.
If you have multiple NICs (e.g., Wi-Fi and Ethernet), make sure the switch is bound to the one that actually has internet. A common mistake is binding to a virtual adapter or a disconnected Ethernet port.
Check 2: Windows Firewall and ICS
Windows Firewall can block traffic between the host and the virtual switch. The quickest test is to temporarily disable the firewall (for testing only) and see if the VM gets internet. If it does, re-enable the firewall and add an inbound rule for the virtual switch’s network.
For WSL2, the NAT relies on Internet Connection Sharing (ICS). If ICS is disabled or misconfigured, WSL2 loses connectivity. To check:
- Open Services (Win+R, type
services.msc). - Find Internet Connection Sharing (ICS).
- Ensure its status is Running and startup type is Automatic.
If ICS is stopped, start it and then restart WSL2 with wsl --shutdown in an admin PowerShell.
Check 3: WSL2 NAT and DNS
WSL2’s NAT can break after a Windows update or when the Hyper-V firewall rules are altered. The most direct fix is to reset the WSL network stack:
- Open PowerShell as Administrator.
- Run
wsl --shutdown. - Run
netsh winsock reset. - Run
netsh int ip reset. - Restart Windows.
If that doesn’t work, check DNS inside WSL2. Sometimes the auto-generated /etc/resolv.conf points to a stale IP. You can test by setting it manually:
sudo nano /etc/resolv.conf
nameserver 8.8.8.8
But note that WSL2 overwrites this file on restart unless you disable automatic generation in /etc/wsl.conf.
Check 4: Hyper-V Virtual Switch Extension
Hyper-V has a feature called Switch Embedded Teaming (SET) and also Virtual Switch Extensions (like the Windows Filtering Platform). If a third-party security or VPN software installs a filter extension, it can block VM traffic. To check:
- In Virtual Switch Manager, select your switch.
- Click Extensions (left pane).
- Uncheck any non-Microsoft extensions temporarily.
If the internet returns, the extension is the culprit. Re-enable them one by one to find the offender.
Check 5: IP Configuration Inside the Guest
Sometimes the problem is not the host but the guest OS. For Hyper-V VMs, ensure the guest’s network adapter is set to DHCP (or has a static IP in the same subnet as the virtual switch). For WSL2, the IP is assigned automatically, but you can check with ip addr inside the distro.
If the guest has a static IP that conflicts with another device, you’ll get no connectivity. Also, check the guest’s default gateway: for Hyper-V external switch, it should be the host’s IP or the router’s IP; for WSL2, it’s the host’s virtual adapter IP (usually 172.x.x.1).
Check 6: Windows Network Reset
If none of the above works, a full network reset on Windows can clear any stuck virtual adapter states. This is a nuclear option but often resolves deep issues.
- Go to Settings > Network & Internet > Advanced network settings > Network reset.
- Click Reset now.
- Windows will remove and reinstall all network adapters, including virtual ones. You’ll need to reconfigure your Hyper-V switch after this.
After the reset, re-create your External switch and restart WSL2.
Frequently Asked Questions
Why does WSL2 have no internet after a Windows update?
Windows updates can reset the Hyper-V firewall rules or the ICS service. Run wsl --shutdown and restart the ICS service. If that fails, run the winsock reset commands mentioned above.
Can I use a NAT switch for Hyper-V VMs to get internet?
Hyper-V does not have a built-in NAT switch (unlike VirtualBox). You can create an Internal switch and use Windows Internet Connection Sharing (ICS) to NAT it, but that’s more complex. The simplest is to use an External switch.
Why does my Hyper-V VM have internet but WSL2 doesn’t?
They use different networking stacks. Hyper-V uses the virtual switch directly, while WSL2 relies on the HCS NAT. If the NAT is broken, only WSL2 is affected. Check the ICS service and try the WSL2 reset steps.
What does “WSL2 is not supported with Hyper-V� mean?
This error appears when you try to run WSL2 on a system that has Hyper-V enabled but the virtualization features are not fully configured. Ensure that “Virtual Machine Platform� and “Windows Hypervisor Platform� are enabled in Windows Features, and that your CPU supports SLAT.
Should I disable Hyper-V to fix WSL2 internet?
No. WSL2 actually requires Hyper-V infrastructure. Disabling Hyper-V will break WSL2 entirely. Instead, focus on the NAT and ICS services.
How do I assign a static IP to a Hyper-V VM?
Set the guest OS network adapter to a static IP in the same subnet as the virtual switch. For an External switch, that’s your LAN subnet (e.g., 192.168.1.x). For an Internal switch, it’s the host’s vEthernet IP (usually 172.16.x.1).
Final Thoughts
Most internet issues in Hyper-V and WSL2 stem from the virtual switch binding or the NAT service. Start with the simplest checks (switch binding, ICS service) before moving to resets. If you’ve tried everything and still no internet, verify that your physical network adapter is not blocked by a VPN or proxy that doesn’t allow virtual traffic.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Mac Start Up Automatically After Power Failure?
- Expose Self-Hosted Service Securely Without Cloudflare Tunnel
- Nano Delivery for Functional Foods: What It Can and Can’t Do4.00
- Disable Apple Watch Turn-by-Turn Vibration While Driving
- Phishing Detector 96.70% Accuracy: What It Means
- Protect Women Athletes’ Privacy on Social Media