Create (get) newer LXC templates

dubldiz

New Member
Feb 25, 2020
2
1
1
Hello Proxmox World! Thank you for your excellent contributions.

I don't have any experience with containers until very recently. The current Archlinux image/template from proxmox is a bit stale and I wasnt able to upgrade the OS/template (whatever the vernakularr) cleanly. Basically the container borked on pacman -Syyu after restart.

I looked for info on creating templates. That lead to a lot of links about creating containers from downloads not creating actual fresh container templates. Proxmox does that fine I wanted more downloads to choose from and or to learn to create my own.

Other good links led to https://linuxcontainers.org/lxc/getting-started/#LXC - && # lxc-create -t download -n my-container - directly from there the "templates" were mostly more abundant and fresh. These are not directly usable in proxmox (I guess..)

So I eventually ran into Installing OpenWRT as LXC. How convert LXC template to Proxmox Template? Where Alwin said
If you made a rootfs (x86) and use the naming convention, then a simple creation of the CT on the GUI/CLI should do. There you can select the template then.

I did not know that...

download/ghost installed the container from lxc-create -t download -n LXCarch
grabbed the rootfs from /var/cache/lxc/download/archlinux/current/amd64/default/
moved it to proxmox template cache renamed /mnt/pve/yostorage/template/cache/archlinux-base_20200225_amd64.tar.xz (yes .xz)
then just created the container from the proxmox GUI and as Alwin said (it did) should do. Proxmox added its magic as well as i can tell apparmor and the config look sane.

# bash -version
GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)
current as of 12 days ago https://git.archlinux.org/svntogit/packages.git/log/trunk?h=packages/bash

New to LXC and containers so this is a reminder post to me and shout out to any others searching for ways to try other templates / containers in Proxmox. If any Proxmox / LXC peeps think this is an insane way to go about it I'm ready to learn more.
 
  • Like
Reactions: MadalinC
Found something new, maybe better.
archlinux appliance builder @ https://git.proxmox.com/?p=aab.git;a=summary

Tried compiling on debian but stopped

Code:
#define LIB_VERSION "11.0.3"
#define ENABLE_NLS 1
#define HAVE_GETTEXT 1
#define HAVE_DCGETTEXT 1
#define HAVE_LIBM 1

configure: exit 2
dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --disable-static --disable-doc --with-pkg-ext=.tar.xz --with-scriptlet=/bin/bash returned exit code 2
make[2]: *** [debian/rules:15: override_dh_auto_configure] Error 2
make[2]: Leaving directory '/root/tmp/arch-pacman-fce6243/pacman'
make[1]: *** [debian/rules:11: build] Error 2
make[1]: Leaving directory '/root/tmp/arch-pacman-fce6243/pacman'
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make: *** [Makefile:25: arch-pacman_5.1.3-1_amd64.deb] Error 2

building the debian pacman dependency after working past two other build errors..

I think I may look at https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=proxmox-dab-git for inspiration and try again from Arch to get aab compiled and building proxmox lxc arch containers.
 
If any Proxmox / LXC peeps think this is an insane way to go about it I'm ready to learn more.

Thanks for the updates. :)
I too saw that old thread and decided to play around with an updated version of the Arch Linux template, especially since the provided one in Proxmox suffers from the systemd v244.1 bug which basically breaks network setup without an extra /sys bind mount (can be read-only, but still don't like the idea...).

@oguz Is there any secret sauce (chages, etc) that the default Proxmox template has added to it vs the freshest LxC template?

Thanks!
 
Last edited:
hi,

Basically the container borked on pacman -Syyu after restart.
we recently pushed a new version (3.0-23) of pve-container on pvetest repository, which solves the issue with systemd. you can try using that, that way you dont need to build a template from scratch.

also just for the sake of mentioning it, after setting up an AL template:
Code:
# pacman-key --init
# pacman-key --populate archlinux
# vi /etc/pacman.d/mirrorlist
# pacman -Syy
# pacman -S archlinux-keyring
# pacman -Syyu

should get you going.

@oguz Is there any secret sauce (chages, etc) that the default Proxmox template has added to it vs the freshest LxC template?
not really, just the 'base' group and 'openssh' pkg installed. we could add more stuff if there's interest though.
 
  • Like
Reactions: MadalinC
not really, just the 'base' group and 'openssh' pkg installed. we could add more stuff if there's interest though.

Thanks for the clarification. I am using the latest image to which I added said packages, so I guess I'm already good to go.
As a sidenote, it seems to be working without needing to mount /sys in the container (yay, security).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!