accessing a service from Windows host to RHEL VM

Discussions related to using VirtualBox on Windows hosts.
Post Reply
lk_onca
Posts: 3
Joined: 5. Feb 2015, 21:24

accessing a service from Windows host to RHEL VM

Post 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
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: accessing a service from Windows host to RHEL VM

Post 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/".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lk_onca
Posts: 3
Joined: 5. Feb 2015, 21:24

Re: accessing a service from Windows host to RHEL VM

Post 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
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: accessing a service from Windows host to RHEL VM

Post 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.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lk_onca
Posts: 3
Joined: 5. Feb 2015, 21:24

Re: accessing a service from Windows host to RHEL VM

Post by lk_onca »

This helps a lot Socratis,

Thank you for your time.

Sincerely,
lk_onca
Post Reply