Ubuntu – How to access Apache2 virtual host from VirtualBox (or any VM)


I am running Ubuntu 11.04, I have setup my localhost so I access my sites at


By setting up virtual hosts and adding entries to my hosts file.

I want to test them in IE so I have installed VirtualBox with Windows.

My question is, How can I access site1.local from the virtual machine?

Best Answer

Ah, It's as easy as pie.

In your windows Virtual Machine edit your hosts file


And link your virtual hosts to, If you are just using localhost then replace localhost with localhost

So my hosts file looks like localhost site1.local site2.local

Related Question