LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-14-2016, 01:07 PM   #46
franzen
Member
 
Registered: Nov 2012
Distribution: slackware
Posts: 535

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379

Quote:
Originally Posted by camerabambai View Post
Code:
newuidmap: uid range [0-1) -> [10000-10001) not allowed
error mapping child
setgid: Invalid argument
Maybe something wrong in /etc/subuid or /etc/subgid?
 
Old 05-14-2016, 07:13 PM   #47
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
On /etc/sub*d

Code:
giuseppe:100000:165537
Is correct

When i start container..

Code:
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.
 
Old 05-14-2016, 08:27 PM   #48
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
[QUOTE=camerabambai;5545616]On /etc/sub*d

Code:
giuseppe:100000:165537
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).

chris
 
Old 05-14-2016, 10:50 PM   #49
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by camerabambai View Post
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.

chris
 
Old 05-15-2016, 09:15 AM   #50
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
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.
 
Old 05-15-2016, 09:26 AM   #51
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by camerabambai View Post
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?

chris
 
Old 05-15-2016, 09:28 AM   #52
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
Originally Posted by camerabambai View Post
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
Code:
MIRROR=http://slackware.osuosl.org lxc-create -n test2 -f /path/to/test2.conf -t slackware
where test2.conf is a file containing just a few lines, like
Code:
# cat test2.conf 
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 00:aa:11:bb:22:cd
lxc.network.ipv4 = 192.168.11.3/24
lxc.network.name = eth0
note that in this example on the host I configured a bridge on which I use NAT.

Last edited by ponce; 05-17-2016 at 04:49 AM.
 
Old 05-16-2016, 07:18 AM   #53
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
Starting with your config (total clean installation)
give me this error

Code:
lxc-create: conf.c: chown_mapped_root: 3339 No mapping for container root
lxc-create: lxccontainer.c: do_bdev_create: 1047 Error chowning /home/giuseppe//.local/share/lxc/test2/rootfs to container root
lxc-create: conf.c: suggest_default_idmap: 4443 You must either run as root, or define uid mappings
lxc-create: conf.c: suggest_default_idmap: 4444 To pass uid mappings to lxc-create, you could create
lxc-create: conf.c: suggest_default_idmap: 4445 ~/.config/lxc/default.conf:
lxc-create: conf.c: suggest_default_idmap: 4446 lxc.include = /etc/lxc/default.conf
lxc-create: conf.c: suggest_default_idmap: 4447 lxc.id_map = u 0 100000 65536
lxc-create: conf.c: suggest_default_idmap: 4448 lxc.id_map = g 0 100000 65536
lxc-create: lxccontainer.c: do_lxcapi_create: 1511 Error creating backing store type (none) for test2
lxc-create: lxc_create.c: main: 316 Error creating container test2
I have to create as root and then remap uid?
Or I can create as user editing default.conf?
 
Old 05-16-2016, 07:24 AM   #54
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
you can follow the second part of Chris' guide to create your unprivileged containers

http://www.darlo.tv/lxc/run-unpriv-slackware.html

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 View Post
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
 
Old 05-20-2016, 10:27 AM   #55
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
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.
 
Old 05-20-2016, 10:36 AM   #56
franzen
Member
 
Registered: Nov 2012
Distribution: slackware
Posts: 535

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally Posted by camerabambai View Post
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)?
 
Old 05-20-2016, 10:46 AM   #57
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
Originally Posted by camerabambai View Post
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.

creating one and starting it is pretty simple, see https://asciinema.org/a/46244

Last edited by ponce; 05-21-2016 at 09:07 AM.
 
Old 05-21-2016, 10:25 AM   #58
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
Yes step by step
step1 create the necessary files

Code:
 cat > /etc/sudoers.d/010_lxcusers <<EOF
Cmnd_Alias CGM = /usr/bin/cgm
%lxcusers	ALL = NOPASSWD: CGM
EOF
Code:
cat /etc/profile.d/lxcuser.sh <<EOF
group_member=$(groups | grep lxcusers)
[ $? -eq 0 ] && . /etc/lxc/lxc-enable-users
EOF
step2 subgids

Code:
usermod -aG lxcusers giuseppe
usermod --add-subgids 100000-165536 giuseppe
usermod --add-subuids 100000-165536 giuseppe
step3 after re-login or reboot,create the unprivileged container
Code:
sudo MIRROR=http://slackware.osuosl.org lxc-create -n test1 -t slackware
step4 converting uids
Code:
sudo container-userns-convert test1 100000

step5 "migrate" to home
Code:
mkdir $HOME/.local/share/lxc
sudo cp -a /var/lib/lxc/test1  $HOME/.local/share/lxc/test1 
vim $HOME/.local/share/lxc/test1/config #fix paths
step5 launch container and get the errors
 
Old 05-21-2016, 10:43 AM   #59
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
maybe there's a misunderstanding: it's some post I'm talking about *privileged* containers to see if those at least work.

but you keep answering about *unprivileged* containers.

please check if you can create working *privileged* container first: in my previous post there's an example https://asciinema.org/a/46244
 
Old 05-21-2016, 05:29 PM   #60
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
The privileged work
I have already tested privileged containers with lxc on
slackware.
I'm interest only on unprivileged,more safe.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LXC unprivileged container in Debian Jessie - Cgroups permissions? matiasar Linux - Kernel 6 06-07-2015 12:17 PM
Unable to start unprivileged Lxc container on Debian Sid hurd Debian 0 02-02-2015 10:45 PM
LXC unprivileged container - operation no permitted gauthig Linux - Virtualization and Cloud 2 07-15-2014 03:34 PM
[SOLVED] [LXC] Slackware 14.1 rc1 - Upgraded host & container Chuck56 Slackware 3 10-16-2013 05:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration