Knowledge Base

Search the Knowledge Base: |
Search the Knowledge Base: |
Changing the MAC Address of a Virtual Machine
Details
Solution
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:
In these options, N is the number of the virtual Ethernet adapter, for example ethernet0.ethernetN.generatedAddress ethernetN.addressType ethernetN.generatedAddressOffset uuid.location uuid.bios ethernetN.present
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.
For more information about editing a virtual machine's configuration file (.vmx), see www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1714.
Manually Assigning a MAC Address in Workstation and GSX Server
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:
Add the following line to the configuration file:ethernetN.generatedAddress ethernetN.addressType ethernetN.generatedAddressOffset
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.ethernetN.address = 00:50:56:XX:YY:ZZ
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.
Manually Assigning a MAC Address in ESX Server
In order to work around both the limit of 256 virtual network adapters per physical machine and possible MAC address conflicts between virtual machines, the MAC addresses can be assigned manually by system administrators. VMware uses a different OUI for manually generated addresses: 00:50:56. The MAC address range is 00:50:56:00:00:00-00:50:56:3F:FF:FF.
You can set the addresses by adding the following line to a virtual machine's configuration file:
ethernetN.address = 00:50:56:XX:YY:ZZ
ethernetN.address = 00:50:56:3F:FF:FF
ethernetN.addressType="static"
Keywords
Feedback
- KB Article: 507
- Updated: Aug 14, 2009
- Products:
VMware ESX
VMware GSX Server
VMware Workstation

