LXC dosent recognize OS distribiution

AlterNet

New Member
Mar 19, 2020
6
0
1
30
I resize my LXC container (CentOS 8) and restart it but he don't wanna start now.
I try run it:

Bash:
root@proxmox:~# lxc-start -n 105 -F --logfile=lxc.log --logpriority=DEBUG
lxc-start: 105: conf.c: run_buffer: 352 Script exited with status 2
lxc-start: 105: start.c: lxc_init: 897 Failed to run lxc.hook.pre-start for container "105"
lxc-start: 105: start.c: __lxc_start: 2032 Failed to initialize container "105"
Naruszenie ochrony pamięci

Later i see in logs error about OS:
Bash:
lxc-start 105 20200323131457.423 INFO     confile - confile.c:set_config_idmaps:2003 - Read uid map: type u nsid 0 hostid 100000 range 65536
lxc-start 105 20200323131457.423 INFO     confile - confile.c:set_config_idmaps:2003 - Read uid map: type g nsid 0 hostid 100000 range 65536
lxc-start 105 20200323131457.424 INFO     lsm - lsm/lsm.c:lsm_init:50 - LSM security driver AppArmor
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "reject_force_umount  # comment this to allow umount -f;  not recommended"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for reject_force_umount action 0(kill)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for reject_force_umount action 0(kill)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for reject_force_umount action 0(kill)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for reject_force_umount action 0(kill)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "[all]"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "kexec_load errno 1"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for kexec_load action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for kexec_load action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for kexec_load action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for kexec_load action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "open_by_handle_at errno 1"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for open_by_handle_at action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for open_by_handle_at action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for open_by_handle_at action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for open_by_handle_at action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "init_module errno 1"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for init_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for init_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for init_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for init_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "finit_module errno 1"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for finit_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for finit_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for finit_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for finit_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "delete_module errno 1"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for delete_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for delete_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for delete_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for delete_module action 327681(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "keyctl errno 38"
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for keyctl action 327718(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for keyctl action 327718(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for keyctl action 327718(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for keyctl action 327718(errno)
lxc-start 105 20200323131457.424 INFO     seccomp - seccomp.c:parse_config_v2:1008 - Merging compat seccomp contexts into main context
lxc-start 105 20200323131457.424 INFO     conf - conf.c:run_script_argv:372 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "105", config section "lxc"
lxc-start 105 20200323131458.158 DEBUG    conf - conf.c:run_buffer:340 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 105 lxc pre-start produced output: unable to detect OS distribution

lxc-start 105 20200323131458.264 ERROR    conf - conf.c:run_buffer:352 - Script exited with status 2
lxc-start 105 20200323131458.265 ERROR    start - start.c:lxc_init:897 - Failed to run lxc.hook.pre-start for container "105"
lxc-start 105 20200323131458.266 ERROR    start - start.c:__lxc_start:2032 - Failed to initialize container "105"

In config file I have information about OS type:
Bash:
root@proxmox:~# cat /etc/pve/lxc/105.conf
arch: amd64
cores: 8
hostname: ownCloud
memory: 512
nameserver: 8.8.8.8
net0: name=eth0,bridge=vmbr1,firewall=1,gw=10.105.0.60,hwaddr=DE:B1:05:FD:05:8F,ip=10.105.0.210/24,type=veth
ostype: centos
rootfs: data:subvol-105-disk-0,size=100G
swap: 512
unprivileged: 1

I try upgrade Proxmox but it dosent help me.
Bash:
root@proxmox:~# pveversion -v
proxmox-ve: 6.1-2 (running kernel: 5.3.13-1-pve)
pve-manager: 6.1-8 (running version: 6.1-8/806edfe1)
pve-kernel-helper: 6.1-7
pve-kernel-5.3: 6.1-1
pve-kernel-5.0: 6.0-11
pve-kernel-5.3.13-1-pve: 5.3.13-1
pve-kernel-5.0.21-5-pve: 5.0.21-10
pve-kernel-5.0.21-3-pve: 5.0.21-7
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libpve-access-control: 6.0-6
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.0-17
libpve-guest-common-perl: 3.0-5
libpve-http-server-perl: 3.0-5
libpve-storage-perl: 6.1-5
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-3
pve-cluster: 6.1-4
pve-container: 3.0-14
pve-docs: 6.1-6
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.0-10
pve-firmware: 3.0-6
pve-ha-manager: 3.0-9
pve-i18n: 2.0-4
pve-qemu-kvm: 4.1.1-4
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-7
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1

I have another containers and containers with ubuntu works but centOS 8 not.
Any tips, suggestion and other ideas?
 
I try it:
Bash:
root@proxmox:~# zpool set cachefile=/etc/zfs/zpool.cache data


Bash:
root@proxmox:~# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-5.3.13-1-pve
Running hook script 'zz-pve-efiboot'..
Re-executing '/etc/kernel/postinst.d/zz-pve-efiboot' in new private mount namespace..
No /etc/kernel/pve-efiboot-uuids found, skipping ESP sync.
update-initramfs: Generating /boot/initrd.img-5.0.21-5-pve
Running hook script 'zz-pve-efiboot'..
Re-executing '/etc/kernel/postinst.d/zz-pve-efiboot' in new private mount namespace..
No /etc/kernel/pve-efiboot-uuids found, skipping ESP sync.
update-initramfs: Generating /boot/initrd.img-5.0.21-3-pve
Running hook script 'zz-pve-efiboot'..
Re-executing '/etc/kernel/postinst.d/zz-pve-efiboot' in new private mount namespace..
No /etc/kernel/pve-efiboot-uuids found, skipping ESP sync.
update-initramfs: Generating /boot/initrd.img-4.19.0-6-amd64
Running hook script 'zz-pve-efiboot'..
Re-executing '/etc/kernel/postinst.d/zz-pve-efiboot' in new private mount namespace..
No /etc/kernel/pve-efiboot-uuids found, skipping ESP sync.
root@proxmox:~# reboot

After reboot container still don't up.


Bash:
root@proxmox:~# zpool status
  pool: cloud
 state: ONLINE
  scan: scrub repaired 0B in 0 days 00:00:04 with 0 errors on Sun Mar  8 00:24:05 2020
config:

        NAME                                        STATE     READ WRITE CKSUM
        cloud                                       ONLINE       0     0     0
          mirror-0                                  ONLINE       0     0     0
            wwn-0x600508b1001c5d2ff2bcd27882f565f4  ONLINE       0     0     0
            wwn-0x600508b1001c21d220525e8e5d6650e1  ONLINE       0     0     0

errors: No known data errors

  pool: data
 state: ONLINE
  scan: resilvered 5,41G in 0 days 00:14:50 with 0 errors on Wed Mar 11 11:17:50 2020
config:

        NAME                                              STATE     READ WRITE CKSUM
        data                                              ONLINE       0     0     0
          mirror-0                                        ONLINE       0     0     0
            scsi-3600508b1001c48e0665c2ff20803a51c-part2  ONLINE       0     0     0
            scsi-3600508b1001ce320e1c6a0f0d4dfe978-part2  ONLINE       0     0     0

errors: No known data errors

Bash:
root@proxmox:~# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
cloud   136G  7,01M   136G        -         -     1%     0%  1.00x    ONLINE  -
data    884G  7,59G   876G        -         -     0%     0%  1.00x    ONLINE  -
 
ok, can you try: zfs mount data to make sure its mounted?
 
I see it mounted

Bash:
root@proxmox:~# zfs list
NAME                      USED  AVAIL     REFER  MOUNTPOINT
cloud                    6,64M   132G       96K  /cloud
data                     49,6G   807G      144K  /data
data/basevol-999-disk-0   392M  19,6G      392M  /data/basevol-999-disk-0
data/subvol-101-disk-0    637M  4,38G      637M  /data/subvol-101-disk-0
data/subvol-102-disk-0   1,20G  3,80G     1,20G  /data/subvol-102-disk-0
data/subvol-104-disk-0    636M  4,38G      636M  /data/subvol-104-disk-0
data/subvol-105-disk-0    745M  99,3G      745M  /data/subvol-105-disk-0
data/subvol-106-disk-0    621M  9,39G      621M  /data/subvol-106-disk-0
data/subvol-107-disk-0    388M  9,62G      388M  /data/subvol-107-disk-0
data/vm-100-disk-0       20,0G   825G     2,14G  -
data/vm-103-disk-0       25,1G   831G      907M  -

I test it like you say:

Bash:
root@proxmox:~# zfs mount data
cannot mount 'data': filesystem already mounted

I create new (clean) container with CentOS 8 and it works
 
and container 105 is still complaining about OS distribution?

what about pct mount 105? it should mount the rootfs of the container on /var/lib/lxc/105/rootfs

then you should be able to inspect the filesystem, check /etc/centos-release in there. what is the output of that? does the file exist?
 
I check it earlier and looks like ok for me:

Bash:
root@proxmox:~# zfs mount data
cannot mount 'data': filesystem already mounted
root@proxmox:~# pct mount 105
mounted CT 105 in '/var/lib/lxc/105/rootfs'
root@proxmox:~# ls /var/lib/lxc/105/rootfs/etc/
Display all 162 possibilities? (y or n)
root@proxmox:~# cat /var/lib/lxc/105/rootfs/etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

root@proxmox:~# cat /var/lib/lxc/105/rootfs/etc/centos-release
CentOS Linux release 8.1.1911 (Core)
 
I see interesting thing now,
I have the newest realease od CentOS 8 (CentOS Linux release 8.1.1911)


But my image of container is older, so when i update container in this moment he broke and i cant start.

Upadte destory my containers but why?
 
the file is present and the content looks okay, but for some reason lxc can't read it (if it was able to read the file, then it would error differently). so to me this seems like an issue with mounting the disk... but it looks like that's mounted.

you can try updating to latest versions. apt update && apt full-upgrade and then reboot should get things up to date
 
great, you can mark the thread [SOLVED] so others know what to expect
 

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!