Thank you for reaching out.
If you're losing network in WSL2 (openSUSE) — where DNS still works but pings and IP traffic fail — and you're currently fixing it by reinstalling Hyper-V, there's a much faster way.
Quick Fix (No reboot needed)
Quick Fix for WSL2 Network Loss (PowerShell)
Open PowerShell as Administrator and run:
Restart-Service -Force hns
Restart-Service -Force LxssManager
wsl --shutdown
Restart-NetAdapter -Name "vEthernet (WSL)"
Fix DNS Issues in WSL (Terminal)
Open your WSL terminal and run:
sudo sed -i 's/nameserver .*/nameserver 8.8.8.8/' /etc/resolv.conf
Prevent WSL from overwriting this on restart:
sudo nano /etc/wsl.conf
Add the following lines:
[network]
generateResolvConf = false
Then restart WSL:
wsl --shutdown
Check Hyper-V Virtual Switch
If the problem keeps coming back:
- Open Hyper-V Manager → Virtual Switch Manager
- Make sure the switch used for WSL is set to Internal Network
- Ensure vEthernet (WSL) in Windows network settings is using DHCP
Avoid using "External Network" — it often causes conflicts.
Other Things to Check
- If you use a VPN, test your WSL network on Wi-Fi instead of Ethernet
- Make sure firewall software isn’t blocking vmcompute.exe or wslhost.exe
- Full Windows Network Reset (PowerShell or CMD)
Open PowerShell or Command Prompt as Administrator and run:
netsh winsock reset
netsh int ip reset
ipconfig /flushdns
shutdown /r /t 0
Keep Everything Updated
- Update WSL: wsl --update
- Update Windows
- Update VSCode and the Remote - WSL extension
This should fix your issue and prevent you from having to reinstall Hyper-V every few days.
Let me know if you need any help with this