1

I am new to this I have install Ubuntu 16.04 on Virtual box and it was working fine for few days until I did the update yesterday when the network stopped working and I am not able to get an IP address on the VM any more. I am using bridged adapter. I have tried so many suggested solution from different sites but still I am not able to get an IP address in the VM.

Can I get some help of how to get the network working on virtual box.

3
  • Run ifconfig on host to find the device name, then in the VM guest go to network settings and look for that device and select it from the drop down options. Mar 18, 2017 at 20:23
  • Did you also configure a NAT network interface for the VM? I found that for Windows 10, VirtualBox 6.1.6, and Ubuntu Server 20.04, I had to create both NAT and bridge interfaces in order for Ubuntu Server to assign the static IP address to the bridge. I don't know whether the second interface must be a NAT interface in particular or any network interface type. May 2, 2020 at 2:43
  • I learned that even with the NAT network interface, the bridge still could not get an IP address unless I removed the gateway4 setting from the Netplan configuration. With the gateway, systemd-networkd complained (see networkctl status): "br0: Could not set route. Nexthop has invalid gateway. Network is unreachable". I don't understand why a bridge doesn't need (and can't have) a default gateway. May 2, 2020 at 3:55

1 Answer 1

1

First, verify network connectivity on your host, where the Virtual Box is running.

Second, shut your virtual ubuntu machine down.

Edit the setting, go to the network properties of the virtual machine and verify that network is bridged, cable connected is checked.

Start your virtual machine.

If using a desktop, then logon to the VM. Find the icon which looks like an up/down arrow, right click and choose edit connections.

Highlight the appropriate connection and choose edit. Verify your settings. if not using DHCP, then pay special attention to netmask and gateway properties. Once complete, save your settings and exit the dialog.

Right click on the Up/Down Arrow icon again, select disable networking, give it a moment, the repeat the process to Enable Networking.

If logging in from a text console, e would want to verify the values in the /etc/network/interfaces file.

ifconfig -a

This will provide a list of all active network adapters the system is able to see.

next, sudo nano /etc/network/interfaces

The file should resemble the following, more or less:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

For the value shown with ifconfig -a, substitute with eth0.

I hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .