Sunday, July 15, 2012

Static IPs for Ubuntu Server 12.04 guest in VMware Player

If you want your Ubuntu 12.04 guest VM to have a static IP, you can do the following:
  • Use the NAT mode in the VMware network settings (Virtual Machines > Virtual Machine Settings > Network Adapter > NAT)
  • In Ubuntu, edit /etc/network/interfaces with your favourite editor (I use VIM) to add some configuration lines — check out the "Static IP Address Assignment" section in 
  • For example, I use the following:
    auto eth0
    iface eth0 inet static
  • Make sure that the Virtual Network Editor settings for VMnet8 (NAT) match your static ip, e.g., the Subnet IP is consistent with your static IP. If you are running VMware Player and don't already have the Virtual Network Editor installed, take a look at this post for instructions on how to install it for free. 
  • Most importantly, make sure the gateway / DNS relay is set to I had tried changing it to, but that address is reserved for the VMnet8 adapter. It took me a while to figure out how VMware networking works, but it all made sense after reading this fantastic primer by RedNectar! Incidentally, the last IP in your DHCP range is reserved for the DHCP server, so don't set it to that either.
Have fun!

1 comment:

Anonymous said...

Thank you!

The main point was to figure out the gateway is at .2 and works like a charm on any OS, not just Ubuntu