i migrated a vm (virtual box) with ubuntu server installed to a new host. Now it always fails to setup the network on boot.
After reboot i always run /etc/init.d/networking restart
. After this the server gets an ip.
Does anyone have a solution for this. I could just write the command in the boot script. However, this seems like worst practice.
You just need to enable to it during boot time.
check it's status,
sudo systemctl status networking.service
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
This is second line of status on my system, It is showing
enabled; vendor preset: enabled
. The first enabled means that it is enabled at the start time. Thevendor preset: enabled
means it is automatically enabled when installed(from the vendor).This will do the trick for you,
sudo systemctl enable networking.service