如何从主机(mac)访问我的Ubuntu 10.04 Virtualbox的localhost?(How do I access my Ubuntu 10.04 Virtualbox's l

编程入门 行业动态 更新时间:2024-10-27 14:23:03
如何从主机(mac)访问我的Ubuntu 10.04 Virtualbox的localhost?(How do I access my Ubuntu 10.04 Virtualbox's localhost from my host machine (mac)?)

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

我昨天刚下载了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(这通常是默认设置),并配置一些端口转发选项,就像在路由器上配置一样,以允许访问主机。 同样,在机器设置的网络配置部分,在高级区域下有一个端口转发按钮,允许您设置规则以将某些流量从主机转发到客户机操作系统。

VirtualBox机器设置 - >网络配置屏幕

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.

VirtualBox Machine Settings -> Network Configuration Screen

更多推荐

本文发布于:2023-07-23 01:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225567.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:主机   Ubuntu   Virtualbox   mac   access

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!