SaiyanGirl
SaiyanGirl

Reputation: 17034

Accessing a web server on a Mac Virtual Machine from the Mac Host and Network

Initial Config

Steps

I followed a myriad of different guides, but they all revolve around doing the same sort of thing. So, what I have tried is port forwarding.

  1. I ensured that the network adapter setting is set to "Share with my Mac".

enter image description here

  1. I retrieved the IP for the virtual machine using arp -an command. THe command returns 2 numbers. I've tried both of them. enter image description here

  2. On the host machine, I have modified the file /Library/Preferences/VMware Fusion/vmnet8/nat.conf:

    [incomingtcp] 8080 = 192.168.83.2:8080

    1. I restarted the VM, but when I try to access the web servlet on the host mac, I get Safari can't connect to the server

The firewall is turned off for both of the machines.

Is there some step I'm missing? I've tried using the bridged networking as well, but I'm not as sure of what to do there.

Thank you!

Upvotes: 1

Views: 2052

Answers (1)

SaiyanGirl
SaiyanGirl

Reputation: 17034

For others to know, this is what I ended up doing:

I selected Bridged Networking - Autodetect instead of Share with Mac. This option can either be picked through the option mentioned in my question, or also by selecting the menu at the top and selecting Virtual Machine > Network Adapter > Bridged (Autodetect).

Afterwards, inside the Virtual Machine, I opened terminal and typed ifconfig. There's an IP mentioned after inet in the en0: section. That's the IP I can use to access servers running on the Virtual Machine from the network.

Upvotes: 2

Related Questions