I'm having trouble accessing a port on my OSX host from a vm.

I'm using NAT in VMware fusion. In my (OSX host) hosts file, I have the ip address for vmnet8 mapped to 'mac'.

From my vm, I can 'ssh user@mac' and it works as expected: I am logged into the host. So, my hosts file is working.

I have a tunnel from my OSX host to an Oracle server at work. I can use the tunnel (localhost:6004) from the host no problem. However if I try to use the name 'mac' instead of 'localhost' this does not work. As a result, I am not able to access the tunnel from the vm, either. (I can't use the localhost name from the vm, obviously).

Why isn't the tunnel accessible using 'mac', while ssh works fine?

1 Answer 1


Okay, I got things working the way I want - I think. is mapped to 'mac' in /etc/hosts

sudo ifconfig lo0 add

sudo ipfw add fwd tcp from any to

Not a networking expert, obviously, so I couldn't say exactly why this works and my first attempt didn't.

Anyway, it allows me to refer to the host os as 'mac' from my VMs, and in addition allows me to access any ssh tunnels on the host from within the VMs (e.g. mac:9004). In addition, by mapping my VM ip addresses in /etc/hosts (on the host), all VMs and the host seem to be able to communicate flawlessly by name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .