When you create a VM on VMware ESXi, each network interface of the VM is assigned a dynamically generated MAC address. If you want to change this default behavior and assign a static MAC address to your VM, here is how to do it.
As you can see above, VMware's vSphere GUI client already has a menu for setting a static MAC address for a VM. However, this GUI-based method only allows you to choose a static MAC address from 00:50:56:xx:xx:xx, which is VMware-reserved MAC address range. If you attempt to set any arbitrary MAC address outside this MAC range, you will fail to launch the VM, and get the following error.
Then what if I want to assign any arbitrary MAC address to a VM?
Fortunately, there is a workaround to this limitation. The solution is, instead of using vSphere GUI client, editing .vmx file of your VM directly, after logging in to the ESXi host.
First, turn off the VM to which you want to assign a static MAC address.
Enable SSH access to your ESXi host if you haven't done it already. Then log in to the ESXi host via SSH.
Move to the directory where your VM's .vmx file is located:
Open .vmx file with a text editor, and add the following fields. Replace the MAC address field with your own.
ethernet0.addressType = "static" ethernet0.checkMACAddress = "false" ethernet0.address = "00:0c:29:1f:4b:ac"
Now you should be able to launch a VM with the static MAC address you defined in .vmx file.
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.