Note: The static and dynamic MAC address ranges are different in an ESX/ESXi environment. If you attempt to statically assign a MAC address from a previous virtual machine that has a dynamic MAC address, you may encounter issues.
It is recommended that you do not</u> configure virtual machines with previously used dynamic MAC addresses. The impact of configuring a virtual machine with a previously used dynamic MAC address may result in being unable to make configuration changes to the virtual machine in vCenter until it has been corrected.
To make a MAC address change persistent after a reboot, add or change the MAC address information to the virtual machine's .vmx configuration file.
Add or change MAC address information to the .vmx file on the ESX/ESXi host
To add or change the MAC address of a virtual machine:
- 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. For more information, see Tech Support Mode for Emergency Support (1003677).
- 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.
Note: For more information, see Editing files on an ESX host using vi or nano (1020302).
- Register the virtual machine back to the inventory. For more information, see Registering or adding a virtual machine to the inventory (1006160).
- Start the virtual machine.
Note: When configuring this manually the string "ethernetN.address = “XX:XX:XX:XX:XX:XX″ uses a lowercase "a" in address. The GUI does us an uppercase "A" as shown in the command below.
Editing the .vmx file through the GUI
To use the GUI to change the MAC address of a virtual machine:
- Shut down the virtual machine.
- Right-click the virtual machine and click Remove from Inventory.
- Download the .vmx configuration file for the virtual machine to your desktop using the Datastore Browser.
- Open the .vmx configuration file with an plain text editor 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.
- Upload the new (modified) .vmx file back to the same location (datastore) using the Datastore Browser.
- Copy the original .vmx file (using a name similar to vmname.vmx.old) for backup purposes.
- Register the virtual machine back to the inventory. For more information, see Registering or adding a virtual machine to the inventory (1006160).
- Start the virtual machine.