如何从我的主机 (mac) 访问我的 Ubuntu 10.04 Virtualbox 的本地主机? [英] How do I access my Ubuntu 10.04 Virtualbox's localhost from my host machine (mac)?

查看:48
本文介绍了如何从我的主机 (mac) 访问我的 Ubuntu 10.04 Virtualbox 的本地主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我对大部分内容都不熟悉

我昨天刚刚下载了 virtualbox,今天在上面安装了 ubuntu 10.04.我的计划是镜像我计划部署到的生产/暂存环境.

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.

无论如何,我只是设置了 nginx,我想确保安装正常工作,我需要访问与 ubuntu virtualbox 安装中的 localhost 等效的内容.

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.

我正在使用最新版本的 virtualbox 运行最新版本的 Lion.

I'm running the latest version of Lion with the latest version of virtualbox.

推荐答案

您可以通过以下两种方式之一访问您的来宾 VM,您的选择很大程度上取决于您现有的网络基础架构和需求.

You can access your guest VM in one of two ways, your choice depends largely upon your existing network infrastructure and needs.

最简单的方法通常是在桥接模式下配置虚拟网络适配器.您可以通过更改网络部分/选项卡上的虚拟机设置来执行此操作.这将使您的来宾操作系统出现在与主机相同的 LAN 网段上,因此您可以像连接子网中的任何其他主机一样连接到它.您应该在做出决定时考虑到一些缺点,例如不能很好地使用无线网络.

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.

另一种方法是将网络适配器配置为 NAT(这通常是默认设置)并像在路由器上一样配置一些端口转发选项以允许访问主机.同样,在机器设置的网络配置部分,在高级区域下有一个端口转发按钮,可让您设置规则以将某些流量从主机转发到客户操作系统.

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.

网络配置屏幕">

这篇关于如何从我的主机 (mac) 访问我的 Ubuntu 10.04 Virtualbox 的本地主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