VMware Communities
Perseveranze
Contributor
Contributor

Connect to Localhost from another machine

Hello,

I have a problem. I have two virtual machines, on one of them I have centos (server version) and in the other I have ubuntu.

On centos, I have installed OpenVZ, and Openvz web panel. The web panel can only be accessed via browser, but obviously, centos server has no GUI for this to work.

For this reason, to connect to the web panel on centos, I need to find a way to connect to it with Ubuntu browser. This is where the problem is.

1. Both Ubuntu and Centos can see each other, if I do;

ping ubuntuIP or ping CentosIP

It will ping correctly.

2. The web panel on centos url is; server1.example.com:3000

But I cannot connect or ping to this from Ubuntu.

I think in retrospect, I need to be able to connect to Centos's localhost/127.0.0.1 (which is server1.example.com) from Ubuntu.

But have had no fortune with this yet.

0 Kudos
7 Replies
Linjo
Leadership
Leadership

Try to connect on the ipadress instead, for example if the ip 192.168.1.123 the connect on 192.168.1.123:3000

// Linjo

Best regards, Linjo Please follow me on twitter: @viewgeek If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
Perseveranze
Contributor
Contributor

Hello,

I've tried this, but have had no fortune.

1. This is the ip address of my centos virtual machine;

http://i.imgur.com/HE7oFqb.png

And just for the sake of it, the ip address of my ubuntu virtual machine as well;

http://i.imgur.com/ytuXWJ7.png

2. My ubuntu machine can ping my centos machine;

http://i.imgur.com/68Z0y1n.png

So this shows they can ping each other and are on the same network.

3. When I try this in the address bar however, it cannot load the page;

http://i.imgur.com/d4k6Pvc.png

4. The following screenshot shows OpenVZ panel being installed on centos, and it shows the url to access it on;

http://server1.example.com:3000 (this is the local host)

http://i.imgur.com/7emW5vR.png

5. If i do the wget command on centos, it shows it's there;

http://i.imgur.com/ifm4noD.png

6. If I try the same command in Ubuntu, it gives me this error (for both);

wget server1.example.com:3000

wget 192.168.148.129:3000

http://i.imgur.com/RYREci5.png

I hope I have given enough information.

I'm really determined to make this work, if you have any clues on where I'm going wrong, please advise me.

Thank you.

0 Kudos
WoodyZ
Immortal
Immortal

You should not use example.com except in documentation examples! Smiley Wink

0 Kudos
Perseveranze
Contributor
Contributor

Thanks for the tip, was following tut examples.

Any solutions or ideas to the problem?

0 Kudos
WoodyZ
Immortal
Immortal

example.com primarily exists as documentation place holder and test ping example and is not supposed to actually be used by someone when assigning domain names to one's own computer.  So if you properly configure everything you shouldn't have any problems! Smiley Wink

Perseveranze
Contributor
Contributor

Hello Woody,

I'm not 100% sure I understand what you mean.

If you look at point number 5. in my list above, it shows that the wget command (on centos machine only) resolves to a host when you try to access; server1.example.com.

By changing server1.example.com, I'm not entirely sure how much difference this could make. Here is my /etc/hosts files on centos;

http://i48.tinypic.com/33nc4tl.png

Are you suggesting I should just remove the server1.example.com part, and it should work (ie. I'll be able to access my centos localhost, via my ubuntu browser?)

0 Kudos
WoodyZ
Immortal
Immortal

localhost is just that, local to the host and when normally and properly configured as in default configurations one cannot and should not be able to communicate with localhost of one computer to another!  127.0.0.1 is after all a loopback adapter and is meant to be used internally only on each system and not beyond each system! Smiley Wink  If you want to communicate with a Service running on one system from another then you need to ensure everything is properly configured, meaning proper permission are in place and ports are open and firewalls are not blocking communications, etc.

What I will tell you is none of this is a VMware issue per se, its nothing more then a User not knowing how to properly configure and access services from one system to another.  You cannot use a public registered domain name that does not belong to you or is not setup to be used for what you're attempting because as you should be able to plainly see from the output of the wget command on the system not hosting the service your trying to access it's returning a public IP Address not that of the server you're actually trying to access which has a private IP Address.  Then when you use the actual IP Address and Port Number you are failing to connect because something is not properly configured even beyond the wrongly used domain name.  Either the port is not open or is being blocked in some manned etc.  These are not VMware issues and you need to brush up on fundamental network basics and go from there.

0 Kudos