问题:
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
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4331830