从虚拟机访问本地主机
我需要从虚拟机内部访问本地环境。有几篇关于如何执行此操作的帖子,但我需要能够通过在地址栏中键入“localhost”来访问我的本地主机,因为它使用 facebook 身份验证,如果域无法识别,则它不起作用。
如何设置以使虚拟机中的“localhost”指向虚拟机外部的“localhost”?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将本地主机的 IP 地址更改为主机文件中主机的 IP 地址。
如果虚拟机是 Windows,则文件位于 c:\windows\system32\drivers\etc\hosts
只需在记事本中打开主机文件并编辑
以
不确定它是否有效,但您至少可以尝试
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
to
not sure if it works, but you can atleast try