I looked at How to assign a static IP address to my VMWare machine? and didn't find an answer:

I am running VMware Fusion on Mavericks with an Ubuntu Saucy guest, the guest connected to the network via NAT. I want to shell into the guest and browse a Django site I am developing. But every ?few hours?, the guest IP changes, disrupting my ssh connections.

How do I ask the host's VMware Fusion (?or the guest?) to assign and stay with a static IP for the guest? t


root@ubuntu:/home/christos/dashboard# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0c:29:86:f7:de  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::20c:29ff:fe86:f7de/64 Scope:Link
          RX packets:8938 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4875 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:873521 (873.5 KB)  TX bytes:890704 (890.7 KB)

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6856 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6856 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:581528 (581.5 KB)  TX bytes:581528 (581.5 KB)
  • please post the output of ifconfig on the guest – MariusMatutiae Dec 27 '13 at 20:45

You do it as if this were a real machine. It depends on the OS, but in Ubuntu all you have to do is to replace, in the file /etc/network/interfaces, these two lines

   auto eth0
   iface eth0 inet dhcp

with these:

   auto eth0 
   iface eth0 inet static
    up ip route add default via 
    down ip route del default via

This stanza is suitable for one of my pcs, which means you will have to adapt address, gateway, netmask, dns nameservers. As for the up/down lines, they automatically set up your routing table, you will have to substitute the IP address of your gateway.

  • Thank you; it keeps the specified address with my 172.x.x.x adaptation. It now loads and serves ssh and the Django application. Is this a sign I've used the wrong VMware network? – Christos Hayward Dec 27 '13 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.