-5

Every answer I've found about this is too generic and assumes both systems are unix-like.

I have localhost set up on my computer (Ubuntu) and I was wondering what I need to do to access it from my other computer (Windows 7)?

closed as not constructive by mdpc, Falcon Momot, Ward, Wesley, Jacob Jun 25 '13 at 6:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What you need to do is understand the terminology. – Iain Jun 25 '13 at 6:39
6

You can't access localhost from another computer because localhost is, as the name implies, localhost/loopback/127.0.0.1. You need to access it via it's LAN ip address.

http://en.wikipedia.org/wiki/Localhost

  • 3
    Fight the good fight, @joeqwerty – Ryan Ries Jun 25 '13 at 3:52
2

The loopback interface is special in that it does not route traffic outside the device itself. The entire 127.0.0.0/8 block is reserved for this purpose, and traffic with such an address may not transit a network (even a LAN, or a virtual network). Localhost also isn't really set up by anything, except in the most pedantic sense.

If you want, you can use iptables (you are using ubuntu after all) to do NAT to access whatever service it is you are serving on localhost. The rule will look something like this:

iptables -t nat -A PREROUTING -i $LAN_INTERFACE -p tcp --dport $SERVICE_PORT -j DNAT --dnat-to 127.0.0.1:$SERVICE_PORT

I'm not sure why you would want to do that, though. Usually it is easier to have the service listen on the LAN.

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