So you upgraded from Ubuntu 16.04 to 18.04 and the containers stopped working? Here is how to fix.
After the upgrade I experienced some problems. The containers I created on Ubuntu 16.04 could not be started, in fact they did not even show up in the lxc-ls list. Searching the net I tried this:
root@laptop01:~# cd /var/lib/lxc root@laptop01:/var/lib/lxc# lxc-update-config -c dns1/config root@laptop01:/var/lib/lxc# lxc-update-config -c ubuntu/config
Which was a good move, except it did not work. Then I did this too:
root@laptop01:~# apt install lxc-templates
And that finally fixed the containers:
root@laptop01:~# lxc-ls -f NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED dns1 STOPPED 0 - - - false ubuntu STOPPED 0 - - - false root@laptop01:~#
It seems the Ubuntu LXC containers have a few annoying tricks. Nothing really serious, but this one for example should not happen, the situation should be handled automatically while upgrading the packages/distro.