Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Mac OS X installation and a Ubuntu Virtual Box inside them. I use the Debian Virtual Box as a development machine for several rails and php web projects, but I want to access them from the Mac OS so I can tested on Safari, it is possible do this? how?

Thanks in advance

share|improve this question

The simplest way is to set the virtual machine to use bridged networking, it will get an IP address on your network; this IP address should then be accessible from your host machine.

From Chapter 6 of VirtualBox's manual:

With bridged networking, VirtualBox uses a device driver on your host system that filters data from your physical network adapter. This driver is therefore called a "net filter" driver. This allows VirtualBox to intercept data from the physical network and inject data into it, effectively creating a new network interface in software. When a guest is using such a new software interface, it looks to the host system as though the guest were physically connected to the interface using a network cable: the host can send data to the guest through that interface and receive data from it. This means that you can set up routing or bridging between the guest and the rest of your network.

It is also possible to use the NAT networking mode, but it will require tinkering with port forwards (not worth the trouble, in my opinion).

share|improve this answer
I did it, but I don't know what is the IP address that virtual machine have, how can I know that? – Nisanio Jul 15 '12 at 2:52
From what you say in your question, the virtual machine is Linux. Thus, open a terminal in the virtual machine and type ifconfig. – Renan Jul 15 '12 at 2:53
thank you very much! – Nisanio Jul 15 '12 at 23:43
woks like a charm! exactly what i was looking for .. i think this answer should get marked as the right one – philx_x Nov 19 '14 at 19:39

The way I would do this (especially if you are on a home network) is to set the networking adapter to a bridged adapter. This way the guest VM is assigned it's own IP, and is accessible from any machine on the local network. It's the most convenient, and the won't have to mess around with port forwarding (which can get complicated).

A good reference for all the VBox networking modes is:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .