89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
9.41k stars 384 forks source link

[Error] failed to bind mount to `/etc/localtime` Error: An error occurred - distrobox init #1435

Closed morrolinux closed 2 weeks ago

morrolinux commented 3 weeks ago

Describe the bug

Arch linux host with ZFS root filesystem. Creating any debian-based container fails with the error: Warning: failed to bind mount /run/host/usr/share/zoneinfo/Europe/Rome to /etc/localtime Error: An error occurred:

+ mount --rbind -o ro /run/host/usr/share/zoneinfo/Europe/Rome /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/Europe/Rome /etc/localtime
Warning: failed to bind mount /run/host/usr/share/zoneinfo/Europe/Rome to /etc/localtime
+ return 1
+ [ 1 -ne 0 ]
+ printf Error: An error occurred\n
Error: An error occurred
DEBU[0000] Called logs.PersistentPostRunE(podman --log-level debug logs debian-bullseye) 
DEBU[0000] Shutting down engines                        

RHEL-based images like fedora work just fine.

To Reproduce

Expected behavior To initialize the container without errors.

Logs distrobox.log podman.log

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

89luca89 commented 2 weeks ago

This has probably something to do with ZFS setup, anyway I've added a fallback+warning in these cases, where we go back to simply copying the file instead