Reputation: 135
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?
Upvotes: 6
Views: 9860
Reputation: 51
you can try
lxc-create -n ct1 -t download
& it will provide you with an inter-active solution to create the container & the list of templates & distributions supported
Upvotes: 5
Reputation: 3862
Try:
lxc-create -n container-name -t /etc/lxc/templates/lxc-centos --lxcpath=/var/lib/lxc/
You can also try:
lxc-create -n container-name -t /usr/share/lxc/templates/lxc-centos --lxcpath=/var/lib/lxc/
Basically, check which folder contains your template, /etc/lxc/templates/
or /usr/share/lxc/templates/
Upvotes: 4
Reputation: 508
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.
Upvotes: 16