0

I’m using Virtualbox 4.3.30 and I’ve successfully set a virtual machine up with a host-only network to work on DHCP with a non-static IP, but of course, for a virtual machine server, it’s essentially useless. So now, I’m trying to set up a virtual machine Linux server with access to the internet, and a host-only static IP. Host is Windows 8.1, guest is Ubuntu server.

VM config

I have two network devices, one for NAT, and one host-only set to adapter #3. The NAT allows for access to the internet which works. The host-only adapter doesn’t allow the host to access the virtual machine.

VirtualBox config

Host-only adapter #3 has DHCP disabled, an IP of 192.168.50.101, and a netmask of 255.255.255.0.

The VM system

After running:

sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up

…(from here then ifconfig reveals that eth1 (host-only) is connected to the IP address. On the virtual machine, if I do wget 192.168.50.101 it pulls down the default Nginx page on itself. From the host I’m able to ping the static IP address however in the browser, the IP address times out with the message Unable to connect.

Stuff I've tried!

I have also tried editing /etc/network/interfaces from here to no success.

What’s happening here? I’m guessing it can’t be a firewall issue as the host connects when the host-only is using DHCP and I can successfully ping from the host. It also looks like the browser's "cannot connect message" appears in the browser faster than a simple timeout.

Update:

I think I've hit on a bug - if I activate the DHCP in the network only adapter, and set the lower and upper to the same ip address, it seems the browser can all of a sudden allow the network to occur and succeeds.

5
  • Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0 Commented Oct 9, 2015 at 16:40
  • Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running. Commented Oct 9, 2015 at 16:48
  • Not an nginx issue as I also have gogs on the server which also does not receive connections on the static ip, but does if the host-only device is set to use the dhcp wtih a different adaptor. Commented Oct 9, 2015 at 17:25
  • I'm confused myself, I can ping whatever IP address I set on the static, but the browser won't connect to either Nginx or gogs, though will on the DHCP adapter (even when only two adapters are enabled at one, the Nat and DHCP host-only, or NAT and static host-only) - it's as if the static adapter is not accepting connections, but is only responding to pings Commented Oct 9, 2015 at 18:33
  • the other adapter is bog standard nat. i've deleted the additional host-only adapter Commented Oct 9, 2015 at 19:18

0

You must log in to answer this question.

Browse other questions tagged .