I'm running Android within Virtual Box and I'm trying to configure NAT in the host machine (Ubuntu Linux) so that the VM has access to the Internet.

In the Android guest I did:

ifconfig eth0
ip route add default via

Below is the current configuration taken from a screenshot:

enter image description here

As you can see, when I try to ping I get the error "connect: Network is unreachable". However, there is a default gateway set and the IP address is the proper one: in the host machine, the vboxnet0 interface is (which in this case I will make act as a router).

Here is a screenshot with the VirtualBox network configuration:

enter image description here

I know I have to deal with iptables to make one net reach the other through the host machine, but I can't get there until I fix the issue described above (network unreachable).

  • You may wish to consider adding which virtual networking mode you are using for VirtualBox. Jul 3, 2018 at 5:06
  • @Anaksunaman just attached a screenshot with the network configuration: host-only adapter, vboxnet0 Jul 6, 2018 at 4:17


Your Answer

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

Browse other questions tagged or ask your own question.