Cannot ping/connect to guest from host, host-only

Discussions related to using VirtualBox on Windows hosts.
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Cannot ping/connect to guest from host, host-only

Post by Lkopo »

Hello,

after an upgrade of VirtualBox (not current version, but previous one) I found that Host-Only adapter was deleted, so I just added it via Preferences -> Networks -> Host-Only networks. When I run the guest (Ubuntu 14.04), the IP of Host-Only network is right (192.168.56.101) but I am not able to connect to guest even ping that IP. But what is interesting, I am able to ping the IP of host (192.168.185.1) from guest. I tried to delete file /etc/udev/rules.d/70-persistent-net.rules as mentioned in topic which I cannot link now, but this file does not exist in my guest.

Hope I fill find finally solution here, thank you for any help.

The guest log file and output of VBoxManage showwminfo command are attached below.
Attachments
command_output.log
(3.19 KiB) Downloaded 100 times
MyUbuntu-2016-04-05-23-20-58.log
(109.84 KiB) Downloaded 129 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot ping/connect to guest from host, host-only

Post by Perryg »

post the ifconfig of the guest.
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Re: Cannot ping/connect to guest from host, host-only

Post by Lkopo »

Here it is:

Code: Select all

eth0      Link encap:Ethernet  HWaddr 08:00:27:2a:6f:b3  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe2a:6fb3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:16130 (16.1 KB)  TX bytes:17990 (17.9 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:31:b2:8e  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe31:b28e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1180 (1.1 KB)  TX bytes:13284 (13.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:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:11620 (11.6 KB)  TX bytes:11620 (11.6 KB)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot ping/connect to guest from host, host-only

Post by Perryg »

I would investigate a firewall issue.
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Re: Cannot ping/connect to guest from host, host-only

Post by Lkopo »

Do you mean firewall on guest or host? On host I tried to add IP 192.168.56.101 to "always allow list" (I don't remember how it is called, I tried it few weeks later) but no effect then.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot ping/connect to guest from host, host-only

Post by Perryg »

Since you have a one way link that works then you must assume that the pipe is valid. Only think that I can think of is a firewall issue or virtual software that restricts the LAN in some way. Temporarily disable the firewalls and virus software and see if it works. Then turn them on one at a time and see where it fails.
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Re: Cannot ping/connect to guest from host, host-only

Post by Lkopo »

I've disabled firewall & antivirus on host, in Ubuntu I am not sure how (I don't have iptables installed) and still no change - cannot ping the guest.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot ping/connect to guest from host, host-only

Post by Perryg »

Post the following from the hosts command window:

Code: Select all

VBoxManage list hostonlyifs
Note: you must be in the directory that has VBoxManage

Also in the guest, did you leave it set to DHCP or have you used static? If the latter change it to DHCP and test.
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Re: Cannot ping/connect to guest from host, host-only

Post by Lkopo »

Output from the command:

Code: Select all

Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            16771892-13e7-4416-870b-9f7c08cb032e
DHCP:            Disabled
IPAddress:       192.168.185.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:24ff:5737:9bdc:f09c
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:04
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter

Name:            VirtualBox NDIS 6.0 Miniport Driver
GUID:            368d06b2-8564-4a8f-9902-a7c8438b8451
DHCP:            Disabled
IPAddress:       169.254.239.195
NetworkMask:     255.255.0.0
IPV6Address:     fe80:0000:0000:0000:0853:84ee:4be7:8d5d
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:08
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox NDIS 6.0 Miniport Driver
The second question, I am not quite sure, do you mean this (image in attachment, because I cannot send links yet)?
Attachments
dhcp.png
dhcp.png (69.51 KiB) Viewed 24432 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot ping/connect to guest from host, host-only

Post by Perryg »

No I actually meant what I said. The way you configured the guest itself. Did you leave it set to DHCP or did you enter a static address?
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Re: Cannot ping/connect to guest from host, host-only

Post by Lkopo »

In Ubuntu I have Automatic (DHCP) for IPv4 set for both Ethernet adapters. I wasn't setting IP manually in my guest.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot ping/connect to guest from host, host-only

Post by Perryg »

You show IPAddress: 192.168.185.1 but the address of your DHCP is 192.168.56.100 ( 101-254) which will never work.

The default is 192.168.56.1 for the host-only. Double check that you have set it properly and make sure to cold boot the host.
Lkopo
Posts: 7
Joined: 6. Apr 2016, 10:02

Re: Cannot ping/connect to guest from host, host-only

Post by Lkopo »

Thank you so much!

The problem was here, it was set by default when I created this adapter, so changing the IPv4 address in Adapter tab (Preferences -> Network -> Host-Only Networks) to 192.168.56.1 finally fixed the issue. Thank you again.
halcyonwild
Posts: 8
Joined: 10. Aug 2016, 14:07

Re: Cannot ping/connect to guest from host, host-only

Post by halcyonwild »

Perryg wrote:You show IPAddress: 192.168.185.1 but the address of your DHCP is 192.168.56.100 ( 101-254) which will never work.

The default is 192.168.56.1 for the host-only. Double check that you have set it properly and make sure to cold boot the host.
+1. Thanks. Works for me.
Linux Mint Guest OSes use DHCP (10.0.5.100, 255.255.255.0, 10.0.5.101-254). Host is Windows Server 2008.
I changed the default IPv4 address of the adapter to 10.0.5.1 via Virtualbox manager > File > Preferences > Network > Host Only Adapters > Edit button.
gbuday
Posts: 4
Joined: 4. Mar 2021, 14:52

Re: Cannot ping/connect to guest from host, host-only

Post by gbuday »

I have the very same problem but I cannot go forward to solve it.

My data is the following:

Windows host: Ethernet 2: 192.168.56.1(this is on the host-only network adapter)

Windows guest: Ethernet 2 (Host-only interface): 192.168.56.101

I can ping from guest to host, but not from host to guest.

The DHCP server of the host is 192.168.56.100, the DHCP host range is from 192.168.56.101 to 192.168.56.254

This range seems to be OK.

What else do you need to solve this problem?
Post Reply