Lxc-create problem

Hi,
I try to create lxc with ubuntu.

I’ve changed cfg file /etc/lxc/lxc.conf to redirect container storage to my flash disc:
lxc.lxcpath = /mnt/sda1/lxc

I tried to create container by command:
/mnt/sda1$ lxc-create -t debian -n homation

but the container creation has failed with the error:
‘debootstrap’ command is missing
lxc-create: lxccontainer.c: create_run_template: 1201 container creation template for homation failed
lxc-create: lxc_create.c: main: 274 Error creating container homation

Does anybody know what is wrong? Thanks.

Hello,
yes. Name of template is wrong.

We have template ‘download’ so you need to use this command:
lxc-create -t download -n homation

Thanks,
and how I specify the linux distribution?

This is explained in our documentation. You can see there different versions. That’s OK, because we’re working on translating Czech article to English.

In Czech version you can see:

Pokud se rozhodnete pro CLI (příkazovou řádku), přihlaste se na SSH a po přihlášení zadejte příkaz

lxc-create -t download -n nazev_kontejneru

In English:

In CLI, you can use lxc-create -t download -n my_first_vm to create a new container with the desired distribution. It shows you the available options and lets you choose which distribution you would like to use and, in some cases, which version.

So this is how it looks, when I do lxc-create -t download -n test

root@turris:~# lxc-create -t download -n test
Setting up the GPG keyring
Downloading the image index

---
DIST	RELEASE	ARCH	VARIANT	BUILD
---
Turris_OS	stable	armv7l	default	2018-02-26
Turris_OS	stable	ppc	default	2018-02-26
Alpine	3.6	armv7l	default	2018-02-26
Alpine	3.7	armv7l	default	2018-02-26
ArchLinux	latest	armv7l	default	2018-02-26
Debian	Jessie	armv7l	default	2018-02-26
Debian	Stretch	armv7l	default	2018-02-26
Debian	Buster	armv7l	default	2018-02-26
Gentoo	stable	armv7l	default	2018-02-26
openSUSE	42.2	armv7l	default	2018-02-26
openSUSE	42.3	armv7l	default	2018-02-26
openSUSE	Tumbleweed	armv7l	default	2018-02-26
Sabayon	16	armv7l	default	2018-02-26
Ubuntu	Xenial	armv7l	default	2018-02-26
Ubuntu	Artful	armv7l	default	2018-02-26
Ubuntu	Bionic	armv7l	default	2018-02-26
---
** In this part you will write, which distribution and release you want ** 

Distribution: Debian
Release: Stretch
Architecture: armv7l

Downloading the image index
Downloading the rootfs

Still without success see bellow:

Distribution: Ubuntu
Release: Xenial
Architecture: armv71

Downloading the image index
ERROR: Couldn't find a matching image.
lxc-create: lxccontainer.c: create_run_template: 1201 container creation template for homation failed
lxc-create: lxc_create.c: main: 274 Error creating container homation

I see. This is common a mistake. Nothing to worry about.

The architecture is armv7l (-el) and it’s not armv71 (seventy-one).

1 Like