Perhaps you would like to run a Linux based web server under VMWare Fusion, and would like for it to be accessed from the internet. This will explain how to set it up.
Your first task will be to set up a static IP for your VM. First you’ll need to find out what the MAC address VMWare is using for your VM. You can obtain that information by going into VMWare’s virtual machines directory to see what it is assigning to its ethernet0.generatedAddress parameter. On my Mac, I can find that here:
/Users/john/Documents/Virtual Machines.localized/Ubuntu.vmwarevm
So I open a Terminal window (I like iTerm) and issue these commands:
1 2 |
|
and I get this back:
1 2 |
|
Make note of the generatedAddress entry, we’ll use that below.
Next you need to go to this folder…
/Library/Application Support/VMware Fusion/vmnet8
…then edit dhcp.conf and look for an entry similar to this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
For each VM that you wish to set up a static IP, you will need to make a similar entry at the end of the file. Make sure the fixed-address entry below is outside the range is the subnet entry above (192.168.216.128 through 192.168.216.254).
1 2 3 4 |
|
After this entry, save dhcp.conf.
Now, in the same directory as dhcp.conf you will find another configuration file called nat.conf. Open up nat.conf for editing. and make the following addition under the [incomingtcp] section:
80 = 192.168.216.32:80
Optionally, you may wish to make entries in your Mac’s /etc/hosts file. For example:
1 2 |
|
After making these changes, you will need to restart VMWare networking with the following command:
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
Thats all there is to it. You are now ready to run your web server in a Linux VM !