VMware Communities > VMTN > VMware Infrastructure™ > VI: ESX 3.0 > Discussions

This Question is Answered

2 "helpful" answers available (6 pts)
1 2 Previous Next
22 Replies Last post: Nov 14, 2008 2:21 PM by SuryaVMware
Reply

Change MAC address of VM to whatever MAC I want

Nov 14, 2008 7:50 AM

Click to view saldon's profile Novice saldon 16 posts since
Dec 4, 2007

I have a Windows 2003 Server guest that I migrated from a VMware Server to an ESX Server. In the migration the MAC address was changed. This is a real problem since this is a licensing server and the license keys are based on the MAC address. I'd like to manually set the address back to what it originally was when the guest was on my VMware Server host. I've seen where I can go into the settings and manully define a MAC address via the GUI but it will not allow me to change the first 3 octets from the ESX default.

Can I, and if so, how do I change the MAC address? Can I just log into the console on the ESX server and edit the settings manually? I know I could just request new keys based on the new MAC address but this is not a trivial process. Just fixing the MAC would be much faster. Thanks.

  • Tom
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 8:11 AM
Click to view SuryaVMware's profile Expert SuryaVMware 489 posts since
Nov 14, 2008

Tom,

What virtual NIC the VM has? I am assuming you have a 32 bit Windows 2003, if so you should be having a VMXNet (the gigabit virtual adapter) inside the VM.

if so, you could to to device manger and expand the "Network Adapters" and select the NICgo to Properties then to the "Advanced" tab. You should see a Property called "Machine Address" or "Physical Address" with no value in it. go ahead and add the custom MAC there. Let me know if this helps.

Regards,

Surya


Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 9:53 AM
Click to view RParker's profile Champion RParker 4,845 posts since
Dec 6, 2006
You can only have a MAC in the range 00:50:56:00:00:01 - 00:50:56:00:00:99

You are probably going to have to get new keys.
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 9:52 AM
in response to: RParker
Click to view Jasemccarty's profile Champion Jasemccarty 3,774 posts since
Apr 5, 2005

Has something changed?

I thought the range was -

From: 00:50:56:00:00:00
To: 00:50:56:3F:FF:FF


Jase McCarty
http://www.jasemccarty.com
Co-Author of VMware ESX Essentials in the Virtual Data Center
(ISBN:1420070274) from Auerbach

Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 9:55 AM
in response to: Jasemccarty
Click to view RParker's profile Champion RParker 4,845 posts since
Dec 6, 2006
Jasemccarty wrote:
Has something changed?

I thought the range was -

From: 00:50:56:00:00:00
To: 00:50:56:3F:FF:FF


Well maybe, I did this way back when in ESX 3.02, and you could only have 100 manually Assigned MAC, so maybe they did increase the range.

Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 9:59 AM
in response to: Jasemccarty
Click to view RParker's profile Champion RParker 4,845 posts since
Dec 6, 2006

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 \\

Here, N refers to the number of the Ethernet adapter, XX is a
valid hex number between 00 and 3F, and YY and ZZ are valid hex numbers
between 00 and FF. The value for XX must not be greater than 3F in
order to avoid conflict with MAC addresses that are generated by the
VMware Workstation and VMware GSX Server products. Thus the maximum
value for a manually generated MAC address is
ethernetN.address = 00:50:56:3F:FF:FF \\

You must also set the option in a virtual machine's configuration file:
ethernetN.addressType="static" \\

VMware ESX Server virtual machines do not support arbitrary MAC
addresses, hence the above format must be used. So long as you choose
XX:YY:ZZ uniquely among your hard-coded addresses, conflicts between
the automatically assigned MAC addresses and the manually assigned ones
should never occur.
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:00 AM
in response to: RParker
Click to view SuryaVMware's profile Expert SuryaVMware 489 posts since
Nov 14, 2008

Well you are correct in the sence if you are planning to change the MAC at the Virtualization layer. but what i am proposing is the change from with in the Guest. like you do in linux with ifconfig.

so that the pice of software that is working inside the VM continues to work as it thinks it still have the old MAC.

-Surya

Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:01 AM
in response to: RParker
Click to view Jasemccarty's profile Champion Jasemccarty 3,774 posts since
Apr 5, 2005
That's strange... I started using that range back in the ESX 2.1 days...

Jase McCarty
http://www.jasemccarty.com
Co-Author of VMware ESX Essentials in the Virtual Data Center
(ISBN:1420070274) from Auerbach
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:13 AM
in response to: Jasemccarty
Click to view RParker's profile Champion RParker 4,845 posts since
Dec 6, 2006
That's strange... I started using that range back in the ESX 2.1 days...

