I’m running Ubuntu on VirtualBox (4.15.0-36-generic #39 Ubuntu SMP Mon Sept 24 UTC 2018 x86_64 GNU/Linux). I’m following an Ansible tutorial which uses LXC for containers. I’ve installed LXC 3.0.2 and proceeded to create LXC containers as instructed: lxc-create -t ubuntu -n webX, but received an error:
lxc-create: webX: utils.c: get_template_path: 872 No such file or directory - bad template: ubuntu
lxc-create: webX: lxccontainer.c do_lxcapi_create: 1784 Unknown template “ubuntu”
I’ve searched and discovered that indeed the ubuntu template is not present in the templates directory in my install path (/usr/share/lxc/templates) only have the following templates listed: lxc-busybox, lxc-download, lxc-local and lxc-oci, there is not ubuntu.
The tutorial requires the ubuntu template which my lxc distro does not have. What can I do to fix that?
PS
I could create containers using ‘busybox’ template but when I start it and attach to it, it doesn’t have apt, or apt-get, or ssh… so it’s not sufficient for what i need to do.
How could uninstall lxc 3.x and install lxc 1.0 or 2.0 so that I could follow the tutorial commands without missing a beat… i have no need for lxc 3.x - it’s just the default configuation that got installed when I ran: apt-get --update && apt-get install lxc
It is neither recommended, not supported to run LXC 1.0 in what I assume is Ubuntu 18.04. Also, if I am not mistaken, the commands you try to use are deprecated also in LXD 2.x
There is LXC and there is LXD. The first is an older project and has commands that look like lxc-create. LXD is newer and more user-friendly. If you do not know which to use, use LXD. LXD has commands like lxc launch.
Unfortunately, many confuse the two and use the commands interchangeably. This is messy.
maybe lxd should come with a text file or man page that explains what is going on, a tiny shell script to display it, and a bunch of symlinks for lxc-* commands that refer to that script. i guess the target base of users for the explanation are those who have been using lxc 1.0.