Addressing localhost from a VirtualBox virtual machine [closed]
IT Nursery
April 20, 2022
0
I have a local test/development server (HTTP, of course), listening to port 8000.
I’m working on Linux, so to test the page on Internet Explorer 6, 7, 8, etc. I run a virtual machine using VirtualBox; I also need to see how it look on Firefox in a windows environment (fonts for instance are different).
In my real machine, I open the website simply using the URL http://localhost:8000, how do I address this localhost from the virtual machine?
Right now my workaround is to use the IP address. Any better ideas?
22 s 22
Googling turned this up: http://data.agaric.com/localhost-from-virtualbox-xp-install-ubuntu
It suggests using IP: http://10.0.2.2, and it worked for me.
So, I edited the hosts file, C:\windows\system32\drivers\etc\hosts, and added this entry:
10.0.2.2 outer
If you’re testing on IE8, remember to put http:// in the address bar. Just putting the ip directly will not work.