Problem: Was unable to connect to internet in the VM, and found the solution as described in a previous blog post.

The problem that remains is - had to sudo dhclient eth0 everytime when the VM restarts. Is there a way to do this automatically?

Solution:

Using this post:

https://superuser.com/questions/151936/how-to-automate-running-the-dhclient-in-ubuntu

tried the steps:

You should check your network configuration in:

/etc/network/interfaces

If you want DHCP, it should be something like this:

auto eth0

iface eth0 inet dhcp

Inspected my file:

After making the above changes in this file, do not need to run sudo dhclient eth0 anymore!