Ubuntu vm: No network interface, no UI

I have an Ubuntu VMWare virtual machine that stopped having an internet connection after a forced a shutdown.

Upon inspection there were no connections in the Network panel of Settings.

I found this previous superuser question: Ubuntu: Missing network interface and no UI and miraculously the one and only answer worked!

Only problem is that every time I boot the vm back up I have to do the whole procedure again.

Worth noting that I don't have an eth0 interface but I have one called ens33 and that's what I used for the commands.

Does anyone know what's going on or how I can just automate the procedure so that it runs every time I boot? (ugly solution, I know, but I spent hours researching and that answer is the only thing I found)

1 Answer

You want to modify the network configuration for this interface so it automatically comes up and runs dhcp.

I am not sure which network configuration strategy your linux is using; your answer depends on which of these files exists:

/etc/network/interfaces

Given Ubuntu, it's probably this strategy.

Put these two lines into the file if they are not present already, and remove other lines related to ens33:

auto ens33
iface ens33 inet dhcp

Note: If you see the line "source /etc/network/interfaces.d/*.cfg", you may also have a "/etc/network/interfaces.d/ens33.cfg" file. If you see this line in your interfaces file, it would be more appropriate to put your changes into the ens33.cfg file.

/etc/sysconfig/network-scripts/ifcfg-ens33.cfg

In the future most distributions should be shifting to this configuration strategy so I am putting it for future users. This should be the contents of the file, and probably nothing else.

DEVICE=ens33
BOOTPROTO=dhcp
ONBOOT=yes

If you are still encountering issues, please post the contents of these files.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like