ESX/ESXi change MAC Address

Added by 范 益波 over 10 years ago


This article provides steps to change the MAC address manually to be persistent after a reboot in ESX/ESXi 4.0.


Attempting to changing the MAC address manually from the vSphere Client fails with the error: The MAC address entered is not in the valid range. Valid values are between xx:xx:xx:xx:xx


Add or change MAC address information to the .vmx file on the ESX/ESXi host

  1. Shut down the virtual machine.
  2. Right-click the virtual machine and click Remove from Inventory.
  3. Login as the root user to a console session on the ESX/ESXi host.
  4. Go to the virtual machine home directory:
    cd /vmfs/volumes/DatastoreName/VMFolderName
  5. Make a backup of the existing virtual machine's .vmx configuration file with the command:
    cp vmname.vmx vmname.vmx.old
  6. Open the .vmx configuration file in an editor such as vi or nano and add or change the following entries:
    ethernetN.checkMACAddress = “false”
    ethernetN.addressType = “static”
    ethernetN.Address = “XX:XX:XX:XX:XX:XX″

    Where XX:XX:XX:XX:XX:XX is the new desired MAC address for the virtual machine.
  7. Register the virtual machine back to the inventory.
  8. Start the virtual machine.

or skip step 2 and 7, and reload .vmx manually

How to reload .vmx manually

  1. Find your vm id. This will show all VM’s running on that host. The first number on the left is the VmId.
    vim-cmd vmsvc/getallvms
  2. Reload .vmx for specific vmid
    vim-cmd vmsvc/reload your_vmid