Tried everything...Failed to chown console


(Meai1) #1

I searched all day how to fix all these errors and problems that I’m getting with lxc.
All I tried to do is:
lxc-create --config /home/pc/test/centos-config -n test -t oci -- -u docker://opensuse/leap

Relevant configs I can think of:
/home/pc/test/centos-config

lxc.include = /usr/local/etc/lxc/default.conf
lxc.idmap = u 0 1000000 65536
lxc.idmap = g 0 1000000 65536

/usr/local/etc/lxc/lxc-usernet

pc veth virbr0 100

ls -la /home/pc/.local/share/lxc/test

drwxrwx---  3 1000000 pc       34 Feb 25 17:20 .
drwxr-xr-x  5 pc      pc       72 Feb 25 17:22 ..
-rw-r-----  1 pc      pc      961 Feb 25 17:20 config
drwxr-xr-x 17 pc      1000000 180 Feb 16 17:00 rootfs

ls -la /usr/bin/new[ug]idmap

-rwsr-xr-x 1 pc root 47296 Feb 25 17:09 /usr/bin/newgidmap
-rwsr-xr-x 1 pc root 42992 Feb 25 17:09 /usr/bin/newuidmap

lxc-start -F --name=test --logfile=log.txt --logpriority=TRACE

lxc-start test 20190225174836.564 ERROR conf - conf.c:chown_mapped_root:3217 - lxc-usernsexec failed: No such file or directory - Failed to open ttyNo such file or directory - Failed to open tt
lxc-start test 20190225174836.564 ERROR terminal - terminal.c:lxc_terminal_map_ids:1188 - Failed to chown terminal “/dev/pts/17”
lxc-start test 20190225174836.564 ERROR start - start.c:lxc_init:883 - Failed to chown console
lxc-start test 20190225174836.564 TRACE start - start.c:lxc_serve_state_clients:462 - Set container state to ABORTING
lxc-start test 20190225174836.564 TRACE start - start.c:lxc_serve_state_clients:465 - No state clients registered
lxc-start test 20190225174836.564 ERROR start - start.c:__lxc_start:1929 - Failed to initialize container “test”
lxc-start test 20190225174836.564 ERROR lxc_start - tools/lxc_start.c:main:330 - The container failed to start


(Stéphane Graber) #2

lxc-start test 20190225174836.564 ERROR conf - conf.c:chown_mapped_root:3217 - lxc-usernsexec failed: No such file or directory

Do you have the lxc-usernsexec command on your system?


(Meai1) #3

yes but I just noticed that it says this after simply executing it without any arguments:

lxc-usernsexec

lxc 20190225205925.866 ERROR conf - conf.c:lxc_map_ids:2990 - newuidmap failed to write mapping “newuidmap: write to uid_map failed: Operation not permitted”: newuidmap 33705 0 1000000 65536
Failed to write id mapping for child process
lxc 20190225205925.867 ERROR utils - utils.c:lxc_switch_uid_gid:1392 - Invalid argument - Failed to switch to gid 0


(Stéphane Graber) #4

newuidmap and newgidmap on your system are both properly setuid?


(Meai1) #5

I think so, I posted the output for those above in my original post. I’m not sure if I understand how exactly this all works with groups and users. Shouldnt everything just be my local user called ‘pc’? Also why does it say 100000 for the group? Is that really correct? I just followed the steps online.