It looks like it downloads a "tar.xz" stage3 and feeds it to bzip2 (or is it just 'zip2'?). Anyway, the decompressor doesn't look like happy : # lxc-create -t gentoo -n test -f guest.conf ### set_default_arch: default arch/variant autodetect... => Got: arch=amd64 variant=amd64 Attempting to obtain an exclusive lock (timeout: 60 sec) named "cache-amd64-amd64"... => done. => Executing "do_all" ###### cache_setup(): doing cache preparation ### cache_precheck(): doing some pre-start checks ... ### cache_stage3(): stage3 cache deployment... Determining path to latest Gentoo amd64 (amd64) stage3 archive... => downloading and processing http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-stage3-amd64.txt => Got: 20180315T214502Z/stage3-amd64-20180315T214502Z.tar.xz Downloading/untarring the actual stage3 tarball... --2018-03-18 01:43:08-- http://distfiles.gentoo.org/releases/amd64/autobuilds/20180315T214502Z/stage3-amd64-20180315T214502Z.tar.xz Resolving distfiles.gentoo.org... 2a00:8a60:e012:a00::21, 2605:bc80:3010::134, 2600:3402:200:227::2, ... Connecting to distfiles.gentoo.org|2a00:8a60:e012:a00::21|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 188872380 (180M) [application/octet-stream] Saving to: ‘STDOUT’ - 0%[ ] 0 --.-KB/s bzip2: (stdin) is not a bzip2 file. tar: Child died with signal 13 tar: Error is not recoverable: exiting now
My current workaround is to change the tar option in the file /usr/share/lxc/templates/lxc-gentoo That works, but is clearly not a fix :)
I get the same error on LXC 2.1.1, but not when using LXC 3.0.1 with lxc-templates installed. When I look at the template itself, I see it changed substantially, so I guess the issue was fixed upstream. Closing.