-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Error] /etc/localtime
failed to bind mount during distrobox-init
#1029
Comments
This bug is fixed in the main version. So you would need to wait for a new release, or the git version. |
The same error still occurred when I tested with the latest git version just now. @rrahl0 Which bug or commit are you referring to (that is supposed to fix the issue)? I can help look into the issue to see if the fix can be applied. |
The error I'm getting is: (also in the complete log) + mount --rbind -o ro /run/host/usr/share/zoneinfo/America/Chicago /etc/localtime
mount: /etc/localtime: filesystem was mounted, but any subsequent operation failed: Unknown error 5005.
+ printf Warning: failed to bind mount %s to %s\n /run/host/usr/share/zoneinfo/America/Chicago /etc/localtime
+ return 1
+ [ 1 -ne 0 ]
+ printf Error: An error occurred\n My guess is that it may be related to zfs being used as the underlying filesystem, which includes additional mount option like
FYI I found this PR (containers/toolbox#1340) in the toolbox project that fixed a similar issue. |
I did some further debugging. It turns out that the issue is related to missing mount flags when bind mounting as I've created a PR #1041 to address this issue. This issue does not happen when using BTRFS or XFS as the underlying root file system, since there is no additional flags like On a side note, the workaround (changing to read-write mount) is just a red herring. Changing the mount mode to |
Describe the bug
The command
distrobx enter ...
failed due to bind mount failure of/etc/localtime
. The backing filesystem is ZFS (2.2.0) with native overlay enabled.To Reproduce
distrobox create --name ubuntu-22.04 --image ubuntu:22.04 --home /path/to/ubuntu-home
distrobox enter ubuntu-22.04
Expected behavior
We should expect the commands finish without error, initialize all the mount points successfully, and enter the distrobox/container.
Logs
distrobox enter ubuntu-22.04
: distrobox-enter.logpodman
: podman.logDesktop (please complete the following information):
Additional context
This issue seems to happen only when the backing filesystem is ZFS. I did not encounter such error when using xfs or btrfs.
As a workaround, I moved
/etc/localtime
fromHOST_MOUNTS_RO
toHOST_MOUNTS
, which I think avoids being (bind) mounted as read-only. I'm not sure if this is a valid fix, but it shouldn't break any permission work assuming rootless podman/docker.distrobox/distrobox-init
Lines 1394 to 1441 in 9309e1e
And it seemed working (at least the commands finished without errors/warnings and I can continue working inside container).
Let me know if you need any further testing.
The text was updated successfully, but these errors were encountered: