Hi,
I am wondering why I can access http://localhost/ and other virtual hosts via a browser with NO physical attachment (ethernet cable) to the Internet, yet unable to do the same with http://localhost:8888/?
http://localhost/ and it’s vhosts are run via xampp on a W7 machine.
http://localhost:8888/ is an Ubuntu 9.10 server running via VirtualBox on the same W7 machine.
I literally need an Internet connection to access the Ubuntu server VM via a browser and I don’t know why. I mean, I see the difference between the two entities (http://localhost/ & http://localhost:8888/ as the later is being directed to a port) but don’t know how to solve the problem. Since one of the advantages to having local test servers is local access without messing with the Internet, or needing an Internet connection, this is frustrating.
I tried adding http://localhost:8888/ to the Windows 7 host file like my localhost and virtual hosts are but this did not help.
Any help would be appreciated.
Thanks, Tim…
Both URLs point to a specific port (when you don’t type it, 80 is assumed).
The problem is that localhost can’t point to two different computers. Localhost is an alias for 127.0.0.1 which always refers to your own computer.
The Ubuntu server should have its own local IP, that you can use to access it. I don’t know how VirtualBox assigns IPs, but you’d access that “computer” at a URL like http://192.168.0.101:8888. Maybe Ubuntu has some kind of network properties screen that will show you what IP address the computer has been assigned.
Thank you Dan. Your answer is very clear and I understand completely. Once I find the Ubuntu server IP address I’ll give it a try and post the results.
OK, this is all I had to do going off of Dan’s answer above.
I checked out ipconfig via command prompt on the Windows host and results where:
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::49cf:19b4:6dc5:f2e6%19
Autoconfiguration IPv4 Address. . : 169.254.242.230
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
I then unplugged the Ethernet cable from the machine to test access to the Ubuntu server guest without an active Internet connection (which was what I wanted to accomplish).
I directed the browser to http:169.254.242.230:8888 (the Autoconfiguration IPv4 Address above + port) and it worked. I now have access to my guest server via a browser without having to have an active Internet connection.
Thanks again Dan for your help.