Can't create LXC container: "unable to detect OS distribution"

joshuapl

New Member
Jun 1, 2023
5
1
3
Hello,

I tried to create an LXC container, based on my own template - actually, it is based on a custom Linux distribution named "PLD Linux".

I checked how a template should look like, what files seem to be required etc.
Finally, I've gone through the creation procedure and... almost succeeded.
Unfortunately, at the end I get:

extracting archive '/var/lib/vz/template/cache/pld-mailhoar_amd64.tar.gz'
Total bytes read: 3411630080 (3.2GiB, 134MiB/s)
Detected container architecture: amd64
unknown ID 'pld' in /etc/os-release file, trying fallback detection
unable to create CT 103 - unable to detect OS distribution

Indeed, in /etc/os-release I have:
ID="pld"

I wanted to find out if there is a list of allowed IDs, and found that there is a directory /usr/share/lxc/config with various distros files, like
debian.common.conf
debian.userns.conf

Files *.userns.conf seem to be identical, so I created pld.userns.conf like all other files
For pld.common.conf I tried some simple settings:

# =============================================
# Distribution configuration
lxc.include = /usr/share/lxc/config/common.conf
lxc.arch = linux64

# Container specific configuration
lxc.rootfs.path = dir:/srv/pld/x86_64
lxc.uts.name = builder-x86_64

# Network configuration
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:71:5e:81

lxc.pty.max = 100
lxc.start.auto = 1

lxc.mount.entry = none dev/shm tmpfs rw,nosuid,nodev,create=dir
# ============================================

All done, saved.
However - when I try to create CT, the result is exactly the same:

unknown ID 'pld' in /etc/os-release file, trying fallback detection
TASK ERROR: unable to create CT 103 - unable to detect OS distribution

Any ideas what I'm doing wrong?
Is there some other file where all valid IDs are listed or something?

Best regards,
--
Jacek
 
  • Like
Reactions: shanreich