Unable to create lxc container on centos "lxc_container: utils.c: get_template_path: 1128 No such file or directory - bad template: centos"

IP Archer picture IP Archer · Feb 3, 2016 · Viewed 6.9k times · Source

I am trying to create an lxc container on centos but I am running into the following error: [user@sdn3-lnx-01 ~]$ lxc-create -t centos -n container1

lxc_container: utils.c: get_template_path: 1128 No such file or directory - bad template: centos

lxc_container: lxccontainer.c: lxcapi_create: 1223 bad template: centos

lxc_container: lxc_create.c: main: 274 Error creating container container1

[user@sdn3-lnx-01 ~]$

Could you please help me?

Answer

fat_cheng picture fat_cheng · Feb 4, 2016

I am not familiar with centos,but on ubuntu,I met the same problem.and I fix it with execute:

sudo apt-get install lxc lxctl lxc-templates

maybe you need install some more packages.