VMware vSphere

 View Only
  • 1.  Static IP of VM becoming dynamic on reboot

    Posted Dec 11, 2009 11:03 AM

    Hi All,

    I am hosting one Windos VM on ESX 4. I have made the IP of this VM as static one.But upon reboot I am seeing that this IP is becomingDHCP enabled.

    Here are the contents of my vmx file:

    ethernet0.present = "true"

    ethernet0.networkName = "sdaervers"

    ethernet0.addressType = "vpx"

    ethernet0.generatedAddress = "00:50:56:82:0f:5b"

    guestOSAltName = "Microsoft Windows Server 2003, Standard Edition (32-bit)"

    guestOS = "winnetstandard"

    Why it is happening? any pointers will be highly appreciated.

    Thanks,

    Victor



  • 2.  RE: Static IP of VM becoming dynamic on reboot

    Posted Dec 11, 2009 07:15 PM

    Correct me if I'm wrong, but nothing in the VMX file will determine if a guest OS uses DHCP or not. If you've set a static IP in Windows, but Windows reverts to DHCP, then it's someting wrong in Windows. Windows restoring the Registry on reboot, perhaps?

    Or do you have a independent non-persistent disk? I believe it will survive a warm reboot of the guest, but a power off cold reboot, the disk will revert to the previous state.



  • 3.  RE: Static IP of VM becoming dynamic on reboot

    Posted Dec 14, 2009 11:03 AM

    Hi[ Asatoran|~151530] Thanks for your reply.Yes you are right vmx file doesnt conatin any parameter for IP address. but it does contain for MAC. I am not sure what will happen when we change ethernet0.addresstype = vpx or generated or static.I have read some where that in case of "generated" option,vcenter os free to assign any MAC id and IP to VM.One more thing I forgot to mention in earlier posts,that this VM is cloned VM . Is it possible that IP properties are getting changed through this parameter? Please help me out.Thanks,Victor



  • 4.  RE: Static IP of VM becoming dynamic on reboot

    Posted Dec 14, 2009 02:36 PM

    Also STATIC is ALWAYS local to the OS, NOT the system. Setting a MAC address on VM WAre is a RESERVED IP NOT STATIC. You are just telling the DHCP server, when it sees that MAC to always reserve the SAME IP each time, that's one way to do a a static.

    But a TRUE static is to set the IP INSIDE Windows VM, that way without doubt it will always attempt to use the SAME IP, regardless of what is going on with the System / VM Ware host.



  • 5.  RE: Static IP of VM becoming dynamic on reboot

    Posted Dec 14, 2009 07:14 PM

    ...Yes you are right vmx file doesnt contain any parameter for IP address. but it does contain for MAC. I am not sure what will happen when we change

    As RParker said, you can configure your DHCP server to assign a specific IP address to a specific MAC addresss (a.k.a. reservation.) But if you do not configure your DHCP server to do so, then there is no guarantee that you will get the same IP address on each boot of the guest virtual machine.

    One more thing I forgot to mention in earlier posts,that this VM is cloned VM. Is it possible that IP properties are getting changed through this parameter?

    If both virtual machines have the same MAC address, this will cause issues if both virtual machines are powered up on the same LAN at the same time. So set the VMX on each virtual machine to give different MAC addresses, unless you can guarantee that they won't be powered on at the same time or will be on different LAN segments. But realized that doing so has nothing to do with IP addresses unless you also set reservations on the DHCP server. Depending on your network environment, to may be easier to set DHCP reservations or it may be easier to manually set the IP in Windows.



  • 6.  RE: Static IP of VM becoming dynamic on reboot

    Posted Dec 11, 2024 04:16 PM

    Well you can do that:

    Open .vmx file with a text editor, and add the following fields. Replace the MAC address field with your own.

    ethernet0.addressType = "static"
    ethernet0.checkMACAddress = "false"
    ethernet0.address = "00:0c:29:1f:4b:ac"




  • 7.  RE: Static IP of VM becoming dynamic on reboot

    Posted Dec 11, 2024 04:15 PM

    https://www.xmodulo.com/static-mac-address-vmware-esxi-virtual-machine.html

    Open .vmx file with a text editor, and add the following fields. Replace the MAC address field with your own.

    ethernet0.addressType = "static"
    ethernet0.checkMACAddress = "false"
    ethernet0.address = "00:0c:29:1f:4b:ac" or whatever Mac you need...