LXC create centOS6 containers on RHEL 7

Hi Guys,

I am trying to create centos6 containers on RHEL7, this has been our prod setup for sometime, but not its failing as centos6 image is not available.

Command:
lxc-create -t download -n centos6 – --dist centos --release 6 --arch amd64

We cannot upgrade to centos7 now as we need more time, is there anyway we can create the containers with centos6 image now? Any help is appreciated.

Can we create a container using a custom image template instead of downloading available images online?

@monstermunchkin are historical images available anywhere?

Hi tomp,

We are not able to find centos6 images from the lxc list of container images - https://us.images.linuxcontainers.org/images/centos/.

But there are images provided by the centos on the vault -

We are not sure how to go forward from here.

Hi Carlo,

We remove all images which reach their EOL, and that happend about a month ago for CentOS 6.

However, you could try to build a CentOS 6 image using distrobuilder and this image spec.

1 Like

HI,

We still have the downloaded template on/var/cache/lxc/download/centos/6/amd64/default/. Can we use this and extend the expiry so when lxc-create runs, it will not try to download again (the image template which was already removed)?

It will take sometime for us to create our own template via the distrobuilder and the image spec.

Also what will be the command to create the container if we decided to use the new image created by the distro builder and image?

Thanks

@stgraber may know the answer to this.

That command would be distrobuilder build-lxc <image-spec-file> <target-dir>. Also just check out distrobuilder build-lxc -h.

Extending the cache expiry is certainly worth a shot.
If that doesn’t work, you can probably get -t local to consume what you have on disk by making a new meta.tar.xz from the bits you have on disk and use the existing rootfs.tar.xz

Thanks a lot! Extending the cache expiry worked, but we will still try to create a new meta.tar.xz from rootfs so we don’t lose the data when the server restarts.

Hi All,

I am trying to create centos 6 image using distrobuilder but getting below error

Error: Error while downloading source: Failed to unpack "/tmp/distrobuilder/centos-6.10-x86_64/CentOS-6.10-x86_64-minimal.iso": Failed to run script: Failed to run script: fork/exec /proc/self/fd/10: no such file or directory
ERROR  [2024-10-15T14:03:50-04:00] Failed running distrobuilder                  err="Error while downloading source: Failed to unpack \"/tmp/distrobuilder/centos-6.10-x86_64/CentOS-6.10-x86_64-minimal.iso\": Failed to run script: Failed to run script: fork/exec /proc/self/fd/10: no such file or directory"

Full Output

╰─$ \sudo /snap/bin/distrobuilder build-lxc centos.yaml /home/rpatil/                                                                                                                                                                   1 ↵
INFO   [2024-10-15T14:03:25-04:00] Downloading source                           
/tmp/distrobuilder/centos-6.10-x86_64/sha256sum.txt.asc: 100% (3.00GB/s)
gpg: Signature made Mon 02 Jul 2018 11:42:37 AM EDT
gpg:                using RSA key 0946FCA2C105B9DE
gpg: Good signature from "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>" [expired]
gpg: Note: This key has expired!
Primary key fingerprint: C1DA C52D 1664 E8A4 386D  BA43 0946 FCA2 C105 B9DE
/tmp/distrobuilder/centos-6.10-x86_64/CentOS-6.10-x86_64-minimal.iso: 100% (52.16MB/s)
INFO   [2024-10-15T14:03:33-04:00] Unpacking image                               file=/tmp/distrobuilder/centos-6.10-x86_64/CentOS-6.10-x86_64-minimal.iso
INFO   [2024-10-15T14:03:36-04:00] Unpacking root image                          file=/var/cache/distrobuilder.2074566337/temp_864290509/images/install.img
key=/var/cache/distrobuilder.2074566337/temp_864290509/RPM-GPG-KEY-CentOS-6
key=/var/cache/distrobuilder.2074566337/temp_864290509/RPM-GPG-KEY-CentOS-Debug-6
key=/var/cache/distrobuilder.2074566337/temp_864290509/RPM-GPG-KEY-CentOS-Security-6
key=/var/cache/distrobuilder.2074566337/temp_864290509/RPM-GPG-KEY-CentOS-Testing-6
Error: Error while downloading source: Failed to unpack "/tmp/distrobuilder/centos-6.10-x86_64/CentOS-6.10-x86_64-minimal.iso": Failed to run script: Failed to run script: fork/exec /proc/self/fd/10: no such file or directory
ERROR  [2024-10-15T14:03:50-04:00] Failed running distrobuilder                  err="Error while downloading source: Failed to unpack \"/tmp/distrobuilder/centos-6.10-x86_64/CentOS-6.10-x86_64-minimal.iso\": Failed to run script: Failed to run script: fork/exec /proc/self/fd/10: no such file or directory"
INFO   [2024-10-15T14:03:50-04:00] Removing cache directory       

Anyone experience this error or any possible solution ?

Thanks for all your support

Regards,
Rameshwar

@stgraber @monstermunchkin any suggestion on above issue ?

Hi Ramesh,

CentOS 6 is EOL for a while now and so is LXC. I suggest migrate to newer versions as I had migrated to RHEL 8 and Docker.

Regards,

Just for the record:

  • lxc is not end-of-life.
    • If you’re typing commands like lxc-create ... then you’re using lxc.
  • lxd is not end-of-life.
    • If you’re typing commands like lxc create ... then you’re using lxd.
    • However, lxd is now a Canonical-owned project and is not supported by linuxcontainers.org.
  • incus is the fork of lxd which is actively developed by linuxcontainers.org
  • Docker is nothing to do with any of these.

Thanks all for the response

I have to use Centos 6 for my legacy application is there any way I can build centos 6 LXC image ? I have containers running with centos 6 but those are running on openvz. we migrated to LXC in our organization and want to create centos 6 container in LXC.