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 Mode | Function | Use Case |
---|---|---|
Bridged Mode | VM gets a real IP from the physical network | Use when VM needs to behave like a physical machine |
NAT Mode | VM shares the host’s internet connection with a private IP | Default option, useful for general internet access |
Host-Only Mode | VM can only communicate with the host, no external access | Secure testing environments |
Custom (VMnet) | Create isolated virtual networks | Advanced network configurations |
1. Configuring Network in VMware Workstation
Step 1: Open Network Settings
- Open VMware Workstation and select your VM.
- Click “Edit virtual machine settings”.
- 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
- Go to Edit > Virtual Network Editor.
- 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
- Open Control Panel > Network and Sharing Center.
- Click Change adapter settings.
- Right-click Ethernet > Properties.
- Select Internet Protocol Version 4 (TCP/IPv4).
- 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)
- Click OK and restart the VM.
For Linux VM
- Open Terminal and run:
sudo nano /etc/netplan/01-netcfg.yaml
- 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
- Apply changes:
sudo netplan apply
- 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
Issue | Solution |
---|---|
No internet on VM | Switch to NAT mode, restart the VM |
VM not getting an IP | Check Virtual Network Editor settings |
Bridged mode not working | Ensure your host’s network adapter is active |
VM cannot communicate with host | Try Host-Only mode and check firewall settings |