Changing the MAC address of a hosted virtual machine
search cancel

Changing the MAC address of a hosted virtual machine

book

Article ID: 324973

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor

Issue/Introduction

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).


Environment

VMware Player 3.x (Windows )
VMware ACE 2.6.x
VMware Workstation 6.x (Linux)
VMware Player 4.x (Linux)
VMware Player 6.x (Linux)
VMware Workstation 8.x (Linux)
VMware Player 5.x (Windows)
VMware Workstation Pro 12.x (Linux)
VMware Workstation 10.x (Windows)
VMware Workstation 6.x (Windows)
VMware Workstation Pro 14.x (for Windows)
VMware Workstation 7.x (Windows)
VMware Workstation 9.x (Linux)
VMware Workstation Player 14.x (Windows)
VMware ACE 2.5.x
VMware Workstation 11.x (for Linux)
VMware Workstation Player 14.x (Linux)
VMware Workstation 9.x (Windows)
VMware Player 6.x (Windows)
VMware Player 3.x (Linux)
VMware Workstation 8.x (Windows)
VMware Player 4.x (Windows)
VMware Workstation Player 12.x (Windows)
VMware Player Pro 7.x (Linux)
VMware Workstation 7.x (Linux)
VMware Player 7.x (Windows)
VMware Player 5.x (Linux)
VMware Player Pro 7.x (Windows)
VMware Workstation Player 12.x (Linux)
VMware Workstation 11.x (for Windows)
VMware ACE 2.7.x
VMware Workstation Pro 14.x (for Linux)
VMware Workstation 10.x (Linux)
VMware Player 7.x (Linux)
VMware Workstation Pro 12.x (Windows)

Resolution

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:

ethernetN.generatedAddress
ethernetN.addressType
ethernetN.generatedAddressOffset
uuid.location
uuid.bios
ethernetN.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 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 .cfg extension.

  1. Open the virtual machine's .vmx configuration 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).
     
  2. Remove the three lines from the configuration file that begin with:

    ethernetN.generatedAddress
    ethernetN.addressType
    ethernetN.generatedAddressOffset

     
  3. 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”

     
  4. Save the configuration file.

In this example, XX must be a valid hexadecimal number between 00h and 3Fh, and YY and ZZ must be valid hexadecimal numbers between 00h and 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 .vmx:

ethernetN.addressType = “static”
ethernetN.address = “

 

where N is the adapter being changed.
 
 
For translated versions of this article, see: