Access Your Web Server From a VirtualBox Guest OS

March 24, 2010 by
Filed under: HowTo, linux, web development, windows 

If you've followed my posts on how to install LAMP on Ubuntu and basic Apache configuration, then you're probably interested in doing some cross browser testing of the websites you build. Felipe, one of my readers, asked a question on my Apache configuration post about accessing his local websites from a VirtualBox guest OS. Specifically, Felipe wanted to install Windows XP in a VirtualBox guest on his Linux system so that he could test his websites in Internet Explorer.

It turns out that it's pretty easy to do this. As long as you're running VirtualBox in its default network configuration, all you have to do is enter the proper IP address into the browser and you're accessing the host's web server.

So if you've configured your host system to show your web development site at http://site1/, then you can access this site from your VirtualBox guest OS with the address http://10.0.2.2/site1/. That's it. Now you can test your site from any browser and OS that you can run in VirtualBox.

Comments

4 Responses to “Access Your Web Server From a VirtualBox Guest OS”

  1. Benjamin says:

    Very nice tip here, i've been working on knowing this for a long time now, thanks and keep up the great work!

  2. bobot says:

    Howdy.

    I tried following the tip but I got the famous 404 error. I have to tell you though that I tried this one with a Live CD. I mean, I just booted my Virtual Box using the iso that I downloaded. That is, I did not install the iso in my Virtual Box.

    Is there any difference?

    Thanks and Godspeed.

    bobot

  3. SoCRaT says:

    Very nice website by the way, I guess we have lots in common.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>