Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm using VMWare to emulate Ubuntu on my Leopard Mac OS X.

The IP address changes everytime I put the Mac to sleep.

I was wondering if I can avoid that.

share|improve this question
    
You're virtualizing Ubuntu, not emulating it... just for correctness :-) –  Josh Dec 30 '10 at 18:59

2 Answers 2

up vote 3 down vote accepted

You can do this -- just configure the Ubuntu virtual machine with a static IP. The choice of IP will depend on the network you're connecting to... You didn't mention if you were using a NAT or Bridged connection, and the choice of IP will different based on that. I can provide specific instructions if you like, but, they'll be all things you do within the Ubuntu VM, not within the Mac environment. (So you may find better luck asking on http://askubuntu.com or http://unix.stackexchange.com/)

You could also install the "avahi-daemon" package in Ubuntu and then you won't need to remember the VM's IP address, you can use vm-hostname.local as if it were a Mac with Bonjour.

EDIT: I see you're using a NAT interface. I typed up a long list of instructions only got get stuck on the final step. I'll do more research into this, but in the meantime, here's some instructions which I have not tested, but might work on the Mac side...

Here's incomplete instructions, I will finish them up shortly:

VMware Susion starts assigning IPs via DHCP at .128 (at least on my machine). The first three octets of the IPs are defined by a network probe which happened when you installed VMware, so you'll want to determine what network VMware chose for you, and then choose an IP underneath the range VMware assigns via DHCP to avoid conflicts:

  1. Determine what network VMware chose: In the Ubuntu Virtual Machine, choose System > Administration > Network Tools. In the window that appears, under "Network Device", choose "Ethernet Interface (eth0)". In the list below, look for "IPv4". Look at the IP address in the right hand column, and make note of the first three octets (numbers between the dots). On my machine, this is: 172.16.1

  2. Choose a new static IP: You can make up any number from 2 to 127 which will be appended to the network from step 1, as long as it doesn't conflict with any other static IPs you have assigned. Let's say you choose 15, because I like the number 15. In my example your static IP would then be 172.16.1.15.

  3. Configure Ubuntu to use a static IP: Go to System > Preferences > Network Connections in the Ubuntu VM. Under "Wired" choose "Auto eth0" and click "edit". Go to "IPv4 Settings" and set "Method:" to "Manual". Next to "Addresses", click the "Add" button. In the new row that appears, under "Address", enter the IP you close (172.16.1.15 in my example). Under Netmask, enter 255.255.255.0. Under gateway, enter the first three octets of your IP, followed by .1. (In my example, the gateway would be 172.16.1.1). Under DNS Servers, enter... oh, crap, this is being provided by DHCP. Let me figure out a way to make this work :-/

share|improve this answer
    
I'm using NAT connection. So what are the necessary steps ? –  Patrick Dec 31 '10 at 14:47
    
@Patrick: I am almost done with instructions, but got stuck. Look for an update soon! –  Josh Dec 31 '10 at 18:07
    
thanks very very much for your time. I will wait for the complete version! –  Patrick Jan 1 '11 at 14:37

To complement on Josh’s post, the answer is yes, but it depends.

Technically speaking, any OS inside a VM has direct access to either the network card or a private network created by the host OS. In either case, you can configure your VM to have any IP address you want.

Now I assume you want to have your VM with the same IP all the time, so you should switch to bridged connection, which will make the VM believe that it has a dedicated network card that you can later configure as you please. In fact, for the rest of the network, the machine will be a regular computer. VMWare will take care of the virtualization and the virtual Network Card (NIC).

share|improve this answer
    
So I'm using NAT connection. So if I've understood well, It is not about VMWare configuration but about Ubuntu network configuration.. I can ask on ubuntu forums ? –  Patrick Dec 31 '10 at 14:48

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.