2

I recently upgrade my Ubuntu Virtual Machine (VirtualBox 5.2.8) from ubuntu 16.04 to 18.04 using do-release-upgrade -d. There were lots of issues during the upgrade. I kept having to restart/resume the upgrade using apt-get install -f and apt-get dist-upgrade. However, it eventually finished.

Now for some reason, I have to manually run sudo dhclient enp0s3 each time I reboot in order for it to pick up the network properly.

How can I set it to start properly?

I notice the following in /var/log/syslog

11291 May  2 13:24:07 my-vm dhclient[1416]: /var/lib/NetworkManager/dhclient-enp0s3.conf line 47: semicolon expected.
11292 May  2 13:24:07 my-vm dhclient[1416]: send
11293 May  2 13:24:07 my-vm dhclient[1416]: ^
11294 May  2 13:24:07 my-vm dhclient[1416]: /var/lib/NetworkManager/dhclient-enp0s3.conf line 47: expecting a statement.
11295 May  2 13:24:07 my-vm dhclient[1416]: send host-name "my-vm";
11296 May  2 13:24:07 my-vm dhclient[1416]:                        ^
11297 May  2 13:24:07 my-vm dhclient[1416]: /var/lib/NetworkManager/dhclient-enp0s3.conf line 50: semicolon expected.
11298 May  2 13:24:07 my-vm dhclient[1416]: option
11299 May  2 13:24:07 my-vm dhclient[1416]:  ^
11300 May  2 13:24:07 my-vm dhclient[1416]: /var/lib/NetworkManager/dhclient-enp0s3.conf line 71: no option named ms-classless-static-routes in space dhcp
11301 May  2 13:24:07 my-vm dhclient[1416]: also request ms-classless-static-routes;
11302 May  2 13:24:07 my-vm dhclient[1416]:               ^
11303 May  2 13:24:07 my-vm dhclient[1416]: /var/lib/NetworkManager/dhclient-enp0s3.conf line 71: ms-classless-static-routes: expected option name.
11304 May  2 13:24:07 my-vm dhclient[1416]: also request ms-classless-static-routes;
11305 May  2 13:24:07 my-vm dhclient[1416]:                                         ^
11306 May  2 13:24:07 my-vm dhclient[1416]: DHCPREQUEST of 10.0.2.15 on enp0s3 to 255.255.255.255 port 67 (xid=0x20425ef9)
11307 May  2 13:24:07 my-vm dhclient[1416]: DHCPACK of 10.0.2.15 from 10.0.2.2

running dhcpclient enp0s3 manually I see problems on different lines.

13097 May  2 15:37:32 my-vm dhclient[5756]: /etc/dhcp/dhclient.conf line 28: semicolon expected.
13098 May  2 15:37:32 my-vm dhclient[5756]: timeout
13099 May  2 15:37:32 my-vm dhclient[5756]: ^
13100 May  2 15:37:32 my-vm dhclient[5756]: /etc/dhcp/dhclient.conf line 28: expecting a statement.
13101 May  2 15:37:32 my-vm dhclient[5756]: timeout 300;
13102 May  2 15:37:32 my-vm dhclient[5756]:             ^
13103 May  2 15:37:32 my-vm dhclient[5756]: /etc/dhcp/dhclient.conf line 28: semicolon expected.
13104 May  2 15:37:32 my-vm dhclient[5756]: 
13105 May  2 15:37:32 my-vm dhclient[5756]: ^
13106 May  2 15:37:32 my-vm dhclient[5756]: DHCPREQUEST of 10.0.2.15 on enp0s3 to 255.255.255.255 port 67 (xid=0x392381bf)
13107 May  2 15:37:32 my-vm dhclient[5756]: DHCPACK of 10.0.2.15 from 10.0.2.2

EDIT

I fixed the error in var/log/syslog file. I was missing a semicolon on a line in /etc/dhcp/dhclient.conf

However this did not solve the problem.

And I found this:

15687 May  2 16:30:12 mds-vm dnsmasq[1424]: chown of PID file /run/NetworkManager/dnsmasq.pid failed: Operation not permitted
...
15690 May  2 16:30:12 mds-vm NetworkManager[897]: <info>  [1525293012.4308] dnsmasq[0x5601285fd1e0]: dnsmasq appeared as :1.26

EDIT

I tried reinstalling:

sudo apt-get install --reinstall dnsmasq dnsmasq-base network-manager network-manager-config-connectivity-ubuntu isc-dhcp-client

but it did not fix the problem.

EDIT I removed dns=dnsmasq from /etc/NetworkManager/NetworkManager.conf and things seem to be working.

2

I removed dns=dnsmasq from /etc/NetworkManager/NetworkManager.conf and things seem to be working.

Using dnsmasq is indeed 'deprecated' as Ubuntu 18.04 LTS switches to using systemd-resovled by default instead. While it is still possible to revert and use dnsmasq with NetworkManager, one might also need to disable or reconfigure systemd-resolved to avoid conflicts. E.g. I had to revert to using dnsmasq because of resolvconf: use /run/systemd/resolve/resolv.conf if systemd-resolved manages DNS still not presently backported to the docker CE version in Ubuntu 18.04 LTS and causing containers to not be able to resolve DNS on corporate networks that block access to the default public DNS servers docker falls back on.

chown of PID file /run/NetworkManager/dnsmasq.pid failed: Operation not permitted

The above warning is not a fatal issue and dnsmasq can still be used with NetworkManager. This was resolved in the dnsmasq-base base package version 2.79-1 (and 2.78-3) by downgrading the failed chown action as just a warning. See: Debian Bug report logs - 889857 message 10.

Also, diff from 2.78-2 to 2.78-3. The line of code generates a warning instead:

my_syslog(LOG_WARNING, "chown of PID file %s failed: %s", daemon->runfile, strerror(chown_warn));
2

After upgrade from 16.04 (xenial) to 18.04 (bionic) Network Manager had no DNS.

Although I wrote DNS in GUI.

Really, removing dns=dnsmasq helped me.

Thank you very much!

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.