[lxc-users] lxc container rootfs dev folder permission are changing from ro to rw inside container

Yasoda Padala padala.yasoda at gmail.com
Mon Feb 25 08:27:49 UTC 2019


Hi All,
I have created lxc container based out of busybox template
Our requirement is to start the container with squashed rootfs.

Below are the steps followed to create lxc container, squash rootfs and
start

1. lxc-create -n b01 -t busybox
2. mksquashfs rootfs rootfs.sq
3. mv rootfs rootfs.org      //take backup of original rootfs
4. mkdir rootfs && sudo mount -o loop -t squashfs rootfs.sq rootfs  //mount
squashed rootfs to rootfs folder
5. lxc-start -n b01

Container starts successfully and all the folders/files of rootfs on host
machine is read-only.
 Expectation is on start and logging into container, the permissions of
rootfs files should remain intact

Actual results: dev folder of container rootfs is read-only on host machine
but inside container, it is writable.

Please help with inputs on why the dev folder permissions are changed on
lxc-attach.

Thanks for the help,
Yasoda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20190225/b93a744a/attachment.html>


More information about the lxc-users mailing list