Can't ping vboxnet0 IP from guest

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
talek
Posts: 4
Joined: 4. Mar 2020, 16:40

Can't ping vboxnet0 IP from guest

Post by talek »

Hello!

I'm running VirtualBox 6.1.4 r136177 (Qt5.6.3) on a macOS Catalina 10.15.3.
On the host I have configured the vboxnet0 interface as shown below:

Code: Select all

talek@mac ~ % ifconfig vboxnet0
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	ether 0a:00:27:00:00:00
	inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255
On the guest (Ubuntu 14.04.6 LTS), I have two NICs: the first one configured as a NAT adapter, the second one as a host-only adapter. In the guest OS, the network configuration is:

Code: Select all

vagrant@seneca:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:5f:bb:e6
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe5f:bbe6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:870 errors:0 dropped:0 overruns:0 frame:0
          TX packets:643 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:97101 (97.1 KB)  TX bytes:94250 (94.2 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:41:b5:e3
          inet addr:192.168.56.4  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe41:b5e3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:964 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1860 (1.8 KB)  TX bytes:93210 (93.2 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:65536  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:888 (888.0 B)  TX bytes:888 (888.0 B)
From the macos host, I can ping the guest and vboxnet0 IP without problems:

Code: Select all

talek@mac ~ % ping 192.168.56.4
PING 192.168.56.4 (192.168.56.4): 56 data bytes
64 bytes from 192.168.56.4: icmp_seq=0 ttl=64 time=0.395 ms
64 bytes from 192.168.56.4: icmp_seq=1 ttl=64 time=0.279 ms
64 bytes from 192.168.56.4: icmp_seq=2 ttl=64 time=0.408 ms
^C
--- 192.168.56.4 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.279/0.361/0.408/0.058 ms
talek@mac ~ % ping 192.168.56.1
PING 192.168.56.1 (192.168.56.1): 56 data bytes
64 bytes from 192.168.56.1: icmp_seq=0 ttl=64 time=0.063 ms
64 bytes from 192.168.56.1: icmp_seq=1 ttl=64 time=0.067 ms
64 bytes from 192.168.56.1: icmp_seq=2 ttl=64 time=0.065 ms
^C
--- 192.168.56.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.063/0.065/0.067/0.002 ms
But, when I'm trying to ping vboxnet0 from the guest, the ping command simply hangs:

Code: Select all

vagrant@seneca:~$ ping 192.168.56.1
PING 192.168.56.1 (192.168.56.1) 56(84) bytes of data.
... no output, waiting ...
However, I can ping other guests. For example:

Code: Select all

vagrant@seneca:~$ ping 192.168.56.3
PING 192.168.56.3 (192.168.56.3) 56(84) bytes of data.
64 bytes from 192.168.56.3: icmp_seq=1 ttl=64 time=0.587 ms
64 bytes from 192.168.56.3: icmp_seq=2 ttl=64 time=0.414 ms
64 bytes from 192.168.56.3: icmp_seq=3 ttl=64 time=0.520 ms
Also, I can see 192.168.56.1 in the arp table:

Code: Select all

vagrant@seneca:~$ arp -a
? (192.168.56.1) at 0a:00:27:00:00:00 [ether] on eth1
? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
? (10.0.2.3) at 52:54:00:12:35:03 [ether] on eth0
? (192.168.56.3) at 08:00:27:62:7e:11 [ether] on eth1
The firewall on guest is disabled.

Code: Select all

vagrant@seneca:~$ sudo ufw status
Status: inactive
I have tried with three different Linux distros as guests: Centos 7, Oracle Linux 7, and Ubuntu 14.

On host, the firewall is also off.
I have also disabled the packet filtering on the host, but I still can't ping the host from the guest:

Code: Select all

talek@mac seneca % sudo pfctl -d
No ALTQ support in kernel
ALTQ related functions disabled
pfctl: pf not enabled
The ip forwarding on the host is also set:

Code: Select all

talek@mac seneca % sudo sysctl net.inet.ip.forwarding=1
net.inet.ip.forwarding: 1 -> 1
Any ideas how to troubleshot further?
Thank you!
talek
Posts: 4
Joined: 4. Mar 2020, 16:40

Re: Can't ping vboxnet0 IP from guest

Post by talek »

I've tried to troubleshot further using tcpdump. So, when I ping the host from the VM, the tcpdump running on the host reveals the following:

Code: Select all

talek@mac ~ % sudo tcpdump -i vboxnet0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on vboxnet0, link-type EN10MB (Ethernet), capture size 262144 bytes
20:23:50.101847 ARP, Request who-has 192.168.56.1 tell 192.168.56.4, length 46
20:23:50.101851 ARP, Request who-has 192.168.56.1 tell 192.168.56.4, length 46
20:23:50.101907 ARP, Reply 192.168.56.1 is-at 0a:00:27:00:00:00 (oui Unknown), length 28
20:23:50.102010 IP 192.168.56.4 > 192.168.56.1: ICMP echo request, id 1784, seq 1, length 64
20:23:51.109533 IP 192.168.56.4 > 192.168.56.1: ICMP echo request, id 1784, seq 2, length 64
20:23:52.118086 IP 192.168.56.4 > 192.168.56.1: ICMP echo request, id 1784, seq 3, length 64
20:23:53.125770 IP 192.168.56.4 > 192.168.56.1: ICMP echo request, id 1784, seq 4, length 64
20:23:54.133913 IP 192.168.56.4 > 192.168.56.1: ICMP echo request, id 1784, seq 5, length 64
20:23:55.142674 IP 192.168.56.4 > 192.168.56.1: ICMP echo request, id 1784, seq 6, length 64
^C
9 packets captured
9 packets received by filter
0 packets dropped by kernel
It's like as if the host receives the ICMP request but it doesn't send the reply back to the VM.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can't ping vboxnet0 IP from guest

Post by scottgus1 »

talek wrote:On the host I have configured the vboxnet0 interface
I'm no Mac guru, so could you please explain what this 'vboxnet0' interface is and how you configure it?
talek
Posts: 4
Joined: 4. Mar 2020, 16:40

Re: Can't ping vboxnet0 IP from guest

Post by talek »

so could you please explain what this 'vboxnet0' interface is and how you configure it?
vboxnet0 is the hostonly interface created by VirtualBox:

Code: Select all

talek@mac ~ % VBoxManage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       192.168.56.1
NetworkMask:     255.255.255.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0
I use the following commands to create and configure it:

Code: Select all

talek@mac ~ % VBoxManage hostonlyif create
talek@mac ~ % VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1
talek
Posts: 4
Joined: 4. Mar 2020, 16:40

Re: Can't ping vboxnet0 IP from guest

Post by talek »

I have found the problem! It was my Endpoint Security VPN software. Even though the client was shutdown, apparently it wasn't enough! After I have uninstalled it completely, I can ping now the host from the VM. Just for reference, you may remove it using:

Code: Select all

sudo "/Library/Application Support/Checkpoint/Endpoint Security/uninstall.sh"
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can't ping vboxnet0 IP from guest

Post by scottgus1 »

Glad you found a solution!
Post Reply