Accessing Apache Virtual Host from VirtualBox

Jun 10 2011

On my Ubuntu I run Apache vhost for each of my projects.

Now, wouldn’t it be cool if you could access your Apache vhost from IE running in VirtualBox!?

I managed to solve this problem by editing a Vbox instance settings:

Settings: Network: Adapter 1: Attached to: Bridged Adapter

Start a VirtualBox instance and type http://localhost in IE and you’ll see a localhost running on Ubuntu.

Now, associate IP address to a host name in Windows (192.168.1.38 is my Ubuntu IP address)

# c:/Windows/System32/drivers/etc/hosts
192.168.1.38	projectx.local

and Ubuntu

# /etc/hosts
192.168.1.38	projectx.local

Then create a new Apache config file

#/etc/apache2/sites-available/vbox-projectx
<VirtualHost projectx.local>
DocumentRoot /var/www/projectx
</VirtualHost>

Enable the config

$ sudo a2ensite vbox-projectx
$ sudo /etc/init.d/apache2 restart

Now, in IE (running in VirtualBox) type http://projectx.local and… that’s it

Comments Off

Comments are closed at this time.

Performance Optimization WordPress Plugins by W3 EDGE