Page 1 of 1

accessing a service from Windows host to RHEL VM

Posted: 5. Feb 2015, 21:31
by lk_onca
Hi all,

I have a base RHEL 7 64-bit VirtualBox VM running off a Windows 7 host. I have connectivity in regard to stelnet and sftp from the Windows host to RHEL VM.

I have a running service in RHEL accessible as "jini://localhost.localdomain:4166/", however I am not able to connect to this address. The hosts file on Windows has been modified to
127.0.0.1 localhost.localdomain
::1 localhost.localdomain
which now pings ok but still not able to connect. I also see that the RHEL host file maps localhost.localdomain as an alias to 127.0.0.1.

Also tried the "ip route show" address (192.168.0.13) which is what I use for stelnet/sftp.

Any thoughts and ideas would be much appreciated.

Sincerely,
lk_onca

Re: accessing a service from Windows host to RHEL VM

Posted: 6. Feb 2015, 10:21
by socratis
1. Never, ever, alias 127.0.0.1 to anything else than your host. Never.
3. Try "jini://192.168.0.13:4166/" to make sure it works.
2. Alias your VM 192.168.0.13 to something else (e.g. vm-rhat.localdomain).
3. Try "jini://vm-rhat.localdomain:4166/".

Re: accessing a service from Windows host to RHEL VM

Posted: 6. Feb 2015, 20:24
by lk_onca
Hi Socratis,

Here are my test results.

Test #1
1. Never, ever, alias 127.0.0.1 to anything else than your host. Never.
3. Try "jini://192.168.0.13:4166/" to make sure it works.

Host windows hosts file
Default w no mapping

VM box (RHEL) per default installation
[root@localhost etc]# cat hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

VM box (RHEL) This is the same IP I use to stelnet/sftp successfully from the host Windows
[root@localhost etc]# ip route show
default via 192.168.0.1 dev enp0s3 proto static metric 1024
192.168.0.0/24 dev enp0s3 proto kernel scope link src 192.168.0.13

VM box (RHEL) Running service
jini://localhost.localdomain:4166/

Attempt connect using:
jini://localhost.localdomain:4166/
jini://localhost:4166/
jini://192.168.0.13:4166/

Result:
Unable to connect, & ping fails
C:\Users>ping localhost.localdomain
Ping request could not find host localhost.localdomain. Please check the name an
d try again.

Test #2
2. Alias your VM 192.168.0.13 to something else (e.g. vm-rhat.localdomain).
3. Try "jini://vm-rhat.localdomain:4166/".

Host windows hosts file
Default w no mapping

[root@localhost etc]# cat hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.13 vm-rhat.localdomain

VM box (RHEL) This is the same IP I use to stelnet/sftp successfully from the host Windows
[root@localhost etc]# ip route show
default via 192.168.0.1 dev enp0s3 proto static metric 1024
192.168.0.0/24 dev enp0s3 proto kernel scope link src 192.168.0.13

VM box (RHEL) Running service
jini://localhost.localdomain:4166/

Attempt connect using:
jini://localhost.localdomain:4166/
jini://localhost:4166/
jini://192.168.0.13:4166/

Result:
Unable to connect & ping fails
C:\Users>ping localhost.localdomain
Ping request could not find host localhost.localdomain. Please check the name an
d try again.

Test #2a
Same as test 2 but with the following

[root@localhost etc]# cat hosts
192.168.0.13 vm-rhat.localdomain

Result:
Error starting service because it looks for localhost.localdomain

Test #2b
Same as test 2 but with the following

[root@localhost etc]# cat hosts
192.168.0.13 vm-rhat.localdomain localhost.localdomain

Result:
Unable to connect & ping fails
C:\Users>ping localhost.localdomain
Ping request could not find host localhost.localdomain. Please check the name an
d try again.

Alternative:
Attempt to start service on the known IP 192.168.0.13 rather than localhost.localdomain


Thank you,
lk_onca

Re: accessing a service from Windows host to RHEL VM

Posted: 6. Feb 2015, 20:46
by socratis
Please read this: http://en.wikipedia.org/wiki/Localhost
And remember that your VM is a different computer as far as the network is concerned. If you're following a tutorial and they mention http://localhost.localdomain:4166/ they definitely mean from within the VM, not from your host.

Re: accessing a service from Windows host to RHEL VM

Posted: 6. Feb 2015, 21:34
by lk_onca
This helps a lot Socratis,

Thank you for your time.

Sincerely,
lk_onca