docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

VMware Fusion Port Forwarding #1351

Open chouclee opened 9 years ago

chouclee commented 9 years ago

Anyone knows how to do port forwarding via docker machine?

I need to let other computers access the web services I deployed in containers. So only port forwarding could work.

Virtual Box could do that, but the shared folder performance is just super slow.

ehazlett commented 9 years ago

We currently don't have a mechanism in place in machine to do this. You would have to use the Fusion UI. We've discussed port forwarding for local and it's getting more and more request. We should put together a formal proposal to do this for local providers.

adambiggs commented 9 years ago

+1

Pixelworlds commented 9 years ago

+1

rguikers commented 9 years ago

+1

thinktainer commented 8 years ago

+1

mikattack commented 8 years ago

+1

theladyjaye commented 8 years ago

+1

You can manually do it by editing: /Library/Preferences/VMware\ Fusion/vmnet{{ N }}/nat.conf

Lets say you want to forward port 80:

docker-machine ip {{ your machine name }}

edit /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf

Find the section:

[incomingtcp]
# Use these with care - anyone can enter into your VM through these...
# The format and example are as follows:
#<external port number> = <VM's IP address>:<VM's port number>
80 = {{ your machine ip }}:80

Now run the following:

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

Evidently the Pro versions of Fusion (6,7,8) have a GUI for doing this.

zacksiri commented 8 years ago