Here is my setup:
- Host: Windows XP
- Guest: Ubuntu 10.04
- Networking: NAT
I am setting an Apache web server on the Guest, but I want to be able to do this on the Windows machine:
- go to the browser, type http://localhost:8000
Also, I tried to change my networking to bridge and I got a new IP. But when I tried to do http://:8000, it says that it could not connect.
Network communication Host -> Guest
Connect to the Guest and find out the ip address:
example of result (ip address is 10.0.2.15):
Go to Vbox instance window -> Menu -> Network adapters:
Go to host system and try it in browser:
or your network ip address (find out on the host machine by running: ipconfig).
Network communication Guest -> Host
In this case port forwarding is not needed, the communication goes over the LAN back to the host.
On the host machine - find out your netw ip address:
example of result:
On the guest machine you can communicate directly with the host, e.g. check it with ping:
That's not possible.
localhost
always defaults to the loopback device on the local operating system.As your virtual machine runs its own operating system it has its own loopback device which you cannot access from the outside.
If you want to access it e.g. in a browser, connect to it using the local IP instead:
This is just an example of course, you can find out the actual IP by issuing an
ifconfig
command on a shell in the guest operating system.