VMware

This Question is Answered

2 "helpful" answers available (6 pts)
9 Replies Last post: Feb 3, 2009 10:44 AM by DeepakG  

DHCP reservations please posted: Dec 28, 2007 3:09 AM

Click to view hankhero's profile Novice 5 posts since
Dec 28, 2007

Running under NAT, it would be nice to know that the virtual machine I use daily always get the same IP adress from the Fusion dhcp server.

This feature is known as DHCP Reservations on my router, but I prefer it directly with Fusion.

"DHCP Reservations allow the DHCP server to associate a fixed IP address with a specific MAC address."


Is this possible? Or is there some known workaround? I mainly use a VM with Xubuntu 32 bit.

Otherwise regard it as an important feature request.

Kind regards,

Henrik

Re: DHCP reservations please

1. Dec 30, 2007 3:33 AM in response to: hankhero
Click to view WoodyZ's profile Guru 10,128 posts since
Apr 22, 2004
hankhero wrote:
Running under NAT, it would be nice to know that the virtual machine I use daily always get the same IP adress from the Fusion dhcp server.

This feature is known as DHCP Reservations on my router, but I prefer it directly with Fusion.

"DHCP Reservations allow the DHCP server to associate a fixed IP address with a specific MAC address."

Just curious, what is the Make, Model and Version of the Router you're using?

Since your using a Router you do not need to use NAT on the VM's Network. Just set the VM's Network to Bridged and then configure the NIC at the OS Level using an IP Address that is outside the Scope of the Router's DHCP Server IP Address Pool while supplying the appropriate Subnet Mask, Gateway and DNS Server(s) IP Addresses as well.

Re: DHCP reservations please

3. Dec 30, 2007 11:13 AM in response to: hankhero
Click to view rcardona2k's profile Champion 5,198 posts since
Oct 20, 2005
You can add a static mapping for your VM's MAC address via NAT by editing dhcpd.conf in /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf

The syntax is:

# Assign a static IP to Xubuntu

host xubuntu {
hardware ethernet 00:0C:29:XX:YY:ZZ;
fixed-address 1x2.168.xxx.yyy;
}

You must restart the dhcpd server easily by running sudo boot.sh --restart in the VMware Fusion directory above. If Xubuntu has the IP you want already, it should keep it.

Re: DHCP reservations please

4. Dec 30, 2007 11:11 AM in response to: hankhero
Click to view WoodyZ's profile Guru 10,128 posts since
Apr 22, 2004

hankhero wrote: The problem with using the router for this is that I have a MacBook and I want to take it out of the office sometimes Then the IP address will be wrong again. That is why I would like VMWare to have a similar feature. This is a very useful feature for software development when you want to simulate several servers and clients, probably really easy to implement for VMWare as well.

I doubt that feature is one that will come anytime soon as there are far to many features more important to larger groups of users that will probable get implemented first.

I don't use Xunbuntu but I'd imaging you could create some scripts with various different network configurations to automate the process on the OS side. On my Windows Notebooks and Windows VM's on my MBP, I use a VB Script that defines all the different Network Configurations I need and an based on which Network Environment I'm in and I just run the Script with the appropriate argument and it reconfigures the NIC on-the-fly without having to reboot. Very easy and simple solution to having to work within multiple Network Environments.

Re: DHCP reservations please

5. Dec 31, 2007 7:30 AM in response to: rcardona2k
Click to view _henrik's profile Lurker 3 posts since
Dec 23, 2006
Thanks a lot, that looks perfect! There are lot of hidden features in the config files :)

Re: DHCP reservations please

7. Feb 3, 2009 12:03 AM in response to: hankhero
Click to view DeepakG's profile Lurker 2 posts since
Feb 2, 2009
Hi Folks,

This doesn't seem to work for me - I am on Ubuntu 8.10 (guest) and VMWare Fusion 2 (host). The guest keeps getting a new IP address and not the static one that I specified in the dhcp.conf file. This is what my dhcp.conf file looks like:

allow unknown-clients;
default-lease-time 1800; # 30 minutes
max-lease-time 7200; # 2 hours

subnet 172.16.55.0 netmask 255.255.255.0 {
range 172.16.55.128 172.16.55.254;
option broadcast-address 172.16.55.255;
option domain-name-servers 172.16.55.2;
option netbios-name-servers 172.16.55.2;
option domain-name "localdomain";
option routers 172.16.55.2;
}

host Ubuntu {
hardware ethernet 00:0c:29:a6:7e:77;
fixed-address 172.168.55.137;
}

I've double checked the value of the MAC address. I've also tried deleting the existing leases under /var/db/ on host and /var/lib/dhcp3/ on guest

For now I've given a static value to the guest manually. What could I be doing wrong?

Thanks,
Deepak

Re: DHCP reservations please

8. Feb 3, 2009 9:01 AM in response to: DeepakG
Click to view etung's profile Guru 11,086 posts since
Oct 15, 2006
Not sure if this is what's going wrong, but the DHCP server gives out addresses in the range 172.16.55.128-254 and you're specifying a fixed address of 172.168.55.137.

Re: DHCP reservations please

9. Feb 3, 2009 10:44 AM in response to: etung
Click to view DeepakG's profile Lurker 2 posts since
Feb 2, 2009
Ouch, that was a stupid mistake on my part. Thanks for replying. I fixed the typo and it works like a charm now.

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities