Cannot ping Guest OS by hostname

Discussions about using Linux guests in VirtualBox.
Post Reply
DataTech
Posts: 1
Joined: 26. Oct 2015, 23:51

Cannot ping Guest OS by hostname

Post by DataTech »

Hi,
I wonder if you could help please.
Thank you very much

My Environment:
VirtualBox: 5.0.4
Host OS (lenovo-pc): Windows 8.1
Guest OS (linuxVM01): SUSE Linux Enterprise Server 11 SP4

I have installed and configured Suse Linux as a guest OS and everything is working fine as expected, except for the hostname which I can't ping from the host Windows system. The guest OS has the firewall disabled and it can ping the host OS by ip and by hostname however the host system can ping the guest system by ip address only.

The Linux guest system can access the Internet and shared folders on the Host system without any problems.

I have also mapped ip to hostname in both hosts file Windows and Linux

The virtualbox Network is configured with Host-only adapter in adapter 2 tab and I don't have any DSN server setup.

Below more information on my configuration:


Test From the Windows Host:


Tests from The host OS:
===============
c:\>ping 192.168.56.10

Pinging 192.168.56.10 with 32 bytes of data:
Reply from 192.168.56.10: bytes=32 time<1ms TTL=64
Reply from 192.168.56.10: bytes=32 time<1ms TTL=64
Reply from 192.168.56.10: bytes=32 time=1ms TTL=64
Reply from 192.168.56.10: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.56.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
===================
c:\>ping linuxVM01

Pinging linuxVM01 [192.100.56.10] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.100.56.10:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
===================


Pinging FQDN:

c:\>ping linuxVM01.home

Pinging linuxVM01 [192.100.56.10] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.100.56.10:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
===============================
c:\>NSLOOKUP 192.168.56.10
Server: UnKnown
Address: 192.168.1.1

*** UnKnown can't find 192.168.56.10: Non-existent domain

c:\>NSLOOKUP linuxVM01
Server: UnKnown
Address: 192.168.1.1

Non-authoritative answer:
Name: linuxVM01
Address: 81.200.64.50


c:\>tracert linuxVM01

Tracing route to linuxVM01 [192.100.56.10]
over a maximum of 30 hops:

1 19 ms 2 ms 2 ms 192.168.1.1
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * Request timed out.
7 * * * Request timed out.
8 * * * Request timed out.
9 * * * Request timed out.
10 * * * Request timed out.
11 * * * Request timed out.
12 * * * Request timed out.
13 * * * Request timed out.

===============
c:\>ipconfig

Windows IP Configuration


Ethernet adapter Bluetooth Network Connection:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Local Area Connection* 4:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Local Area Connection* 3:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a1ed:e01d:eb50:cfef%12
IPv4 Address. . . . . . . . . . . : 192.168.56.9
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::3403:7296:45ca:62fa%5
IPv4 Address. . . . . . . . . . . : 192.168.1.8
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Ethernet:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : SWDL27.WDS

===============
===============
Tests from The Guest OS:


linuxVM01: # ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:E5:2B:E0
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fee5:2be0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:322 errors:0 dropped:0 overruns:0 frame:0
TX packets:557 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21618 (21.1 Kb) TX bytes:34525 (33.7 Kb)

eth1 Link encap:Ethernet HWaddr 08:00:27:B7:EB:B3
inet addr:192.168.56.10 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feb7:ebb3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:406 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:48426 (47.2 Kb) TX bytes:20259 (19.7 Kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:255356 errors:0 dropped:0 overruns:0 frame:0
TX packets:255356 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:80712644 (76.9 Mb) TX bytes:80712644 (76.9 Mb)
================

linuxVM01# ping lenovo-pc
PING Lenovo-PC (192.168.56.9) 56(84) bytes of data.
64 bytes from Lenovo-PC (192.168.56.9): icmp_seq=1 ttl=128 time=0.337 ms
64 bytes from Lenovo-PC (192.168.56.9): icmp_seq=2 ttl=128 time=0.985 ms
64 bytes from Lenovo-PC (192.168.56.9): icmp_seq=3 ttl=128 time=0.416 ms
64 bytes from Lenovo-PC (192.168.56.9): icmp_seq=4 ttl=128 time=0.612 ms
64 bytes from Lenovo-PC (192.168.56.9): icmp_seq=5 ttl=128 time=0.703 ms
64 bytes from Lenovo-PC (192.168.56.9): icmp_seq=6 ttl=128 time=0.439 ms
====================
linuxVM01: # cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#

127.0.0.1 localhost

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.56.10 linuxVM01.home linuxVM01
192.168.56.9 Lenovo-PC
=====================

=
Attachments
VBoxPref.png
VBoxPref.png (27.18 KiB) Viewed 4591 times
HostOnlyAdapter.png
HostOnlyAdapter.png (25.72 KiB) Viewed 4591 times
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Cannot ping Guest OS by hostname

Post by andyp73 »

If these tests are against the same machine then there is a mismatch in what you are testing.

c:\>ping 192.168.56.10
Is not the same as:
c:\>ping linuxVM01

Pinging linuxVM01 [192.100.56.10] with 32 bytes of data:
However you are resolving the name linuxVM01 to an IP address then it is getting the highlighted part differently to you manual test.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
Post Reply