Mac – Can’t reach Ubuntu guest vm from Windows host using VirtualBox Host-only interface

networkingvirtual machinevirtualbox

I used to have this working, but had to reinstall VirtualBox this morning.

I have Windows PC with VirtualBox installed. I have an Ubuntu VM. I am unable to access services on the Ubuntu VM from the Windows PC (have tried http, ftp, ssh.)

Windows Firewall is disabled (for testing purposes.)

The VM has default settings in VirtualBox, except for networking. I have configured two adapters:

  • 1 = NAT
  • 2 = Host-only

I am able to connect from the VM to the internet (so the NAT adapter is working.)

In the VirtualBox, Preference > Network > Host-only Networks, I have one adapter:

Address: 192.168.131.1
Mask: 255.255.255.0
DHCP not enabled

The output of ipconfig on the Windows host includes:

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::14a4:9141:d301:f3c3%3
   IPv4 Address. . . . . . . . . . . : 192.168.118.250
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.118.1

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1852:146c:6404:71f2%25
   IPv4 Address. . . . . . . . . . . : 192.168.131.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

On the Ubuntu guest, /etc/network/interfaces looks like this:

auto lo
iface lo inet loopback

# NAT
allow-hotplug eth0
iface eth0 inet dhcp

# Host-only
auto eth1
iface eth1 inet static
address 192.168.131.1
netmask 255.255.255.0

The output from ifconfig on the Ubuntu VM includes:

eth0  Link encap:Ethernet  HWaddr 08:00:27:87:65:1f  
      inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe87:651f/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:25 errors:0 dropped:0 overruns:0 frame:0
      TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:3609 (3.6 KB)  TX bytes:10725 (10.7 KB)

eth1  Link encap:Ethernet  HWaddr 08:00:27:82:7d:4f  
      inet addr:192.168.131.1  Bcast:192.168.131.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe82:7d4f/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Please just let me know if you require any further info.

Best Answer

You appear to have configured the host and the guest to have the same IP address.  You should change your guest's address to something like 192.168.131.101.

Related Question