Friday, August 8, 2025

Network issue in window server (no internet in Virtual Machine).

 








✅ Step-by-Step Guide to Fix No Network on Windows VM


🔹 Step 1: Confirm Your Virtual Machine Type

Which hypervisor are you using?

  • Hyper-V (Windows built-in)

  • VMware Workstation/Player

  • VirtualBox

  • [Let me know if another]

For now, I’ll explain for Hyper-V and VMware.


🔧 A. If You Are Using Hyper-V

1. ✅ Create a Virtual Switch

To give your VM access to the physical network:

  1. Open Hyper-V Manager.

  2. On the right, click Virtual Switch Manager.

  3. Choose New virtual network switch → Select External → Click Create Virtual Switch.

  4. Name it something like ExternalSwitch.

  5. Under Connection type, select the physical network adapter (e.g., Broadcom NetXtreme).

  6. Check Allow management OS to share this network adapter (optional).

  7. Click OK.

2. 🔌 Connect VM to Virtual Switch

  1. Right-click your VMSettings.

  2. Go to Network Adapter.

  3. Change Virtual switch to the one you just created (ExternalSwitch).

  4. Click OK.

3. 🌐 Check Inside Windows VM

  1. Boot the VM.

  2. Go to Network & Internet SettingsChange Adapter Options.

  3. Right-click EthernetProperties.

  4. Select Internet Protocol Version 4 (TCP/IPv4)Properties.

    • Choose Obtain an IP address automatically (DHCP).

    • Or, manually assign IP like:

      • IP: ip address of your server

      • Subnet Mask: 255.255.255.0  as your ip class

      • Gateway: default 

      • DNS: 8.8.8.8./ ip 

  5. Click OK, then restart the adapter.

4. ✅ Test Internet

  • Open CMD in VM and run:

    nginx
    ping 8.8.8.8 ping google.com

🔧 B. If You Are Using VMware Workstation/Player

1. 🛠 Check Network Mode

  1. Power off the VM.

  2. Go to VM > Settings > Network Adapter.

  3. Choose:

    • Bridged – Connects directly to your physical network.

    • OR NAT – VM shares host IP but gets internet.

  4. Make sure “Connect at power on” is checked.

2. 🌐 Inside the Windows VM

Follow the same IP configuration steps as in Hyper-V above.


✅ Common Issues to Check

IssueSolution
VM network adapter is missingGo to Device Manager > Network > Scan for hardware changes or install VMware Tools / Hyper-V Integration Services
Wrong Virtual SwitchMake sure it's External, not Internal/Private
Physical NIC doesn't support bridgingTry using NAT instead
Firewall or AV blockingTemporarily disable and test

📄 Summary (Checklist)

StepAction
Create External Virtual Switch (Hyper-V)
Assign that switch to VM
Use DHCP or a Static IP in the same subnet
Set correct gateway and DNS
Test with ping and browser