[SOLVED] LXC unprivileged container for Slackware guest
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
lxc-start -n fedora --foreground --logpriority DEBUG
lxc-start: utils.c: safe_mount: 1692 Operation not permitted - Failed to mount proc onto /var/lib/rootfs-lxc/proc
lxc-start: conf.c: lxc_mount_auto_mounts: 743 Operation not permitted - error mounting proc on /var/lib/rootfs-lxc/proc flags 14
lxc-start: conf.c: lxc_setup: 3720 failed to setup the automatic mounts for 'fedora'
lxc-start: start.c: do_start: 819 failed to setup the container
lxc-start: sync.c: __sync_wait: 52 An error occurred in another process (expected sequence number 2)
lxc-start: start.c: __lxc_start: 1329 failed to spawn 'fedora'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
That 165537 looks larger than I'd expect (it may be OK though). More typical values I've seen for that second number are 10000 and 65536 (what I use myself).
Tried with 4.4.10 official slackware-current/14.2 kernel and
nothing change.
Tryng with fedora image or oracle linux image give me this error
...
Please note that the guide for running unprivileged containers in Slackware is intended for a Slackware host and Slackware guest. Other guest distros may work but I'm doubtful, since guests using systemd will probably need systemd support in the host and systemd is not available in stock Slackware.
Yes but the problem is Slackware container doesn't work too.
Code:
lxc-start -n test1 --foreground --logpriority DEBUG
lxc-start: utils.c: safe_mount: 1692 Operation not permitted - Failed to mount proc onto /var/lib/rootfs-lxc/proc
lxc-start: conf.c: tmp_proc_mount: 3488 Operation not permitted - failed to mount /proc in the container.
lxc-start: conf.c: lxc_setup: 3785 failed to LSM mount proc for 'test1'
lxc-start: start.c: do_start: 819 failed to setup the container
lxc-start: sync.c: __sync_wait: 52 An error occurred in another process (expected sequence number 2)
lxc-start: start.c: __lxc_start: 1329 failed to spawn 'test1'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
Yes but the problem is Slackware container doesn't work too.
Code:
lxc-start -n test1 --foreground --logpriority DEBUG
lxc-start: utils.c: safe_mount: 1692 Operation not permitted - Failed to mount proc onto /var/lib/rootfs-lxc/proc
...
Is this the system where you had the uidmapshift problem (newuidmap: uid range [0-1) -> [10000-10001) not allowed etc.)?
Since you're trying this on multiple systems, its not always clear which one you're referring to. Anyway, if uimapshift fails, the container won't work; we'd have to figure out what your problem with uidmapshift is.
BTW have you tried running the container as a privileged container i.e. before converting to unprivileged? If not, can you try that with a new container?
Yes but the problem is Slackware container doesn't work too.
Code:
lxc-start: utils.c: safe_mount: 1692 Operation not permitted - Failed to mount proc onto /var/lib/rootfs-lxc/proc
lxc-start: conf.c: tmp_proc_mount: 3488 Operation not permitted - failed to mount /proc in the container.
can you please also post the configuration of your container "test1"?
if I understand the error correctly it seems to be looking for its rootfs in the default location instead of where you actually have it...
you can create on slackware current a fresh container yourself pretty fast in /var/lib/lxc/test2 using lxc-create
and, as Chris asked in his last post, you better try running the fresh-created container as privileged first before trying it as unprivileged.
Quote:
Originally Posted by camerabambai
Starting with your config (total clean installation)
my few-lines-config is just used to assemble the complete one that, after lxc-create has finished, you can find in /var/lib/lxc/test2/config
if the privileged container doesn't start, check and eventually post that.
Last edited by ponce; 05-17-2016 at 04:53 AM.
Reason: one step at a time
Created the privileged
started as privileged doesn't work too
Code:
newuidmap: uid range [0-10000) -> [100000-110000) not allowed
lxc-start: conf.c: userns_exec_1: 4314 Error setting up child mappings
lxc-start: cgmanager.c: chown_cgroup: 489 Error requesting cgroup chown in new namespace
newuidmap: uid range [0-10000) -> [100000-110000) not allowed
lxc-start: start.c: lxc_spawn: 1191 failed to set up id mapping
lxc-start: start.c: __lxc_start: 1329 failed to spawn 'test1'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
and if I set subgid for root..
Code:
lxc-start: conf.c: mount_rootfs: 807 Permission denied - failed to get real path for '/var/lib/lxc/test1/rootfs'
lxc-start: conf.c: setup_rootfs: 1221 failed to mount rootfs
lxc-start: conf.c: do_rootfs_setup: 3611 failed to setup rootfs for 'test1'
lxc-start: conf.c: lxc_setup: 3693 Error setting up rootfs mount after spawn
lxc-start: start.c: do_start: 819 failed to setup the container
lxc-start: sync.c: __sync_wait: 52 An error occurred in another process (expected sequence number 2)
lxc-start: start.c: __lxc_start: 1329 failed to spawn 'test1'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
Last edited by camerabambai; 05-20-2016 at 10:30 AM.
Created the privileged
started as privileged doesn't work too
Code:
newuidmap: uid range [0-10000) -> [100000-110000) not allowed
lxc-start: conf.c: userns_exec_1: 4314 Error setting up child mappings
lxc-start: cgmanager.c: chown_cgroup: 489 Error requesting cgroup chown in new namespace
newuidmap: uid range [0-10000) -> [100000-110000) not allowed
lxc-start: start.c: lxc_spawn: 1191 failed to set up id mapping
It seems to be a permission issue. What are the permissions on the container-root-folder(/var/lib/lxc/CONTAINER/roots, ~/.lxc... whererver it is)?
Created the privileged
started as privileged doesn't work too
Code:
newuidmap: uid range [0-10000) -> [100000-110000) not allowed
lxc-start: conf.c: userns_exec_1: 4314 Error setting up child mappings
lxc-start: cgmanager.c: chown_cgroup: 489 Error requesting cgroup chown in new namespace
newuidmap: uid range [0-10000) -> [100000-110000) not allowed
lxc-start: start.c: lxc_spawn: 1191 failed to set up id mapping
lxc-start: start.c: __lxc_start: 1329 failed to spawn 'test1'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
please, post all the steps you are following to create a privileged container, with the commands you are using to do it, the related configuration files and the command you use to start it: the error seems to imply you are starting it as an unprivileged one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.