Assumption: the VM is running a DHCP client and is assigned a dynamic IP by the DHCP service running on the host. My host machine is runs on Windows 7 Ultimate x64 with VMware Workstation 8.
Open C:\ProgramData\VMware\vmnetdhcp.conf as Administrator. This file follows the syntax of dhcpd.conf. Add the following lines (change host name, MAC, IP appropriately – these are shown in a different colour) under the correct section (for me it was for a NAT based network – VMnet8). The MAC can be found from the VM’s properties.
host ubuntu {
hardware ethernet 00:0C:29:16:2A:D6;
fixed-address 192.168.84.132;
}
hardware ethernet 00:0C:29:16:2A:D6;
fixed-address 192.168.84.132;
}
Restart the VMware DHCP service. Use the following commands from an elevated prompt:
net stop vmnetdhcp
net start vmnetdhcp
net stop vmnetdhcp
net start vmnetdhcp
On the VM, acquire a new lease using the below command (if VM runs Linux):
ifconfig eth0 down
ifconfig eth0 up