0

I am trying to run an Ubuntu Server 16.04 guest in an Ubuntu 15.10 host with Host Only networking in VirtualBox. I am aware there are few questions with similar problems, their configuration isn't quite the same as mine and I'm still stuck after reading them.

The guest can ping and fetch data from both the host and external websites.

The host cannot ping the guest or connect to any web service running on the guest.

I am following these instructions with some details changed.

In VirtualBox

One Host-Only network created, vboxnet0 with address 192.168.100.0 and network mask 255.255.255.0.

Guest has NAT for adapter 1 (default setting) and vboxnet0 as adapter 2.

On the Host

#> ifconfig vboxnet0
vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00
      inet addr:192.168.100.0  Bcast:192.168.100.255  Mask:255.255.255.0

On the Guest

This is /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# Host-only interface
# vboxnet0 Host Only Adapter has address 191.168.100.0
# guest has address 192.168.100.1
auto enp0s8
iface enp0s8 inet static
        address         192.168.100.1
        netmask         255.255.255.0
        network         192.168.100.0
        broadcast       192.168.56.255

# NAT interface
auto enp0s3
iface enp0s3 inet dhcp

The interface names are not eth0 etc, apparently this is due to kernel evolution and it should be fine.

After a reboot, this is ifconfig

enter image description here

This seems to show the correct inet addr for enp0s8 (which is the Host Only adapter), and enp0s3 is NAT which appears to be working.

If I run route

enter image description here

I don't know how to interpret this exactly, but for some reason it lists 192.168.100.0 instead of 192.168.100.1, which is what ifconfig and /etc/network/interfaces have.

EDIT in an earlier version of this question, the static IP of the guest wasn't within the netmask range of the Host Only adapter. Then, ping seemed to hang, now ping 192.168.100.1 from the host produces

PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
From 192.168.100.0 icmp_seq=1 Destination Host Unreachable

What's wrong? Thanks.

  • I imagined 192.168.200.1 would be reachable because of the existence of vboxnet0, that's it's raison d'etre (I have not idea why it's .0 in route). And I have no idea what you mean about the netmask, 196.168.100.0 is supposed to be the gateway, I believe. – spraff Sep 12 '16 at 0:13
  • Apologies if I was unclear. To rephrase, why do you think I would want 192.168.100.2 as the address? The scheme I'm going for is 192.168.100.n is the nth machine, with n starting from 1, so far there's only one machine (guest). – spraff Sep 12 '16 at 9:15
  • I managed to figure out what was wrong but you're really being incredibly unhelpful. You basically just scorned me for knowing less than you while giving no insight into why any of the above is wrong. Please take a moment to reflect on how that comes across in a community designed for helping people. – spraff Sep 12 '16 at 12:06
0

It started working when I changed vboxnet0 to have an IP address of 192.168.100.254 instead of 192.168.100.0.

0

192.168.100.0 is a reserved IP address for the network (when the mask is 255.255.255.0)

Change the host address (192.168.100.100 or 192.168.100.2)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.