如何在没有额外网络的情况下访问虚拟盒中的主机服务
我有 ubuntu 10.04 和运行 win xp 的虚拟机,现在我想在 ie 中测试我的页面布局,所以我想从我的虚拟机中访问 apache,如何在主机上没有额外网络的情况下进行设置(即我想主机和访客之间有某种点对点连接)
I have ubuntu 10.04 and virtual box running win xp now i want to test my page layout in ie so i want to access apache from with in my virtual box how can i set up this with out additional networking on the host (i.e. i want to have some kind'a peer to peer connection between the host and the guest)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够使用虚拟机的默认网关从 Virtual Box 访问本地(主机)计算机的 Apache 服务器。如果您在命令提示符下输入
ipconfig
,您将找到该 IP 地址。获得后,只需在 IE 中浏览到该 IP 和文件夹即可。 (或者您可能已经安装的任何其他浏览器。)
You should be able to access your local (host) machine's Apache server from your Virtual Box using the default gateway of the virtual machine. If you type
ipconfig
at the command prompt, you will find that IP address.Once you have that, just browse to that IP and folder in IE. (Or any other browser you might have installed, for that matter.)
关闭 XP 并从 VirtualBox 中删除虚拟机的所有网络选项。创建一个新的网络选项(默认),这就是 NAT。启动 XP VM 并安装 VirtualBox Guest Additions。请参阅 VirtualBox 帮助文件以获取说明。您需要首先将 Vbox Guest Additions ISO 安装为 CD-ROM 驱动器。重新启动虚拟机。您的 XP 客户机和 Ubuntu 主机将获得同一子网中的 IP。您可以通过在 URL 中输入主机 IP 地址来访问主机上运行的 Apache 网站。
Shutdown XP and delete all networking options for the VM from VirtualBox. Create a new networking option (by default), this is NAT. Start the XP VM and install VirtualBox Guest Additions. Rrefer the VirtualBox help file for instructions. You need to first mount the Vbox Guest Additions ISO as a CD-ROM drive. Restart the VM. Your XP guest and the Ubuntu host will be given IP on the same subnet. You can access Apache websites running on the host by typing the host IP address in the URL.