OK, I am wrong then. I only did it once or twice, but found it quite a hassle to keep up with.
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:14 AM
in response to: SuryaVMware
Click to view RParker's profile Champion RParker 4,845 posts since
Dec 6, 2006

SuryaVMware wrote:
Well you are correct in the sence if you are planning to change the MAC at the Virtualization layer. but what i am proposing is the change from with in the Guest. like you do in linux with ifconfig.

so that the pice of software that is working inside the VM continues to work as it thinks it still have the old MAC.

-Surya

Well that may work but if it does, that would be an easy way to get around the MAC limitation for some software, so if it's been that easy all along... wouldn't they find a way to prevent this? If this is true.. this is one of those 'hidden' secrets.
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:20 AM
in response to: RParker
Click to view SuryaVMware's profile Expert SuryaVMware 489 posts since
Nov 14, 2008

RParker,

The situation here is this guy migrated a VM from a VMwar Server to ESX server. The VM has some license server running with is MAC bound.

He would have had a MAC with "00:0c:29" while the VM is running on VMware server naturally the license server with in the VM is bound to that MAC. However, you will not be able to assign a hosted (Workstation , VMware Server and Fusion) MAC address ranges to a ESX VM as static MAC.

This guy needs to use the MAC address which the VM had earlier wihile it is running on VMware Server. The only way to deal this situation is not to do any thing at the Virtualization layer ( no editing the .vmx file) and workout this issue at a Guest OS level.

-Surya

Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 11:42 AM
in response to: RParker
Click to view Jasemccarty's profile Champion Jasemccarty 3,774 posts since
Apr 5, 2005
Actually what I do is... I have VM's use DHCP for their IPs.

I have a spreadsheet where I dynamically calculate mac addresses, depending on the IP I want. I use the last 3 octets to create a mac with.

Now, because I cannot modify the 00:50:56 piece, I only have 3 pieces to work with. And because 3F is 63, I'm lucky that I don't have a network where the 2nd octet is greater than 63.

Let me give an example:

  1. I want the VM to have the IP of x.37.203.98
  2. I calculate, via an Excel formula, the mac address to be 00:50:56:25:CB:62
  3. I then have a DHCP reservation for 00505625CB62 as x.37.203.98
  4. I used this command line in a batch for each mac address I want to add it to DHCP:
    NETSH DHCP SERVER SCOPE x.37.203.0 add reservedip x.37.203.98 00505625CB62 VMNAME
  5. Keep in mind that the x. would have to be a valid octet
As a result, when I spin up a VM, I look at my sheet, and I always have a mac address tied to an IP, and it works out pretty well.

The VM powers up, and automagically grabs the IP that I want, and I have some flexibility, as if I want to change settings (netmask/etc) I only have to do it in DHCP.

Jase

Jase McCarty
http://www.jasemccarty.com
Co-Author of VMware ESX Essentials in the Virtual Data Center
(ISBN:1420070274) from Auerbach
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:46 AM
in response to: SuryaVMware
Click to view Jasemccarty's profile Champion Jasemccarty 3,774 posts since
Apr 5, 2005
Given that the OP is wishing to migrate to ESX, the OP needs to contact whatever vendor of the software that is tied to the mac address, and see if they will change it.

We have had that issue here before, and most vendors have been fairly accomodating.

Jase McCarty
http://www.jasemccarty.com
Co-Author of VMware ESX Essentials in the Virtual Data Center
(ISBN:1420070274) from Auerbach

Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 10:57 AM
Click to view azn2kew's profile Virtuoso azn2kew 2,245 posts since
Jun 21, 2006
Can you use free tools from www.run-virtual.com which is call MAC Management tool and it works really good.

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

Regards,

Stefan Nguyen
iGeek Systems Inc.
VMware, Citrix, Microsoft Consultant
Reply Re: Change MAC address of VM to whatever MAC I want Nov 14, 2008 11:09 AM
in response to: SuryaVMware
Click to view SuryaVMware's profile Expert SuryaVMware 489 posts since
Nov 14, 2008
It is no hidden secret http://communities.vmware.com/images/emoticons/blush.gif. VMware has nothing to do with this since this is a totally controlled by Guest OS. Infact you could do this in the Physical environment too as long as the Driver for your NIC supports the option to change the MAC address. works well all the time for me. VMware's vmxnet supports the change of MAC that all about it.

Well that may work but if it does, that would be an easy way to get
around the MAC limitation for some software, so if it's been that easy
all along... wouldn't they find a way to prevent this?

The is nothing for VMware to prevent this. Allowin custom MAC is done by lot of vendors. Like I said the driver should support. As far as the security for MAC restrected software is concernd, yes it is a problem the vendors have to get a smart way of licensing the systems ;) :p ;) :8}

-Surya

1 2 Previous Next
Actions