Networking in VMware

Networking in VMware allows virtual machines (VMs) to communicate with each other, the host system, and external networks (like the internet). VMware provides different network modes for flexibility.


Types of Network Adapters in VMware

Network ModeFunctionUse Case
Bridged ModeVM gets a real IP from the physical networkUse when VM needs to behave like a physical machine
NAT ModeVM shares the host’s internet connection with a private IPDefault option, useful for general internet access
Host-Only ModeVM can only communicate with the host, no external accessSecure testing environments
Custom (VMnet)Create isolated virtual networksAdvanced network configurations

1. Configuring Network in VMware Workstation

Step 1: Open Network Settings

  1. Open VMware Workstation and select your VM.
  2. Click “Edit virtual machine settings”.
  3. Go to the “Network Adapter” section.

Step 2: Choose a Network Mode

  • Bridged Mode → Connects the VM directly to the physical network.
  • NAT Mode (Recommended) → VM uses host’s internet connection.
  • Host-Only Mode → Restricts VM communication to the host machine.

Step 3: Apply and Restart the VM

  • Click OK and restart the VM to apply changes.

2. Configuring Advanced Network Settings

Using the Virtual Network Editor

  1. Go to Edit > Virtual Network Editor.
  2. Customize network adapters:
    • Enable or disable DHCP.
    • Assign static IP addresses.
    • Create isolated virtual networks.

Assigning a Static IP to the VM

For Windows VM

  1. Open Control Panel > Network and Sharing Center.
  2. Click Change adapter settings.
  3. Right-click Ethernet > Properties.
  4. Select Internet Protocol Version 4 (TCP/IPv4).
  5. Enter:
    • IP Address: 192.168.1.100 (Example)
    • Subnet Mask: 255.255.255.0
    • Gateway: Your router’s IP (e.g., 192.168.1.1)
  6. Click OK and restart the VM.

For Linux VM

  1. Open Terminal and run: sudo nano /etc/netplan/01-netcfg.yaml
  2. Modify the file to: network: ethernets: ens33: dhcp4: no addresses: - 192.168.1.100/24 gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] version: 2
  3. Apply changes: sudo netplan apply
  4. Verify using: ip a

3. Testing Network Connectivity

Run these commands inside the VM to check the network:

Check IP Address (Windows/Linux)

ipconfig (Windows)  
ifconfig or ip a (Linux)

Test Internet Connectivity

ping google.com

Check Host-Virtual Machine Connection

ping <Host_IP>

4. Troubleshooting Networking Issues

IssueSolution
No internet on VMSwitch to NAT mode, restart the VM
VM not getting an IPCheck Virtual Network Editor settings
Bridged mode not workingEnsure your host’s network adapter is active
VM cannot communicate with hostTry Host-Only mode and check firewall settings