GNU bug report logs - #59185
Trouble mounting recursive file systems in containers

Previous Next

Package: guix;

Reported by: Morgan Smith <Morgan.J.Smith <at> outlook.com>

Date: Thu, 10 Nov 2022 22:41:01 UTC

Severity: normal

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#59185: closed (Trouble mounting recursive file systems in
 containers)
Date: Sun, 20 Nov 2022 20:37:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 20 Nov 2022 21:35:21 +0100
with message-id <874juts6s8.fsf <at> elephly.net>
and subject line Re: bug#59185: Trouble mounting recursive file systems in containers
has caused the debbugs.gnu.org bug report #59185,
regarding Trouble mounting recursive file systems in containers
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
59185: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59185
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
To: bug-guix <at> gnu.org
Subject: Trouble mounting recursive file systems in containers
Date: Thu, 10 Nov 2022 17:35:09 -0500
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


[Message part 3 (message/rfc822, inline)]
From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 59185-done <at> debbugs.gnu.org
Subject: Re: bug#59185: Trouble mounting recursive file systems in containers
Date: Sun, 20 Nov 2022 21:35:21 +0100
Ludovic Courtès <ludo <at> gnu.org> writes:

> Ricardo Wurmus <rekado <at> elephly.net> 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


This bug report was last modified 2 years and 276 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.