23 February 2013

VMware VM - changing the MAC address

The conversion of physical to virtual machine is related to change of the MAC address of the network interface. In some cases this can be a problem when software is installed where the licensing is bound up to the MAC address. To avoid the automatic change of MAC address, you should not move the machine (configuration file of VM) to another host or different datastores on the same host.
If the VM is a member in a DRS cluster and automatically or manually movement between different hosts is needed, then we must set up MAC to static and we can achieve this in few ways.

Method #1. vSphere Client




If your attempt failed with the error below - go to method 3
“The MAC address entered is not in the valid range. Valid values are between xx:xx:xx:xx:xx”

Method #2. MAC address change from within the network adapter settings in Windows.
First of all ensure that vSwitch (virtual port group) security settings MAC Address Changes and Forged Transmits are set to

Accept. Go to your network adapter properties (see the picture below)

 

Select Locally Administered Address -> Value and enter the MAC address without the colon (:).
Restart the virtual machine to ensure that the change takes effect over the network.
If not succeed run command getmac from Windows command prompt
If the option Locally Administered Address (for Intel Pro/1000MT) is unavailable and can not change the MAC address - go to method 3

Method #3. Edit the VM's config file .vmx manually using plain text editor. Download the .vmx configuration file for the virtual machine to your desktop using the Datastore Browser. Open with text editor and delete the following from the vmx file

ethernetN.generatedAddress
ethernetN.addressType
ethernetN.generatedAddressOffset


To change the MAC address to a non-vmware address (in my case MAC address of h/w NIC) add these lines to the .vmx:

ethernetN.checkMACAddress = “false”
ethernetN.addressType = “static”
ethernetN.address = “address here”


Save the configuration file and upload with  Datastore Browser

Need to know notes for manual editing process :
- Never edit vmx file while virtual machine is running (power off vm)
- Always make backup copy before editing – you need a plan B if something goes wrong.
- ESXi with vCenter Server - manual changes are overwritten by the entries stored in the vCenter Server database, therefore remove virtual machine from inventory before editing.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.