How do I access my Ubuntu 10.04 Virtualbox's localhost from my host machine (mac)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 16:53:41

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/9338256/how-do-i-access-my-ubuntu-10-04-virtualboxs-localhost-from-my-host-machine-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!