Changing the MAC address of a hosted virtual machine (507)
This article provides steps to change the MAC address of a hosted virtual machine.
For an ESX/ESXi virtual machine, see Setting a static MAC address for a virtual NIC (219).
For a Fusion virtual machine, see Setting a MAC address for a virtual machine in VMware Fusion (1003479).
When a virtual machine is powered on, the VMware application automatically assigns it a MAC address. The software guarantees that virtual machines are assigned unique MAC addresses within a given host system. However, the software does not guarantee that a given virtual machine is assigned the same MAC address every time it is powered on. In addition, the VMware application does its best, but cannot guarantee, to automatically assign unique MAC addresses for virtual machines running on multiple host systems. A conflict may arise, for example, if the virtual network adapters on different physical servers share the same subnet and are assigned the same MAC address.
Avoiding MAC Address 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 options:
In these options,
N is the number of the virtual Ethernet adapter. For example,
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 be assigned a new MAC address.
Manually Assigning a MAC Address
To guarantee that the same MAC address is assigned to a given virtual machine every time, even if the virtual machine is moved, or 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
- Open the virtual machine's
.vmxconfiguration file with a text editor. For more information about editing a virtual machine's configuration file (
.vmx), see Tips for editing a .vmx file (1714).
- Remove the three lines from the configuration file that begin with:
- Add a new static MAC address line to the configuration file with help of the following entries:
ethernetN.address = "00:50:56:XX:YY:ZZ"
ethernetN.addressType = “static”
- Save the configuration file.
In this example,
XX must be a valid hexadecimal number between
ZZ must be valid hexadecimal numbers between
FFh. VMware Workstation and Fusion virtual machines do not support arbitrary MAC addresses, you must use this format.
As long as you choose a value for
XX:YY:ZZ that is unique among your hard-coded addresses, conflicts between the automatically assigned MAC addresses and the manually assigned addresses should never occur.
To change the MAC address to a non-vmware address (in the case of a P2V where software on the PC is licensed against the original MAC address) add these lines to the
ethernetN.addressType = “static”
ethernetN.address = “<address>”
Nis the adapter being changed.