[systemd-devel] systemd-nspawn: access to disk devices does not work on centos 7/systemd 219

Mailing List SVR lists at svrinformatica.it
Wed Jan 16 08:20:30 UTC 2019


Well, this command will make the sd devices readable inside the 
container on centos 7 too

echo 'b 8:* rw' > 
/sys/fs/cgroup/devices/machine.slice/machine-bionic\\x2druntime.scope/devices.allow

now I'll will search how to pass to systemd-nspawn using a command line 
argument


Il 16/01/19 01:42, Mailing List SVR ha scritto:
> Hi,
>
> I'm quite new to systemd-nspawn,
>
> I configured a systemd container based on ubuntu bionic using 
> debootstrap.
>
> I can start the container from a bionic host (systemd 237) with a 
> command like this one
>
> systemd-nspawn -b -D bionic-devel 
> --capability=CAP_SYS_TIME,CAP_SYS_RAWIO --bind=/dev/sda
>
> and inside the container I have read/write permissions on /dev/sda, 
> for example cat /dev/sda works fine.
>
> If I start the same container from Arch Linux (systemd 240) it works 
> the same way: /dev/sda is accessibile,
>
> but if I start this container from centos 7 (systemd 219) I cannot 
> read /dev/sda
>
> cat /dev/sda
> cat: /dev/sda: Operation not permitted
>
> I tryed to disable selinux with no luck and I cannot see nothing 
> relevant in the logs,
>
> can the problem be related to the old systemd version? Any idea on how 
> to debug this issue?
>
> thanks!
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list