I need to access my local environment from inside a vm. There's several posts about how to do this, but I need to be able to access my localhost by typing "localhost" in the address bar, because it uses facebook authentification, and if the domain is not recognized, it doesn't work.
How can I set so that "localhost" in my vm points to "localhost" outside the vm ?
Usually, you can access the localhost of any computer through the loopback address 127.0. 0.1. By default, this IP address references a server running on the current device. In other words, when your computer requests the IP address 127.0.
Virtual machines use a virtual network device on the host machine to be able to route traffic into and out of the virtual machine. The host machine will be able to see the network activity of the virtual machine because the host is communicating on behalf of it.
you can change the IP address of the localhost to whatever the IP of the host has in your hosts file.
If the vm machine is windows the file is located at c:\windows\system32\drivers\etc\hosts
just open up the hosts file in notepad and edit
127.0.0.1 localhost
to
192.168.0.1 localhost
not sure if it works, but you can atleast try
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With