VM Has No Internet but Host Does – Fix Guide
Your host can browse but the VM can't? The culprit is almost always a misconfigured virtual switch or NAT. Here's the fix.
Quick answer: Check the VM's network adapter type (NAT vs bridged), verify DHCP is working, and ensure the virtual switch isn't misconfigured. Reboot the VM's network service or reset the adapter. That covers 90% of cases.
Why This Happens
You're sitting there, host machine browsing fine, but the VM shows "No Internet Access" or can't ping 8.8.8.8. Frustrating, right? I've seen this across Hyper-V, VMware Workstation, and VirtualBox. The root cause is almost always one of three things:
- The VM is using a network mode that doesn't match your host's setup (e.g., NAT when you need bridged, or vice versa).
- The virtual switch or network bridge is misconfigured – especially after a Windows Update or VMware update.
- DHCP fails to give the VM an IP, or the VM's DNS settings point to a dead server.
In short: the VM's virtual network card isn't talking to your host's real network stack correctly. Let's fix it.
Step-by-Step Fix
- Identify the VM's network mode. In Hyper-V, check the virtual switch connection. In VMware, check if the VM is set to NAT, Bridged, or Host-only. In VirtualBox, same deal. If the VM needs the same network as your host (like same subnet as your router), use Bridged mode. If you just want the VM to share the host's internet without being on the same LAN, use NAT.
- Verify DHCP and IP assignment. Inside the VM, run
ipconfig /all(Windows) orip addr show(Linux). Does it have an IP? If it's 169.254.x.x (APIPA), DHCP failed. Try a static IP: use your router's subnet (e.g., 192.168.1.x) with your router as gateway. - Check the virtual switch settings. In Hyper-V, open Virtual Switch Manager. Make sure the external switch is bound to the correct physical NIC – not a Wi-Fi adapter that's disabled or a VPN virtual adapter. In VMware, go to Virtual Network Editor and verify the NAT or Bridged mapping. A classic mistake: binding the switch to a disconnected or virtual NIC.
- Reset the VM's network adapter. Inside the VM, disable and re-enable the network adapter. Or run
netsh int ip reseton Windows, then reboot the VM. For Linux, restart networking:sudo systemctl restart networkingorsudo service network-manager restart. - Test connectivity. Ping your gateway first (e.g.,
ping 192.168.1.1). If that works but internet doesn't, it's a DNS problem. Set DNS to 8.8.8.8 in the VM's network settings and test again. - Restart the host's network services. On Windows host, run
net stop SharedAccess && net start SharedAccess(for NAT) or restart the Hyper-V Virtual Machine Management service. On Linux host, restartlibvirtdorNetworkManager.
Alternative Fixes If the Main Steps Fail
- Switch from NAT to Bridged. If you're using NAT and it's broken, bridged mode often works because it bypasses the host's NAT stack. Just make sure the VM gets an IP from your router's DHCP.
- Create a new virtual switch. In Hyper-V, delete the old external switch and create a fresh one. Point it to the correct physical adapter. This cleans up any stale bindings.
- Disable IPv6 on the VM's adapter. Sometimes IPv6 DHCP fails when IPv4 works. Uncheck IPv6 in the VM's adapter properties (Windows) or disable it with sysctl on Linux.
- Use a static IP. If DHCP isn't cooperating, set a static IP manually. Use the same subnet as your host's LAN. For example, host is 192.168.1.5, set VM to 192.168.1.100, gateway to 192.168.1.1, DNS to 8.8.8.8.
- Check for VPN or proxy conflicts. If you have a VPN client running on the host, it can hijack the virtual switch. Disconnect the VPN temporarily and test. Corporate VPNs are notorious for this.
- Update virtualization software. I've seen VMware 16.0 have this bug. Upgrading to 16.1 or 17 fixed it. Same with Hyper-V after certain Windows 10 builds.
Prevention Tips
- Use bridged mode for production VMs. It's more reliable than NAT because it doesn't depend on the host's internal routing. Just ensure the host's firewall allows the VM traffic.
- Document your network config. Write down the VM's IP, gateway, and DNS. Saves time when you rebuild the VM.
- After host OS updates, test VM connectivity. Windows Updates love to reset virtual switch bindings. Run a quick ping test after each patch Tuesday.
- Keep virtualization software updated. VMware and VirtualBox release fixes for network bugs often. Set it to auto-update or check monthly.
- Use a dedicated physical NIC for VMs if possible. Even a cheap USB Ethernet adapter can isolate VM traffic from host VPNs or Wi-Fi issues.
One last thing: If you're running Linux VMs on a Windows host with Hyper-V, sometimes the Hyper-V Linux Integration Services need updating. On Ubuntu, run
sudo apt install linux-azure(yes, Azure) to get the latest drivers. Sounds weird, but it works.
Was this solution helpful?