Page 1 of 1

Host Only adapter when offline

Posted: 8. Dec 2014, 13:00
by RogerExplosion
Hi all,

I am running Virtualbox on a Windows 7 host, with Ubuntu as the guest OS. I am trying to run a proxy server (Polipo) on the guest. I have the odd situation that I am able to connect to Polipo when the host is connected to the internet, but not when it is offline, even though I am using a host-only adapter.

I have setup a host only network adapter -
IPv4 Address: 192.168.56.2
IPv4 Network Mask: 255.255.0.0
DHCP is disabled

In the configuration of the guest OS, I have one NAT adapter for internet access, and a second adapter connected to the Host Only network specified previously.

Inside the Guest OS (Ubuntu), I have configured the NAT adapter to use DHCP, and the host only adapter (eth0) to use a static IP address of 192.168.56.102

ipconfig on host:
Ethernet adapter VirtualBox Host-Only Network #2:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::74f1:249a:696c:b5ac%34
IPv4 Address. . . . . . . . . . . : 192.168.56.2
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . : 0.0.0.0

ifconfig on guest:
eth0 Link encap:Ethernet HWaddr 08:00:27:81:68:6e
inet addr:192.168.56.102 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::a00:27ff:fe81:686e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1807 errors:0 dropped:0 overruns:0 frame:0
TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:166197 (166.1 KB) TX bytes:11494 (11.4 KB)

Now, if my host machine is connected to the internet, I am able to reach the proxy server running on the guest machine (192.168.56.102:8123) from the host machine. If I disconnect from the internet I am no longer able to reach it, the connectiong times out, even though it should be going through the host only adapter. In both cases (online and offline) I am able to ping the guest (192.168.56.102).

I'd appreciate any troubleshooting tips anyone might be able to give me as to why the host only adapter should be sensitive to the host's connectivity?

Thanks!

Re: Host Only adapter when offline

Posted: 9. Dec 2014, 01:17
by BillG
If the host is not connected to the Internet, the proxy server guest will not be either. The only way your guest can see the Internet is through its NAT connection which shares the host's connection.
If Polipo is a simple web caching/sharing proxy, there is not much it can do for machines on the private side if it doesn't have a connection on the "public" side (unless you try to access a site which it has already cached).