I currently try to get GPIO-access into an unprivileged LXC application container. In future this container shall execute an application. But for now (while development) I just start a normal bash in the container:sudo lxc-execute -n gpio-client -f /var/proj/gpio-client/lxc.conf -- bin/bashWhen I do this with a privileged container (means my lxc.conf doesn't contain any UID- or GID-mapping) I can use the GPIO's.The GPIO's can be access over files in /sys/class/gpio (following output comes from a bash within a privileged container which was started with the command above):bash-4.3# cd /sys/class/gpio/bash-4.3# ls -ltotal 0-rwxrwx---    1 gpio-cli 1001          4096 Feb 20 12:41 exportlrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 12:41 gpiochip890 -> ../../devices/gpiochip2/gpio/gpiochip890lrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 12:41 gpiochip898 -> ../../devices/gpiochip1/gpio/gpiochip898lrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 12:41 gpiochip906 -> ../../devices/soc0/amba/e000a000.gpio/gpio/gpiochip906-rwxrwx---    1 gpio-cli 1001          4096 Feb 20 12:41 unexportFor example I am able to export a GPIO:bash-4.3# echo 898 > exportbash-4.3# ls -ltotal 0-rwxrwx---    1 gpio-cli 1001          4096 Feb 20 14:06 exportlrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 14:06 gpio898 -> ../../devices/gpiochip1/gpio/gpio898lrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 12:41 gpiochip890 -> ../../devices/gpiochip2/gpio/gpiochip890lrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 12:41 gpiochip898 -> ../../devices/gpiochip1/gpio/gpiochip898lrwxrwxrwx    1 gpio-cli 1001             0 Feb 20 12:41 gpiochip906 -> ../../devices/soc0/amba/e000a000.gpio/gpio/gpiochip906-rwxrwx---    1 gpio-cli 1001          4096 Feb 20 12:41 unexportWhen I print the running processes on the host with ps -a I can see the running bash as root:      587 root       0:00 lxc-execute -n gpio-client -f /var/proj/gpio-client/lxc.conf -- bin/bash      598 root       0:00 /init.lxc.static -- bin/bash      615 root       0:00 bin/bashBut when I insert a UID- and GID-mapping into the lxc.conf (and also the subuids and subgids in /etc/subuid and /etc/subgid) I always get a Permission denied when I try to access /sys/class/gpio:bash-4.3# cd /sys/class/bash-4.3# ls -ltotal 0drwxrwx---    2 65534    gpio             0 Feb 20 14:11 gpiobash-4.3# cd gpio/bash: cd: gpio/: Permission deniedThis is my lxc.conf:# *************************************************************************# * general configuration# *************************************************************************# container namelxc.utsname = gpio-client# *************************************************************************# * configure networking# *************************************************************************lxc.network.type          =   vethlxc.network.flags         =   uplxc.network.link          =   local_br0lxc.network.name          =   lxcnet0lxc.network.hwaddr        =   4a:49:43:49:79:aclxc.network.ipv4          =   10.10.0.98lxc.network.ipv4.gateway  =   10.10.0.1# *************************************************************************# * configure container filesystem# *************************************************************************# set rootfslxc.rootfs = /var/proj/gpio-client/rootfs# mount needed directories from hostlxc.mount.entry=/lib                lib             none    ro,bind     0   0lxc.mount.entry=/sys/class/gpio     sys/class/gpio  none    rw,bind     0   0lxc.mount.entry=/sys/devices        sys/devices     none    rw,bind     0   0lxc.mount.entry=/usr/lib            usr/lib         none    ro,bind     0   0lxc.mount.entry=/usr/bin            usr/bin         none    ro,bind     0   0lxc.mount.entry=/bin                bin             none    ro,bind     0   0# *************************************************************************# * configure privileges of container# *************************************************************************# map user and group idslxc.include = /usr/share/lxc/config/userns.conf# comment the following out for a privileged container:lxc.id_map = u 0 1000000 65536lxc.id_map = g 0 1000000 65536This is the running linux-system:zedboard-zynq7:/var/proj/gpio-client$ cat /proc/version Linux version 4.6.0-rt1-xilinx-v2016.3 (sebastian@ubuntu1604vm) (gcc version 6.2.0 (GCC) ) #5 SMP PREEMPT RT Fri Apr 7 13:43:09 CEST 2017The system was build using Yocto for a AVNET-Zedboard (which has a Xilinx Zynq-SoC).  Does anyone have an idea or advise how to get this running or where to find the solution/information for this? I tried to get it running for a couple of hours but unfortunately I didn't managed it...  Best regardsSebastian
GPIO in unprivileged LXC container
permissions;lxc;sysfs;gpio