ESX/ESXi change MAC Address
Intro¶
This article provides steps to change the MAC address manually to be persistent after a reboot in ESX/ESXi 4.0.
Problems¶
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
Solution¶
Add or change MAC address information to the .vmx file on the ESX/ESXi host
- Shut down the virtual machine.
- Right-click the virtual machine and click Remove from Inventory.
- Login as the root user to a console session on the ESX/ESXi host.
- Go to the virtual machine home directory:
cd /vmfs/volumes/DatastoreName/VMFolderName
- Make a backup of the existing virtual machine's .vmx configuration file with the command:
cp vmname.vmx vmname.vmx.old
- 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. - Register the virtual machine back to the inventory.
- Start the virtual machine.
or skip step 2 and 7, and reload .vmx manually
How to reload .vmx manually¶
- 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
- Reload .vmx for specific vmid
vim-cmd vmsvc/reload your_vmid
reference¶
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2007042
http://blog.vmpros.nl/2009/05/15/vmware-reload-the-vmx-from-service-console/
http://www.networknet.nl/apps/wp/archives/787