Thanks ich777 for this wonderful plugin, but I'm having issues mounting loop devices inside the container.
I tried binding `mapper` `fuse` `loop-control` and `loop$i` devices, but losetup would always return `Operation not permitted`.
Here are the additional lines I added to the config, using ubuntu/focal image:
lxc.cgroup.devices.allow = c 10:237 rwm
lxc.cgroup.devices.allow = b 7:* rwm
lxc.cgroup.devices.allow = b 10:236 rwm
lxc.cgroup.devices.allow = b 10:229 rwm
lxc.mount.entry = /dev/loop-control dev/loop-control none bind,create=file 0 0
lxc.mount.entry = /dev/loop0 dev/loop0 none bind,create=file 0 0
lxc.mount.entry = /dev/loop1 dev/loop1 none bind,create=file 0 0
lxc.mount.entry = /dev/loop2 dev/loop2 none bind,create=file 0 0
lxc.mount.entry = /dev/loop3 dev/loop3 none bind,create=file 0 0
lxc.mount.entry = /dev/loop4 dev/loop4 none bind,create=file 0 0
lxc.mount.entry = /dev/loop5 dev/loop5 none bind,create=file 0 0
lxc.mount.entry = /dev/loop6 dev/loop6 none bind,create=file 0 0
lxc.mount.entry = /dev/loop7 dev/loop7 none bind,create=file 0 0
lxc.mount.entry = /dev/mapper dev/mapper none bind,create=dir 0 0
lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file 0 0
(I know mounting loop0-3 is dangerous, that's why I'm looking for a solution.)
My goal is running a script inside the lxc (and it requires mounting some block files), I do not want to mount those images on host then bind them (as the script will mount, modify, unmount and save the modification, package as a zip, remove the original file).
I've seen people saying that I need to run it as privileged, but I'm not sure about that. For testing, I made a simple 1GB img file with GPT format and one partition inside, and I try to mount it (the script linked bellow breaks at the mounting part).
Script in question: https://github.com/LSPosed/MagiskOnWSALocal