So, I set up my Vagrant machine, got everything running, made some changes to the code, got the new thing I wanted working, ready to get the front end guys to do their bit. I sent the url (including the vagrant ip address) and other details to my front end colleague. And he couldn't connect.
Apparently, you can't, by default, access a Vagrant machine from outside of its host machine.
I couldn't work out what I needed to google for this, but @filthynerd on Twitter came to my rescue
@saoili I think you want either port forwarding (if it's just HTTP) https://t.co/x8Vps7cqYn or a public network: https://t.co/1VEDkHsuID
— Æ (@filthynerd) November 7, 2014
That first link solved my problem. Just pick a port you're not using on your local machine, add this line to your Vagrant config file, run vagrant reload, and Robert is your mother's brother:
config.vm.network "forwarded_port", guest: <vagrant port>, host: <host port>
No comments:
Post a Comment