sysbox icon indicating copy to clipboard operation
sysbox copied to clipboard

Unable to mount squashfs

Open mattlqx opened this issue 2 years ago • 3 comments

I'm attempting to mount squashfs images inside a sysbox runtime'd Kubernetes pod as a dependency of our Bazel build system.

➜ sudo mount img.sqfs /mnt/img -t squashfs -o loop
mount: /mnt/img: failed to setup loop device for img.sqfs.

And going down a little deeper into losetup, I see..

➜ sudo strace losetup --find --show img.sqfs
...
openat(AT_FDCWD, "/home/admin/img.sqfs", O_RDWR|O_CLOEXEC) = 4
openat(AT_FDCWD, "/dev/loop0", O_RDWR|O_CLOEXEC) = -1 EACCES (Permission denied)
...

I'd like to understand if this is a bug, configuration issue or limitation of sysbox. Thanks!

mattlqx avatar Aug 23 '23 01:08 mattlqx

Hi @mattlqx, it's likely a limitation of Sysbox at this time. I believe the setting up of loop devices inside the rootless Sysbox container is hitting an EPERM from the kernel (i.e., only true root can usually do that).

Unfortunately overcoming that is not simple, as it will require Sysbox to trap the container's set up of the loop device, vet it, and do it on behalf of the container. And do that without impacting performance is tricky. I think it's do-able but it's not something we have in the short/mid term plans.

BTW, thanks for giving Sysbox a shot!

ctalledo avatar Aug 23 '23 06:08 ctalledo

Ok thanks. Please consider this a feature request.

mattlqx avatar Aug 23 '23 13:08 mattlqx

+1

MorningLightMountain713 avatar Dec 19 '23 09:12 MorningLightMountain713