VMWare Fusion NAT
This is to correct an earlier omission and provide instructions for configuring static and dynamic IP addresses for Virtual Machines runing on VMWare Fusion on Mac OS X. The benefit of static IP address is important for those installing multiple development and test instances of Oracle Databases in virtual environments.
Back in September 2008, I blogged about how to configure the Oracle Client 10g on Mac OS X. It’s been used a lot but in hindsight it could have been organized more effectively. One thing that I noticed (through somebody bringing it to my attention) is that explaining the VMWare Fusion component by itself would have been more helpful then listing the IP ranges for releases through the date of my post. Hopefully, this corrects that omission.
VMWare NAT Configuration
There are only a few steps that you must do. These are they:
- Read the subnet value from the
dhcpd.conffile. - Dynamic IP address only require you to set the guest operating system to DHCP.
- Static IP addresses require you to set the IP address, subnet, default gateway, and preferred DNS server.
- Add assigned IP address and the guest operating system
hostnameto your Mac OS X/etc/hostsfile.
The next sections gives the details of where to find all the things that you may want to experiment with. Remember if you make an error that damages these configuration files, you have to fix it or re-install VMWare Fusion.
VMWare NAT Files and Configurations
You can find the IP ranges for the Network Address Translation (NAT) here:
/Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf
You can open the file for editing like this:
sudo vi "/Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf"
The file contains the subnet, which I’ve found changes with release. You can configure this file and assign fixed addresses in it. However, you don’t need to install fixed addresses in this file unless you want to reserve addresses in the dynamic range.
The dynamic range is between xxx.xxx.xxx.128 and xxx.xxx.xxx.254. The range of xxx.xxx.xxx.3 to xxx.xxx.xxx.127 is available for static IP addresses. You can set a static IP address inside the native operating system of the VM.
The dhcpd.conf file with it’s instructions, looks like this:
# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet8. # # This file was automatically generated by the VMware configuration program. # See Instructions below if you want to modify it. # # We set domain-name-servers to make some DHCP clients happy # (dhclient as configured in SuSE, TurboLinux, etc.). # We also supply a domain name to make pump (Red Hat 6.x) happy. # ###### VMNET DHCP Configuration. Start of "DO NOT MODIFY SECTION" ##### # Modification Instructions: This section of the configuration file contains # information generated by the configuration program. Do not modify this # section. # You are free to modify everything else. Also, this section must start # on a new line # This file will get backed up with a different name in the same directory # if this section is edited and you try to configure DHCP again. # Written at: 02/18/2010 23:30:54 allow unknown-clients; default-lease-time 1800; # default is 30 minutes max-lease-time 7200; # default is 2 hours subnet 172.16.123.0 netmask 255.255.255.0 { range 172.16.123.128 172.16.123.254; option broadcast-address 172.16.123.255; option domain-name-servers 172.16.123.2; option domain-name localdomain; default-lease-time 1800; # default is 30 minutes max-lease-time 7200; # default is 2 hours option routers 172.16.123.2; } host vmnet8 { hardware ethernet 00:50:56:C0:00:08; fixed-address 172.16.123.1; option domain-name-servers 0.0.0.0; option domain-name ""; option routers 0.0.0.0; } ####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######
Unless you’ve changed the location of your VM repository on your Mac OS X, you can set a fixed-address for the virtual machine. You add the following lines at the bottom of the dhcpd.conf file:
host mclaughlinxp32 { hardware ethernet 00:0c:29:55:38:1b; fixed-address 172.16.123.21; }
You pick whichever IP address you’d like to use. You also need to configure the guest opearting system in the VM with that same IP address. You can find the ethernet hardware value in the following file:
~/Documents/Virtual Machines/VMName/VMName.vmx
You can open the file and hunt for it, or simply run this command from the directory where the file exists:
grep ethernet0.generatedAddress *.vmx
As always, I hope this helps some folks.
[...] This is the NAT network for Fusion. IP addresses .3-.127 are statically assignable. Thanks to Michael McLaughlin for this information. Note that if you do not setup the network correctly, the system will not [...]
Cisco Unified Communication Manager 7 (CUCM7) on VMWare Fusion 3.0 for Mac » Jim Shank's Good Info
7 Mar 10 at 12:44 pm
Hi Michael,
I have 3 development environments running under vmware fusion (2.0.7).
I’ve only just came across your article so I decided to try it out.
After making the required changes and restarting the vm services, the vm’s each come up with the correct ip, the ports are forwarded correctly, I can ssh into them from the host (i.e. host can see ubuntu guest) but for whatever reason I no longer have external network connectivity. i.e. I can no longer ping the gateway (i.e. the host) from within the guest. dns resolution fails also. I’m pretty stumped at this point. If i revert my changes, restart vmware services, reboot host and restart networking things are back to normal (i.e. ip from vmware dhcpd, can see gateway and can ping google). I’ve tried this dance a number of times and I’m seeing the same behaviour every time…
my nat.conf :http://pastebin.com/UDaLQDYR
my dhcpd.conf: http://pastebin.com/58KQb2hS
What I’ve just noticed is that by default my dhcpd.conf doesn’t have the vmnet8 entry???
Do you have clue as to why I’m seeing this behaviour or how I can go about debugging this?
Very sorry to bother you like this but I’m desperate at this point (tried google, irc, vmware support forums)..
Thanks for reading,
Saimon
Saimon Moore
11 Jun 10 at 7:50 pm
Have you tried shutting down your instances, and rebooting VMWare. Here’s another post that shows you how to do that without shutting down your native hosting OS.
If that doesn’t work, let me know.
maclochlainn
11 Jun 10 at 9:26 pm
Hi Mac,
Many thanks for your response…Yes I had tried that and I also tried the procedure in your other post. In fact since I wrote the comment I’ve solved the problem.
I tracked back and started to make incremental changes for each vm. I first made a single change to dhcpd.conf for one vm, rebooted vmare services and was suprized to find I still had connectivity. I then incrementally made changes until I discovered that was causing the initial issue was having setup multiple entries for portforwrding using the same destination port.
e.g. this won’t work:
even though the vms are never running at the same time.
but this will:
So thanks again for your help,
Signed
A happy virtual camper
Saimon Moore
15 Jun 10 at 5:01 am
[...] this post [...]
VMWare Fusion NAT on Mac
25 Aug 10 at 3:56 am
[...] You can refer to this for the details on your VMWare NAT subnet [...]
VMWare Tools on Ubuntu 10.04.01
2 Nov 10 at 5:50 pm
Thank you SO much Brother McLaughlin! I have been hunting everywhere for this so I can set up my MarkLogic dev machine for work. Awesome Possum!
David Godfrey
14 Mar 11 at 2:41 pm
You can find instructions to install, configure, and setup MarkLogic 4.2 here.
maclochlainn
14 Mar 11 at 2:56 pm
Please note that when you use this technique there is no need for installing the MS Loopback Adapter and assigning it a fixed IP.
Everything here applies to the ‘regular’ network adapter. That is where VMWare is going to look for a connection.
Signed, been at this all day and just figured this out…
Donnachaidh
22 Jun 11 at 5:16 pm
I’d like to share another nugget regarding networking with a Windows XP guest OS.
I’m building a ‘baseline’ VM that I can clone for installing various releases and combinations of Oracle products. So this VM has nothing from Oracle installed.
To test the network visibility between my host OS (Mac OS 10.6) and the guest OS (XP Professional) I am using the ping utility.
After configuring as described here, I could successfully ping FROM the guest to the host without any problem. I could not successfully ping in the other direction, from OS X to XP Pro.
It turns out that the default Windows Firewall settings do not allow incoming ping requests.
Here’s how to allow this:
start menu / Control Panel / Windows Firewall
Click the Advanced tab
Click “Settings” in the first section “Network Connection Settings”
Click the ICMP tab
Click the checkbox in the first setting “Allow incoming echo request”
Click OK twice
I hope this will save someone the hours I’ve spent trying to find something wrong with the VMWare configuration when everything there in reality just fine!
Jack
Donnachaidh
23 Jun 11 at 8:52 am
There’s a link to an earlier article that covers all those configuration issues for Oracle client on Mac OS X and Oracle Server on Windows. It should answer most if not all the issues that you’re running into, but let me know if you need more information?
maclochlainn
23 Jun 11 at 10:30 am
Thank you Mac.
I had read that but hadn’t recalled the other Windows-side work that needed to be done. I understand that you’re not VMWare tech support, but if you don’t mind I’d like to ask another Fusion networking question. Is the VMWare gateway visible from the Mac OS and Virtualized Windows?
I can ping this reliably from the guest OS, but only rarely and intermittently from the Mac OS host. Have you ever found any doc on this router on the VMware site? I have tried to access it from Firefox on the guest side and get a standard login dialog box, but I can’t find any mention whatsoever of how to provide the credentials.
If there’s a short explanation I’d really appreciate you sharing. If it’s more involved I’m content to let it go. But come to think of it, I would appreciate any recommendation you could make on a intro to TCP/IP networking.
Thanks, Jack
Jack
24 Jun 11 at 4:28 pm
Actually, I’m not sure why you want to ping the gateway but the best thing to do is put your IP address in the
/etc/hostsfile on your Mac, like this:Then, you can ping your
hostnamelike:ping mclaughlin-7x64As to a book reference on Networking, we use CCNA Guide to Cisco Networking Fundamentals in our first level networking course. It’s not for the faint of heart.
maclochlainn
24 Jun 11 at 8:16 pm
Hi MacLochlain,
Thanks for your post, i tried to configure the same but somehow the port forwarding didn’t work properly.
i added this under /etc/hosts
172.16.198.100 winxp
and in dhcp.conf i added
and set it under guess os(windows xp) to use the ipaddres. it started correctly
I then defined the port forwarding for host OS to guest OS in
nat.conffile.I have a web server running in guest OS and would like this to be exposed to user under my local network. But it seems that http://localhost:5088 doesn’t go anywhere on my host OS(Mac)
I can’t ping 172.16.198.100 from Mac host OS as well.
Any help would be greatly appreciated. Have been debugging this for like 3 hours.
William
26 Jun 11 at 2:05 am
When you write “guest OS”, do you mean the Mac OS or Windows? If you mean Windows (my guess), you’re trying to get to it from the Mac OS, right? If so, I’d suggest the following:
On Windows, open a firewall exception for Port:
5088. Then, you should be able to get to it with the following URL:If that doesn’t help, let me know.
maclochlainn
29 Jun 11 at 12:28 am
Thanks for your reply. I’ve already disabled the firewall in the guest OS (Windows) and I can’t get it to work. Enabling firewall with the exception also didn’t help.
I can’t ping the guest OS from host (MAC OS). Anything else i need to check?
William
29 Jun 11 at 9:56 am
Hi Machlochalinn, any idea on what went wrong?
William
9 Jul 11 at 6:17 pm
William,
This is a typical configuration in the
/etc/hostsfile on the Mac OS X side:Are you pinging the machine name, like this:
maclochlainn
13 Jul 11 at 10:41 pm
Hi Maclochlainn,
Mine looks like this, but i can’t ping the machine.
The firewall is off in my windows xp, so not sure what is wrong…
William
16 Jul 11 at 9:05 am
I’m assuming that you’ve configured the Windows side correctly, and that you see the same IP address when you run
ipconfigfrom the command-line. If that’s correct, did you open the ICMP Settings, which run before IP validation?maclochlainn
16 Jul 11 at 11:26 am
Hi Maclochalinn,
Thanks for your help so far. THe ipconfig on the windows xp side is the same ip address:
Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 172.16.198.100 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.16.198.2I’ve enabled the check mark for the ICMP settings and set the firewall to off, but still i can’t ping from mac os (host).
William
18 Jul 11 at 8:41 am
Any clue on what is wrong with my setup?
William
21 Jul 11 at 8:08 am
William,
I’m wondering if the NIC ID is invalid. Can you look up your Mac IP address and then try this from your Windows environment:
maclochlainn
22 Jul 11 at 1:26 am
Hi Maclochlainn,
I can do a trace route to my mac from windows xp
Problem is to ping winxp from mac is not possible:
William
26 Jul 11 at 6:31 pm
William,
Try removing this from the
dhcp.conffile:It should connect.
maclochlainn
27 Jul 11 at 12:37 am
I’m having the same issue even after removing that dhcp lines.
It’s strange because i can connect to internet from windows xp (ip add 172.16.198.100).
Mac internet also working fine.
Communication from win xp to mac os is working fine:
BUT, connection from mac os to winxp is having issue. I can't ping at all. I've disabled the firewall in winxp though
William
29 Jul 11 at 8:47 pm
Just a hunch, but change to DHCP, release the IP license, and restart networking. Then, check the results of
ipconfig /all.maclochlainn
31 Jul 11 at 11:50 pm
[...] VMWare Tools on Oracle Unbreakable Linux [...]
Oracle Linux & VMWare Tools
19 Oct 11 at 11:57 pm