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

site1.local  
site2.local  

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?

link|improve this question

feedback

2 Answers

up vote 3 down vote accepted

Ah, It's as easy as pie.

In your windows Virtual Machine edit your hosts file

c:\WINDOWS\system32\drivers\etc\hosts

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

127.0.0.1 localhost with 10.0.2.2 localhost

So my hosts file looks like

10.0.2.2 localhost
10.0.2.2 site1.local
10.0.2.2 site2.local

link|improve this answer
feedback

I tried doing a ping from my base windows m/c to the ip 10.0.2.15 (my ubuntu ip) and it does not seems to be resolving, Any thoughts ?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.