I'm a facing a trouble in Ubuntu 16.04 desktop 64bit on VirtualBox where I can not find network interfaces by using ifconfig.

$ ifconfig

lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)

But using ifconfig -a shows enp0s3 (NAT) and enp0s8 (host-only) network adapters. I've edited /etc/network/interfaces and renamed eth0 and eth1 to enp0s3 and enp0s8 which solved the issue.

auto lo
iface lo inet loopback

allow-hotplug enp0s3 
iface enp0s3 inet dhcp

allow-hotplug enp0s8 
iface enp0s8 inet dhcp

However, in case I want to deploy the image some where else like VMware or KVM still I need to rename the adapters. How can I make it automatic?

  • the interfaces should come up automatically if you defined them in the vm settings , you might need to install the vmware guest tools – Amias Jun 29 '16 at 9:38
  • For other VMs (e.g., Ubuntu 14.04) it works fine but in this specific VM it fails. – encodeflush Jun 29 '16 at 10:24
  • what is the config for this vm ? and what differs from the working vm ? – Amias Jun 29 '16 at 14:01
  • They have identical config. Still I'm puzzled! – encodeflush Jun 30 '16 at 9:03

You can disable the use of PredictableNetwork and return to guessing the order of eth adapters by using

ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

This page details how and why these names are used https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.