Network and Internet on Virtual Box, Ubuntu


Need to:
So that the guest OS is available from the host on the local network, namely Ubuntu Server with webmin, as well as Internet access from the guest OS.

I put Ubuntu Server, initially the Internet works, but, of course, there is no network. I am trying to configure the network, changing the 1st adapter to the Virtual Host Adapter, the second to NAT. In /etc/network/interfaces write

 # The hostonly network interface
  auto eth0
  iface eth0 inet static

The network seems to appear. If you register ping on the host – everything is ok. But the Internet on the guest is no longer there.

How to set up this case correctly, and what exactly might be the problem?


answer from comment:

this is definitely solved in two ways: 1. Adding host-only and nat-adapters 2. Adding a bridged adapter, which will force the VM to register as a full-fledged network device, although with the same MAC address you are trying to implement the first option, and obviously the VM tries to use the first adapter to send packets to the Internet, and it ends up with a host machine (and it needs a second one).

Scroll to Top