ESX – Options for setting a static MAC in a VM

Along the way you might run into a P2V (or need to build a new VM) that will host an application which has a license attached to it’s NIC. In order to do this, you generally need to provide the software vendor the MAC address to your VM. That being said, it’s important to ensure that the MAC address never changes. This can be accomplished 2 ways.

The first option is by setting a new static MAC  at the VM level. VMware has made this possible by blocking out a range that can be used for static addresses: 00:50:56:00:00:00 to 00:50:56:3F:FF:FF  

The first three octets of any MAC address are a unique code assigned to each NIC vendor.  This is also known as an Organizationally Unique Identifier or OUI.  VMware uses an OUI of 00:50:56 . The last 3 octets can be any combination as long as that combination is unique on your network. If using a VMware static MAC, you must also stay inside the range mentioned above.

  1. Power off the VM and then remove it from the Virtual Center inventory. If you do not remove the VM from the Virtual Center inventory, VC will overwrite the changes you’ll make below when you power the VM back on. This step is necessary!
  2. Edit the VM .vmx file (either via the datastore browser, or via an SSH session on your host) and locate the already pre-existing generated MAC address:
    EthernetX.addressType =
    and
    EthernetX.generatedAddress =
    where X is the number of your ethernet adapter
  3. Change the value for EthernetX.addressType from ”vpx” to “static”
  4. Change EthernetX.GeneratedAddress to EthernetX.Address
  5. Change the current MAC to a new static MAC address using the allowed range I mentioned above
  6. In Virtual Center, select your ESX host and browse the datastore the VM your working on is located in
  7. Right-click on the .vmx file, and select “Add to inventory”
  8. Power on the VM. Issue the command “ipconfig /all” and verify the manually assigned MAC address

Tip: Run-Virtual.com has published a pretty nice tool that allows you to set the MAC address of your VMs. I’ve never personally used this tool, but have read good things about it.

The second option is to set the MAC address from within the guest operating system. This would be necessary if you were doing a P2V in which the MAC of the physical NIC is attached to your application license, and you simply can’t change to a new static MAC. In the case of  Windows Server 2003, changing the MAC address is as simple as modifying the “networkaddress” field within the properties for the NIC. Changing this address will override any setting at the VM level. Keep in mind that if you are going to use the same MAC as that of a physical adapter, that adapter can no longer be used in your environment at the same time.

Share and Enjoy:
  • Print
  • Digg
  • Google Bookmarks
  • email
  • LinkedIn
  • RSS
  • PDF
  • Facebook
  • Twitter
  • Yahoo! Buzz
  • StumbleUpon
  • del.icio.us

Tags: , , , , , , , , , , , , , , ,

Leave a Reply

Spam Protection by WP-SpamFree