Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to access a localhost from a vagrant devbox?

I'm running my application on a local Vagrant VM on my computer and I was wondering if I created a node server that ran on localhost (also on my computer) would I be able to access the node server from my Vagrant application ?

like image 736
ziyadparekh Avatar asked May 31 '14 14:05

ziyadparekh


1 Answers

With default vagrant settings, you can reach your host computer via the IP 10.0.2.2. This is at least true for the VirtualBox provider. I haven't tested others so far.

If you have configured your node server on the host machine in way that it listens to all IP addresses assigned to your host computer you should be able to access

http://10.0.2.2

from within the vagrant virtual machine.

like image 69
hek2mgl Avatar answered Oct 11 '22 20:10

hek2mgl