An ESXi host generates the MAC address for a virtual machine adapter when the host is not connected to vCenter Server.Such addresses have a separate VMware OUI to avoid conflicts. The ESXi host generates the MAC address for a virtual machine adapter in one of the following cases:. The host is not connected to vCenter Server. The virtual machine configuration file does not contain the MAC. May 02, 2014 if the virtual machine's mac address is in automatic mode, there are some situations where the virtual machine's mac address can change. AFAIK, this situations are: When a virtual machine is powered on again, it might acquire a different MAC address. The MAC address changes on the virtual NIC during the hardware (version) upgrade. Follow these steps to change the MAC address from auto-generated to static. First, remove the VM from the vCenter Server inventory. Open the datastore containing the VM and download the.vmx file. Optionally, make a back-up copy of this file for safe keeping. Open the.vmx file (I use Notepad) and modify the following entries.
Maintaining and Changing the MAC Address of a Virtual Machine
When a virtual machine is powered on, VMware Workstation automatically assigns each of its virtual network adapters an Ethernet MAC address. MAC stands for media access control. A MAC address is the unique address assigned to each Ethernet network device.
The software guarantees that virtual machines are assigned unique MAC addresses within a given host system. In most cases, the virtual machine is assigned the same MAC address every time it is powered on, so long as the virtual machine is not moved (the path and filename for the virtual machine's configuration file must remain the same) and no changes are made to certain settings in the configuration file.
In addition, VMware Workstation does its best, but cannot guarantee, to automatically assign unique MAC addresses for virtual machines running on multiple host systems.
Avoiding MAC Changes
To avoid changes in the MAC address automatically assigned to a virtual machine, you must not move the virtual machine's configuration file. Moving it to a different host computer or even moving it to a different location on the same host computer changes the MAC address.
You also need to be sure not to change certain settings in the virtual machine's configuration files. If you never edit the configuration file by hand and do not remove the virtual Ethernet adapter, these settings remain untouched. If you do edit the configuration file by hand, be sure not to remove or change the following options:
ethernet[n].generatedAddress
ethernet[n].addressType
ethernet[n].generatedAddressOffset
uuid.location
uuid.bios
ethernet[n].present
In these options, [n] is the number of the virtual Ethernet adapter, for example ethernet0.
Note: To preserve a virtual Ethernet adapter's MAC address, you also must be careful not to remove the adapter. If you remove the adapter, then recreate it, the adapter may receive a different MAC address.
Manually Assigning a MAC Address
If you want to guarantee that the same MAC address is assigned to a given virtual machine every time, even if the virtual machine is moved, or if you want to guarantee a unique MAC address for each virtual machine within a networked environment, you can assign the address manually instead of allowing VMware Workstation to assign it automatically.
To assign the same, unique MAC address to any virtual machine manually, use a text editor to remove three lines from the configuration file and add one line. The configuration file has a.vmx extension at the end of the filename. On a Linux host, a virtual machine created with an earlier VMware product may have a configuration file with a .cfg extension.
Remove the three lines that begin with the following from the configuration file:
ethernet[n].generatedAddress
ethernet[n].addressType
ethernet[n].generatedAddressOffset
In these options, [n] is the number of the virtual Ethernet adapter — for example ethernet0.
Add the following line to the configuration file:
ethernet[n].address = 00:50:56:XX:YY:ZZ
In this line, XX must be a valid hexadecimal number between 00h and 3Fh, and YY and ZZ must be valid hexadecimal numbers between 00h and FFh. Because VMware Workstation virtual machines do not support arbitrary MAC addresses, you must use the above format.
So long as you choose a value for XX:YY:ZZ that is unique among your hard-coded addresses (where XX is a valid hexadecimal number between 00h and 3Fh, and YY and ZZ are valid hexadecimal numbers between 00h and FFh), conflicts between the automatically assigned MAC addresses and the manually assigned addresses should never occur.
I wish to distribute a VMWare VM for users (who are technically challenged and unable to install a complex product). Users may run several instances of the VM in their environment, so it's essential that each VM have NIC's with unique MAC addresses.
Esxi Mac Mini
Is there a way to distribute the VM in such a way that on first boot if forces new MAC addresses onto the NIC's?
If users just add the VM to their inventory and select 'moved' instead of 'copied' then they get the same MAC's (I believe).
I'm using VMWare WOrkstation 12 in case that matters.
TSGTSG1 Answer
The canonical 'correct' way to distribute VM images for VMware vSphere is to distribute .ova files created using ovftool, and then use the vSphere GUI to install the .ova file. This automatically distributes a 'copied' version of the virtual machine that has a different MAC address when deployed. However, there is a way to do the job if you're going to instead distribute a zipped up VMware Workstation directory. What you need to do is, immediately before you zip up the directory, is first copy the .vmx file someplace else. Then edit the vmx file and look for a line that looks like
Remove that line from the vmx file.
Then zip it up and distribute it. That should give you copy of the virtual machine that does not have a built in MAC address and that should generate a new MAC address upon deployment. (This is assuming a VM with a single Ethernet interface). Then copy the original .vmx file back into place.
Note that for certain operating systems, such as Red Hat Enterprise Linux 6, there are udev rules that tie a specific Ethernet interface to a specific MAC address. These must be removed to allow eth0 to come up after the deployment. If your operating system is one of those, that is a separate question.