免责声明:我对大部分内容都不熟悉
我昨天刚下载了virtualbox,今天就安装了ubuntu 10.04。 我的计划是镜像我计划部署的生产/登台环境。
无论如何,我只是设置nginx,我想确保安装正常,我需要访问相当于我的ubuntu virtualbox安装上的localhost。
我正在使用最新版本的virtualbox运行最新版本的Lion。
Disclaimer: I'm new to most of this
I just downloaded virtualbox yesterday and installed ubuntu 10.04 on it today. My plan is to mirror the production/staging environments that I plan to deploy to.
Anyway I just set up nginx and I want to make sure that the installation worked properly and I need to access the equivalent of what would be localhost on my ubuntu virtualbox installation.
I'm running the latest version of Lion with the latest version of virtualbox.
最满意答案
您可以通过以下两种方式之一访问来宾VM,您的选择很大程度上取决于您现有的网络基础架构和需求。
最简单的方法通常是在桥接模式下配置虚拟网络适配器。 您可以通过更改“网络”部分/选项卡上的虚拟机设置来执行此操作。 这将使您的客户操作系统显示在与主机相同的LAN段上,因此您将以与子网上任何其他主机相同的方式连接到它。 在您的决定中,您应该考虑一些缺点,例如无法正常使用无线网络。
另一种方法是将网络适配器配置为NAT(这通常是默认设置),并配置一些端口转发选项,就像在路由器上配置一样,以允许访问主机。 同样,在机器设置的网络配置部分,在高级区域下有一个端口转发按钮,允许您设置规则以将某些流量从主机转发到客户机操作系统。
You can access your guest VM in one of two ways, your choice depends largely upon your existing network infrastructure and needs.
The easiest way is typically to configure the virtual network adapter in Bridged Mode. You can do this by changing the virtual machine settings on the Network section/tab. This will make your guest OS appear on your the same LAN segment as the host so you would connect to it the same way you would any other host on your subnet. There are some drawbacks, such as not working well with wireless networks, that you should account for in your decision.
The alternative is to configure the network adapter as NAT (this is typically the default) and configure some port forwarding options like you would on your router to allow access to a host. Again, on the network configuration section of the machine settings, under the advanced area there is a button for Port Forwards that will allow you to setup rules to forward certain traffic from your host computer to the guest operating system.
更多推荐
发布评论