toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

ubuntu container fails with `Error: failed to bind /tmp to /run/host/tmp`

Open dabrain34 opened this issue 4 years ago • 3 comments

Describe the bug I' m trying to "toolbox" an ubuntu 18.04 or a centos based on the last toolbox release. The toolbox works with sid from https://blogs.gnome.org/alatiera/2021/03/03/toolbox-your-debian/

but fails with

level=debug msg="Binding /tmp to /run/host/tmp"
mount: /tmp: wrong fs type, bad option, bad superblock on /run/host/tmp, missing codepage or helper program, or other error.
Error: failed to bind /tmp to /run/host/tmp

Steps how to reproduce the behaviour

  1. Get Dockerfile from https://github.com/dabrain34/petalinux-centos/tree/main/ubuntu-18.04
  2. podman build -t ubuntu-18:04-toolbox .
  3. toolbox create -c ubuntu-18 --image ubuntu-18:04-toolbox
  4. podman start --attach ubuntu-18
level=debug msg="Running as real user ID 0"
level=debug msg="Resolved absolute path to the executable as /usr/bin/toolbox"
level=debug msg="TOOLBOX_PATH is /usr/local/bin/toolbox"
level=debug msg="Migrating to newer Podman"
level=debug msg="Creating /run/.toolboxenv"
level=debug msg="Monitoring host"
level=debug msg="Path /run/host/etc exists"
level=debug msg="Preparing to redirect /etc/localtime to /run/host/etc/localtime"
level=debug msg="/run/host/etc/localtime is a symbolic link"
level=warning msg="Failed to resolve /run/host/etc/localtime: lstat /usr/share/zoneinfo: no such file or directory"
level=debug msg="/run/host/etc/localtime points to /usr/share/zoneinfo/America/Toronto"
level=debug msg="Prepending /run/host to /usr/share/zoneinfo/America/Toronto"
level=debug msg="Redirecting /etc/localtime to /run/host/usr/share/zoneinfo/America/Toronto"
level=debug msg="Resolved /etc/localtime to /run/host/usr/share/zoneinfo/America/Montreal"
level=debug msg="Creating regular file /etc/machine-id"
level=debug msg="Binding /etc/machine-id to /run/host/etc/machine-id"
level=debug msg="Creating directory /run/systemd/journal"
level=debug msg="Binding /run/systemd/journal to /run/host/run/systemd/journal"
level=debug msg="Creating directory /run/udev/data"
level=debug msg="Binding /run/udev/data to /run/host/run/udev/data"
level=debug msg="Creating directory /tmp"
level=debug msg="Binding /tmp to /run/host/tmp"
mount: /tmp: wrong fs type, bad option, bad superblock on /run/host/tmp, missing codepage or helper program, or other error.
Error: failed to bind /tmp to /run/host/tmp

Expected behaviour To run properly

Actual behaviour It fails to start the container

Screenshots

Output of toolbox --version (v0.0.90+) e.g., toolbox version 0.0.99.2

Output of podman version e.g.,

Version:            3.0.1
RemoteAPI Version:  1
Go Version:         go1.15.9
OS/Arch:            linux/amd64

Info about your OS Debian Sid

Additional context Same issue with centos

dabrain34 avatar Oct 27 '21 17:10 dabrain34

My system waw not having a tmpfs mount on /tmp

This fixes my issue: mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp

dabrain34 avatar Oct 29 '21 10:10 dabrain34

I see that mount --rbind failed with:

mount: /tmp: wrong fs type, bad option, bad superblock on /run/host/tmp, missing codepage or helper program, or other error.

What did /tmp on your host look like before?

It's probably OK to require that /tmp on the host always be a tmpfs, but I want to understand the failure a bit more before taking any decision.

debarshiray avatar Nov 15 '21 14:11 debarshiray

I'm seeing this issues with both Ubuntu 16.04 and 18.04 regardless on what /tmp is. I have a Debian system, with /tmp as a regular directory (btrfs filesystem), and a Fedora Silverblue system, with /tmp as tmpfs. Both are giving identical errors.

petraglyph avatar Nov 23 '23 05:11 petraglyph