I have VirtualBox running on my ubuntu 16.04.1 LTS host. I created a new virtual machine and set the network type to "Bridged Adapter". I then installed 16.04.1 LTS on the guest, but I cannot connect to any external IPv4 address from it.
When I run 'ifconfig', I only see my IPv6 address.
$ ifconfig enp0s3 enp0s3 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx inet6 addr: fd00:xx:xx:xx:xx:xx:xx:xx/64 Scope:Global inet6 addr: fe80::xx:xx:xx:xx/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:933 errors:0 dropped:0 overruns:0 frame:0 TX packets:751 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:101012 (101.0 KB) TX bytes:144480 (144.4 KB)
I am able to SSH into the guest from the host using the IPv6 address. I found this question, but I don't have network manager installed (and can't install it until IPv4 is working) and the only other command 'sudo ip link set enp0s3 up' didn't help. Also, the question doesn't mention WiFi, but the answers seem to assume this is the case, and I am using wired connections instead of WiFi.
My /etc/network/interfaces file is pretty generic, but the comments do indicate that it is an IPv6 interface. That said, I don't see why that is the case; all the parameters are correct for IPv4.
$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface # This is an autoconfigured IPv6 interface auto enp0s3 iface enp0s3 inet dhcp
Notice in my neworking.service status,there is a 5 minute gap between starting to raise the network services, and actually doing so. I am not sure what is going on there.
$ systemctl status networking.service ● networking.service - Raise network interfaces Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled) Drop-In: /run/systemd/generator/networking.service.d └─50-insserv.conf-$network.conf Active: active (exited) since Wed 2017-06-14 09:33:00 EDT; 55min ago Docs: man:interfaces(5) Process: 2335 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS) Process: 1947 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude= Main PID: 2335 (code=exited, status=0/SUCCESS) Tasks: 0 Memory: 0B CPU: 0 CGroup: /system.slice/networking.service Jun 14 09:27:58 chris-ubuntu systemd: Starting Raise network interfaces... Jun 14 09:28:01 chris-ubuntu ifup: /sbin/ifup: waiting for lock on /run/network/ifstate.enp0s3 Jun 14 09:33:00 chris-ubuntu systemd: Started Raise network interfaces.
When I manually run the dhclient, it hangs. Syslog contains the following logs:
Jun 14 10:39:13 chris-ubuntu dhclient: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 10 (xid=0x4dfcbf2b) Jun 14 10:39:16 chris-ubuntu dhclient: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 4 (xid=0x25d1c331) Jun 14 10:39:20 chris-ubuntu dhclient: No DHCPOFFERS received. Jun 14 10:39:20 chris-ubuntu dhclient: No working leases in persistent database - sleeping. Jun 14 10:39:23 chris-ubuntu dhclient: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 15 (xid=0x4dfcbf2b)
This seems strange since the host VirtualBox is acting as the DHCP Server, so it should be responding.