Subject: bug#59185: closed (Re: bug#59185: Trouble mounting recursive file systems in containers)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 20 Nov 2022 20:37:02 +0000

Your bug report

#59185: Trouble mounting recursive file systems in containers

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
59185: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59185
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#59185: Trouble mounting recursive file systems in containers
From: Ricardo Wurmus <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked]
Date: Sun, 20 Nov 2022 21:35:21 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Ludovic Courtès <[email-masked]> writes:

> Ricardo Wurmus <[email-masked]> skribis:
>
>> yes, mounting with MS_REC seems sensible.  Not mounting with MS_REC is
>> also responsible for a couple of errors e.g. when trying to map / inside
>> the container (when / has other bind mounts).
>
> Having reread mount(2), bind-mounting with MS_REC by default seems like
> a reasonable choice, indeed.

Great.  I’ve pushed this with commit c585b4bc68813a351d6a87d19b9adf4041506355.

-- 
Ricardo

Subject: Trouble mounting recursive file systems in containers
From: Morgan Smith <[email-masked]>
To: [email-masked]
Date: Thu, 10 Nov 2022 17:35:09 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello!

So I was trying to mount /run/user/1000 in a container so it would have
access to all my wayland sockets and such when I got a very cryptic
error message.

I was trying something like this:

guix shell --share=/run/user/1000 -C coreutils

After far too long tracking down the issue, it turns out that the
directory had submounts within it meaning that the MS_REC flag is
required to bind mount it.

My /run/user/1000 only had a submount because xdg-document-portal was
making one.  To test this yourself you can run `mount` to find something
with some submounts.  I think /sys/fs might fail for me for the same
reason.

Now I have no clue what we should do to enable this use case.  Maybe we
should allow users to specify mount options using something like this?

guix shell -C --mount=rbind,ro=/run/user/1000

Maybe we could always bind with the recursive flag?

Thanks,

Morgan