从虚拟机访问本地主机 [英] Accessing localhost from virtual machine
问题描述
我已经使用 Virtualbox 安装了带有 Windows XP 的虚拟机,我想从中访问本地主机(我使用的是 Wamp 服务器).是否可以?我在小米电脑上使用的是 Windows 7.
I have installed a virtual machin with Windows XP using Virtualbox and i want to acces the localhost from it (i am using Wamp Server). Is it possible? I am using Windows 7 on mi computer.
推荐答案
此解决方案适用于 Mac OS X:打开 IE 并只需输入 URL http://10.0.2.2:8888
(8888是 Apache 端口,在 MAMP 中是 8888).
This solution works on Mac OS X: open IE and simply enter the URL http://10.0.2.2:8888
(8888 is the Apache port, in MAMP is 8888).
此外,为了更好的解决方案:在 C:\WINDOWS\system32\drivers\etc
中打开您的 hosts
文件并添加以下行:
Also, for a better solution: open your hosts
file in C:\WINDOWS\system32\drivers\etc
and add this line:
10.0.2.2 localhost
有关更全面的解释,请查看 此链接.
For a more comprehensive explanation check this link.
这篇关于从虚拟机访问本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!