Skip to content

Instantly share code, notes, and snippets.

@limingjie
Last active January 7, 2024 13:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save limingjie/b5e590cd756a772f5f6a to your computer and use it in GitHub Desktop.
Save limingjie/b5e590cd756a772f5f6a to your computer and use it in GitHub Desktop.
VMware Network Configuration

VMware Assign Static IP to Guest

Assign Static IP

  • Find Guest MAC Address

    In Virtual Machine Settings -> Hardware -> Network Adapter, click Advanced... button. I usually modify the MAC address to 00:11:22:33:44:55 for convenience.

  • Locate VMware DHCP Server Configuration File

    According to network connection type, open/modify vnet1 for Host-only, vnet8 for NAT.

    • Windows XP, C:\Documents and Settings\All Users\Application Data\VMware\vmnetdhcp.conf.
    • Windows Vista or above, C:\ProgramData\VMware\vmnetdhcp.conf.
    • Linux, /etc/vmware/vmnet1/dhcp/dhcp.conf or /etc/vmware/vmnet8/dhcp/dhcp.conf
  • Assign Static IP

    Edit DHCP Server Configuration File (ip address in the subnet of VMnet8).

    host ArchLinux {
        hardware ethernet 00:11:22:33:44:55;
        fixed-address 192.168.91.100;
    }
    
  • Reboot Host

Reference

VMware NAT Port Forwarding

After installing virtual machine, do you want to forward the SSH access to some port of host machine?

Or you just tired of remembering IP address, what about using localhost?

Try port forwarding.

Configure NAT Port Forwarding

  • Using NAT

    In Virtual Machine Settings -> Hardware -> Network Adapter, choose NAT.

  • Open NAT Configuration file

    • On Windows. The file is either C:\WINNT\system32\vmnetnat.conf or C:\ProgramData\VMware\vmnetnat.conf.
    • On Linux. The file is /etc/vmware/vmnet8/nat/nat.conf.
  • Configure Port Forwarding

    [incomingtcp]
    # This is an example of forwarding virtual machine's SSH port to host machine port 8889.
    # The IP address should be in the subnet of VMnet8
    8022 = 192.168.91.100:22
    
  • Reboot Host

Reference

VMware - Understanding NAT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment