Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

--EDIT--

root@ubuntu:/home/christos/dashboard# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0c:29:86:f7:de  
          inet addr:172.16.144.203  Bcast:172.16.144.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe86:f7de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          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:127.0.0.1  Mask:255.0.0.0
          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)
share|improve this question
    
please post the output of ifconfig on the guest –  MariusMatutiae Dec 27 '13 at 20:45
add comment

1 Answer 1

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
    address 192.168.1.7
    netmask 255.255.255.0
    gateway 192.168.1.254
    dns-nameservers 8.8.4.4 8.8.8.8
    up ip route add default via 192.168.1.254 
    down ip route del default via 192.168.1.254

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.

share|improve this answer
    
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? –  Jonathan Hayward Dec 27 '13 at 19:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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