I am trying to run unprivileged lxc container in openwrt (lxc 2.1.1). I am getting Operation not permitted error…
Any idea? Thanks
root@OpenWrt:~# lxc-create --name ubuntu -t download -- --server images.linuxcontainers.org -d ubuntu -r bionic -a amd64
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs
tar: can't create node ./dev/ptmx: Operation not permitted
tar: can't create node ./dev/tty: Operation not permitted
tar: can't create node ./dev/urandom: Operation not permitted
tar: can't create node ./dev/random: Operation not permitted
tar: can't create node ./dev/full: Operation not permitted
tar: can't create node ./dev/zero: Operation not permitted
tar: can't create node ./dev/null: Operation not permitted
---
You just created an Ubuntu bionic amd64 (20180719_08:51) container.
To enable SSH, run: apt install openssh-server
No default root or user password are set by LXC.
Host mounts:
root@ubuntu:~# cat /proc/self/mounts
/dev/root / ext4 rw,noatime,block_validity,delalloc,barrier,user_xattr 0 0
none /dev tmpfs rw,relatime,size=492k,mode=755,uid=100000,gid=100000 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
sysfs /sys/devices/virtual/net sysfs rw,relatime 0 0
sysfs /sys/devices/virtual/net sysfs rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys/fs/fuse/connections sysfs rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
sysfs /sys/kernel/security sysfs rw,nosuid,nodev,noexec,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
proc /proc/sys/fs/binfmt_misc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/null tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
tmpfs /dev/zero tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
tmpfs /dev/full tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
tmpfs /dev/urandom tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
tmpfs /dev/random tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
tmpfs /dev/tty tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/console devpts rw,nosuid,noexec,relatime,mode=600,ptmxmode=000 0 0
devpts /dev/pts devpts rw,relatime,gid=100005,mode=620,ptmxmode=666,max=1024 0 0
devpts /dev/ptmx devpts rw,relatime,gid=100005,mode=620,ptmxmode=666,max=1024 0 0
devpts /dev/tty1 devpts rw,relatime,gid=100005,mode=620,ptmxmode=666,max=1024 0 0
devpts /dev/tty2 devpts rw,relatime,gid=100005,mode=620,ptmxmode=666,max=1024 0 0
devpts /dev/tty3 devpts rw,relatime,gid=100005,mode=620,ptmxmode=666,max=1024 0 0
devpts /dev/tty4 devpts rw,relatime,gid=100005,mode=620,ptmxmode=666,max=1024 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,uid=100000,gid=100000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,mode=755,uid=100000,gid=100000 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,uid=100000,gid=100000 0 0
tmpfs /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,mode=755,uid=100000,gid=100000 0 0
From container:
root@ubuntu:~# ls -lha /dev/
total 4.0K
drwxr-xr-x 5 root root 420 Jul 19 19:15 .
drwxr-xr-x 21 root root 4.0K Jul 19 17:28 ..
c--x--x--x 1 root root 136, 1 Jul 19 19:15 console
lrwxrwxrwx 1 root root 13 Jul 19 19:15 fd -> /proc/self/fd
crw-rw-rw- 1 nobody nogroup 1, 7 Jul 19 16:37 full
drwxrwxrwt 2 nobody nogroup 40 Jul 19 19:15 mqueue
crw-rw-rw- 1 nobody nogroup 1, 3 Jul 19 16:37 null
crw-rw-rw- 1 root root 5, 2 Jul 19 19:15 ptmx
drwxr-xr-x 2 root root 0 Jul 19 19:15 pts
crw-rw-rw- 1 nobody nogroup 1, 8 Jul 19 16:37 random
drwxrwxrwt 2 root root 40 Jul 19 19:15 shm
lrwxrwxrwx 1 root root 15 Jul 19 19:15 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Jul 19 19:15 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Jul 19 19:15 stdout -> /proc/self/fd/1
crw-rw-rw- 1 nobody nogroup 5, 0 Jul 19 19:16 tty
crw--w---- 1 root tty 136, 0 Jul 19 19:15 tty1
crw--w---- 1 root tty 136, 1 Jul 19 19:15 tty2
crw--w---- 1 root tty 136, 2 Jul 19 19:15 tty3
crw--w---- 1 root tty 136, 3 Jul 19 19:15 tty4
crw-rw-rw- 1 nobody nogroup 1, 9 Jul 19 16:37 urandom
crw-rw-rw- 1 nobody nogroup 1, 5 Jul 19 16:37 zero
Can be this related to https://github.com/fgrehm/vagrant-lxc/issues/339#issuecomment-108150622 ?