从VirtualBox虚拟机寻址localhost

眉间皱痕 提交于 2020-08-08 07:38:45

问题:

I have a local test/development server (HTTP, of course), listening to port 8000. 我有一个本地测试/开发服务器(当然是HTTP),监听端口8000。

I'm working on Linux, so to test the page on Internet Explorer 6, 7, 8, etc. I run a virtual machine using VirtualBox; 我正在使用Linux,所以要在Internet Explorer 6,7,8等上测试页面。我使用VirtualBox运行虚拟机; I also need to see how it look on Firefox in a windows environment (fonts for instance are different). 我还需要看看它在Windows环境中的外观如何(例如字体不同)。

In my real machine, I open the website simply using the URL http://localhost:8000 , how do I address this localhost from the virtual machine? 在我的真机中,我只是使用URL http://localhost:8000打开网站,如何从虚拟机中寻址此本地主机?

Right now my workaround is to use the IP address. 现在我的解决方法是使用IP地址。 Any better ideas? 有更好的想法吗?


解决方案:

参考一: https://stackoom.com/question/5IIR/从VirtualBox虚拟机寻址localhost
参考二: https://oldbug.net/q/5IIR/Addressing-localhost-from-a-VirtualBox-virtual-machine
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!