The kernel doesn’t allow unprivileged mount in general, at least outside of virtual filesystems like tmpfs.
Incus has some limited support for bypassing that restriction with the security.syscalls.intercept.mount config keys, but that only handles a limit of cases.
OK, I did mounted the img file as you said. But why after I mounted the img file in /mnt/img, everything in the folder is owned by nobody:nogroup? Please help me once again, I only need to know how can they be owned by root:root.
I think the overall process is quite tricky because there is no information shown in the logs when you get an error. I suppose also AppArmor could be involved as well. What’s needed, are instructions on creating an Incus VM of the appropriate image, and in there create a container using an appropriate container image. Perhaps Alpine VM with Alpine container?
The alternative is to add the disk image on your storage pool and then attach to the container. Do you have a use-case where this would not work well?
Everything is about waydroid. In unprivilege container, to start waydroid, it need kernel support binder and mount img file and something about bpf. But after mount img file, everything is owned by nobody:nogroup, waydroid can’t read, so waydroid container won’t start.
Waydroid uses LXC. When you run it in an Incus container, do you enable security.nesting?
Or, are you trying to port Waydroid to use Incus containers instead of LXC?
Of cause I enabled security.nesting, I can run lxc-start in container. I just want to run Waydroid in a Incus container, but ran into too many troubles. Just trying to solve trouble one by one.