singularity can not make mountspaces (mount MS_SLAVE)
- Windows Version/build number
- Windows 10 CLI ver output
Microsoft Windows [Version 10.0.16299.125]
- WSL "gcc --version" output
(Ubuntu5.4.1-2ubuntu~14.04) 5.4.1 20160904
- WSL "uname -a" output
Linux hostname 4.4.0-43-Microsoft #1-Microsoft Wed Dec31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
- Steps required to reproduce
git clone https://github.com/singularityware/singularity.git cd singularity ./autogen.sh ./configure make sudo make install sudo singularity run shub://vsoch/singularity-images
- Copy of terminal output
$ sudo singularity run shub://vsoch/singularity-images
Progress |===================================| 100.0% ERROR : Could not make mountspaces slave: Invalid argument ABORT : Retval = 255
- Expected behavior
The sun is shining, the weather is sweet... You say please, but all I see is pizza..
- Strace (running
strace -ff)
https://gist.github.com/ct-clmsn/7bb63e07673330965bdf3e2f782ab951
7)
Attempted to run the singularity container software. The software compiles successfully. But, has runtime execution errors - specifically running the introductory tutorial.
8)
Detailed logs emailed to support
Ref ##2902. Fail is now:
unshare(CLONE_FS) = 0
unshare(CLONE_NEWNS) = 0
mount(NULL, "/", NULL, MS_REC|MS_SLAVE, NULL) = -1 EINVAL (Invalid argument)
Someone is going to tell you that combination of flags is not currently supported.
Might be fun to put the following at the top of mnt.c around line 22 and recompile:
#undef SINGULARITY_MS_SLAVE
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
That will change the call to:
mount(NULL, "/", NULL, MS_PRIVATE | MS_REC, NULL)
Not that I am bullish on you seeing singularity light up. It might just return EINVAL also. Or it might get you to the next blocker. Or maybe you'll get lucky.
So I did the #undef SINGULARITY_MS_SLAVE hack for the lulz. That will get you to:
$ sudo singularity run shub://vsoch/singularity-images
Progress |===================================| 100.0%
WARNING: Requested option 'mount slave' is not available on this host, using private
ERROR : No more available loop devices, try increasing 'max loop devices' in singularity.conf
ABORT : Retval = 255
Don't need to even look at the strace for that one: that is #131. Even if WSL had a loop device (it doesn't), a very good assumption is Singularity will try to mount an ext234 image on that loop device next. Which isn't in the cards, pretty much full stop.
No sunshine or sweet weather either. I might order pizza. But this issue can be a landing zone for MS_SLAVE, which is legit enough. Good post.
Yeah, as @therealkenc we currently have no support for slave or shared mounts, nor loop devices.
@therealkenc thanks for looking into this issue!
This also prevent Flatpak/Bubblewrap to work properly as they heavily rely on mounting directories
https://github.com/projectatomic/bubblewrap/blob/30548332a7d04328487906edcd999c3dab67db28/bubblewrap.c#L1995
Yes, but bubblewrap.c is a who's-who of stuff we don't have. MS_SLAVE isn't going to get you there.
Agreed, but still a step to the next blocker. Do you have a more precise idea of what seems to be missing in order to get Flatpak running ? Thanks !
I do, but it will turn this thread into a Flatpak/Bubblewrap discussion unrelated to MS_SLAVE (followed by someone mentioning Docker, and ultimately ending badly in the Law of WSL github). Bubblewrap doesn't look too bad on a second glance though, assuming some of the CLI params are avoided. The team has done a lot of work on (what looks like) enabling container scenarios. I'll ref this thread if I have anything concrete to offer. Who knows; stranger stuff has lit up.
Mount propagation flag support added in build 17666.
For the record, the wip/WSL bubblewrap branch has this workaround: https://github.com/projectatomic/bubblewrap/commit/088c24d1d50774923341a9086fa86565686c1ceb
I have not verified if t the fix that is available works for flatpak though.