Skip to content
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

[Bug] DNS resolution not working in a rootful systemd container with unshare-netns option. #1075

Closed
kisame217 opened this issue Nov 25, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@kisame217
Copy link

kisame217 commented Nov 25, 2023

Describe the bug
DNS resolution not working in a rootful systemd container with unshare-netns option.

To Reproduce
Steps to reproduce the behavior

  1. distrobox create
distrobox create --image fedora-toolbox:39 -r -H /var/home/{user}/.test2 --init  --unshare-netns --name fedora-tb
  1. distrobox enter and ping 8.8.8.8
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=11.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=12.5 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=12.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=12.1 ms
  1. ping google
$ ping www.google.com
ping: www.google.com: Temporary failure in name resolution

Expected behavior
DNS resolution should work.

Logs

$ distrobox create --image fedora-toolbox:39 -r -H /var/home/{user}/.test2 --init  --unshare-netns --name fedora-tb
+ '[' -z '' ']'
+ '[' -z fedora-toolbox:39 ']'
+ '[' -z testfedora ']'
+ '[' -z testfedora ']'
+ case "${container_manager}" in
+ command -v podman
+ container_manager=podman
+ command -v podman
+ '[' 1 -ne 0 ']'
+ container_manager='podman --log-level debug'
+ '[' 1 -ne 0 ']'
+ container_manager='sudo podman --log-level debug'
+ '[' -z /usr/bin/distrobox-init ']'
+ '[' -z /usr/bin/distrobox-export ']'
+ '[' 0 -ne 0 ']'
+ sudo podman --log-level debug inspect --type container testfedora
+ '[' -n '' ']'
+ '[' 0 -eq 1 ']'
+ sudo podman --log-level debug inspect --type image fedora-toolbox:39
+ printf 'Creating '\''%s'\'' using image %s\t' testfedora fedora-toolbox:39
Creating 'testfedora' using image fedora-toolbox:39	++ generate_command
++ result_command='sudo podman --log-level debug create'
+++ uname -n
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root'
++ '[' 0 -eq 0 ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host'
++ '[' 1 -eq 0 ']'
++ '[' 1 -eq 0 ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave'
++ '[' -e /sys/fs/selinux ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal'
++ '[' -L /dev/shm ']'
++ nix_dirs='
		/nix
		/gnu
		/run/current-system/sw
	'
++ for nix_dir in ${nix_dirs}
++ '[' -d /nix ']'
++ for nix_dir in ${nix_dirs}
++ '[' -d /gnu ']'
++ for nix_dir in ${nix_dirs}
++ '[' -d /run/current-system/sw ']'
++ '[' -n '' ']'
++ '[' -n /var/home/{user}/.test2 ']'
++ '[' '!' -d /var/home/{user}/.test2 ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"'
++ '[' /home/{user} '!=' /var/home/{user} ']'
++ '[' -d /var/home/{user} ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave'
++ '[' -d /run/user/1000 ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave'
++ '[' 1 -eq 0 ']'
++ echo 'sudo podman --log-level debug'
++ grep -q podman
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave
			--ulimit host
			--annotation run.oci.keep_original_groups=1
			--mount type=devpts,destination=/dev/pts'
++ '[' 1 -eq 1 ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave
			--ulimit host
			--annotation run.oci.keep_original_groups=1
			--mount type=devpts,destination=/dev/pts
				--systemd=always'
++ '[' 1 -eq 0 ']'
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave
			--ulimit host
			--annotation run.oci.keep_original_groups=1
			--mount type=devpts,destination=/dev/pts
				--systemd=always '
++ result_command='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave
			--ulimit host
			--annotation run.oci.keep_original_groups=1
			--mount type=devpts,destination=/dev/pts
				--systemd=always
	--entrypoint /usr/bin/entrypoint
	fedora-toolbox:39
		--verbose
		--name "{user}"
		--user 1000
		--group 1000
		--home "/var/home/{user}/.test2"
		--init "1"
		--nvidia "0"
		--pre-init-hooks ""
		--additional-packages ""
		-- '\'''\''
	'
++ printf %s 'sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave
			--ulimit host
			--annotation run.oci.keep_original_groups=1
			--mount type=devpts,destination=/dev/pts
				--systemd=always
	--entrypoint /usr/bin/entrypoint
	fedora-toolbox:39
		--verbose
		--name "{user}"
		--user 1000
		--group 1000
		--home "/var/home/{user}/.test2"
		--init "1"
		--nvidia "0"
		--pre-init-hooks ""
		--additional-packages ""
		-- '\'''\''
	'
+ cmd='sudo podman --log-level debug create
		--hostname "testfedora.{My-Hostname}"
		--name "testfedora"
		--privileged
		--security-opt label=disable
		--user root:root
			--ipc host
		--label "manager=distrobox"
		--env "SHELL=/bin/bash"
		--env "HOME=/home/{user}"
		--volume /:/run/host:rslave
		--volume /dev:/dev:rslave
		--volume /sys:/sys:rslave
		--volume /tmp:/tmp:rslave
		--volume "/usr/bin/distrobox-init":/usr/bin/entrypoint:ro
		--volume "/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro
		--volume "/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro
		--volume "/home/{user}":"/home/{user}":rslave
			--volume /sys/fs/selinux
			--volume /var/log/journal
			--env "HOME=/var/home/{user}/.test2"
			--env "DISTROBOX_HOST_HOME=/home/{user}"
			--volume "/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"
			--volume "/var/home/{user}":"/var/home/{user}":rslave
			--volume /run/user/1000:/run/user/1000:rslave
			--ulimit host
			--annotation run.oci.keep_original_groups=1
			--mount type=devpts,destination=/dev/pts
				--systemd=always
	--entrypoint /usr/bin/entrypoint
	fedora-toolbox:39
		--verbose
		--name "{user}"
		--user 1000
		--group 1000
		--home "/var/home/{user}/.test2"
		--init "1"
		--nvidia "0"
		--pre-init-hooks ""
		--additional-packages ""
		-- '\'''\''
	'
+ eval sudo podman --log-level debug create --hostname '"testfedora.{My-Hostname}"' --name '"testfedora"' --privileged --security-opt label=disable --user root:root --ipc host --label '"manager=distrobox"' --env '"SHELL=/bin/bash"' --env '"HOME=/home/{user}"' --volume /:/run/host:rslave --volume /dev:/dev:rslave --volume /sys:/sys:rslave --volume /tmp:/tmp:rslave --volume '"/usr/bin/distrobox-init":/usr/bin/entrypoint:ro' --volume '"/usr/bin/distrobox-export":/usr/bin/distrobox-export:ro' --volume '"/usr/bin/distrobox-host-exec":/usr/bin/distrobox-host-exec:ro' --volume '"/home/{user}":"/home/{user}":rslave' --volume /sys/fs/selinux --volume /var/log/journal --env '"HOME=/var/home/{user}/.test2"' --env '"DISTROBOX_HOST_HOME=/home/{user}"' --volume '"/var/home/{user}/.test2:/var/home/{user}/.test2:rslave"' --volume '"/var/home/{user}":"/var/home/{user}":rslave' --volume /run/user/1000:/run/user/1000:rslave --ulimit host --annotation run.oci.keep_original_groups=1 --mount type=devpts,destination=/dev/pts --systemd=always --entrypoint /usr/bin/entrypoint fedora-toolbox:39 --verbose --name '"{user}"' --user 1000 --group 1000 --home '"/var/home/{user}/.test2"' --init '"1"' --nvidia '"0"' --pre-init-hooks '""' --additional-packages '""' -- ''\'''\'''
++ sudo podman --log-level debug create --hostname testfedora.{My-Hostname} --name testfedora --privileged --security-opt label=disable --user root:root --ipc host --label manager=distrobox --env SHELL=/bin/bash --env HOME=/home/{user} --volume /:/run/host:rslave --volume /dev:/dev:rslave --volume /sys:/sys:rslave --volume /tmp:/tmp:rslave --volume /usr/bin/distrobox-init:/usr/bin/entrypoint:ro --volume /usr/bin/distrobox-export:/usr/bin/distrobox-export:ro --volume /usr/bin/distrobox-host-exec:/usr/bin/distrobox-host-exec:ro --volume /home/{user}:/home/{user}:rslave --volume /sys/fs/selinux --volume /var/log/journal --env HOME=/var/home/{user}/.test2 --env DISTROBOX_HOST_HOME=/home/{user} --volume /var/home/{user}/.test2:/var/home/{user}/.test2:rslave --volume /var/home/{user}:/var/home/{user}:rslave --volume /run/user/1000:/run/user/1000:rslave --ulimit host --annotation run.oci.keep_original_groups=1 --mount type=devpts,destination=/dev/pts --systemd=always --entrypoint /usr/bin/entrypoint fedora-toolbox:39 --verbose --name {user} --user 1000 --group 1000 --home /var/home/{user}/.test2 --init 1 --nvidia 0 --pre-init-hooks '' --additional-packages '' -- ''
time="2023-11-25T13:48:43+05:30" level=info msg="podman filtering at log level debug"
time="2023-11-25T13:48:43+05:30" level=debug msg="Called create.PersistentPreRunE(podman --log-level debug create --hostname testfedora.{My-Hostname} --name testfedora --privileged --security-opt label=disable --user root:root --ipc host --label manager=distrobox --env SHELL=/bin/bash --env HOME=/home/{user} --volume /:/run/host:rslave --volume /dev:/dev:rslave --volume /sys:/sys:rslave --volume /tmp:/tmp:rslave --volume /usr/bin/distrobox-init:/usr/bin/entrypoint:ro --volume /usr/bin/distrobox-export:/usr/bin/distrobox-export:ro --volume /usr/bin/distrobox-host-exec:/usr/bin/distrobox-host-exec:ro --volume /home/{user}:/home/{user}:rslave --volume /sys/fs/selinux --volume /var/log/journal --env HOME=/var/home/{user}/.test2 --env DISTROBOX_HOST_HOME=/home/{user} --volume /var/home/{user}/.test2:/var/home/{user}/.test2:rslave --volume /var/home/{user}:/var/home/{user}:rslave --volume /run/user/1000:/run/user/1000:rslave --ulimit host --annotation run.oci.keep_original_groups=1 --mount type=devpts,destination=/dev/pts --systemd=always --entrypoint /usr/bin/entrypoint fedora-toolbox:39 --verbose --name {user} --user 1000 --group 1000 --home /var/home/{user}/.test2 --init 1 --nvidia 0 --pre-init-hooks  --additional-packages  -- )"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using conmon: \"/usr/bin/conmon\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Initializing boltdb state at /var/lib/containers/storage/libpod/bolt_state.db"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using graph driver overlay"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using graph root /var/lib/containers/storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using run root /run/containers/storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using static dir /var/lib/containers/storage/libpod"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using tmp dir /run/libpod"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using volume path /var/lib/containers/storage/volumes"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using transient store: false"
time="2023-11-25T13:48:43+05:30" level=debug msg="[graphdriver] trying provided driver \"overlay\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Cached value indicated that overlay is supported"
time="2023-11-25T13:48:43+05:30" level=debug msg="Cached value indicated that overlay is supported"
time="2023-11-25T13:48:43+05:30" level=debug msg="Cached value indicated that metacopy is being used"
time="2023-11-25T13:48:43+05:30" level=debug msg="Cached value indicated that native-diff is not being used"
time="2023-11-25T13:48:43+05:30" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
time="2023-11-25T13:48:43+05:30" level=debug msg="backingFs=extfs, projectQuotaSupported=false, useNativeDiff=false, usingMetacopy=true"
time="2023-11-25T13:48:43+05:30" level=debug msg="Initializing event backend journald"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime crun-wasm initialization failed: no valid executable found for OCI runtime crun-wasm: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime runj initialization failed: no valid executable found for OCI runtime runj: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime youki initialization failed: no valid executable found for OCI runtime youki: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime ocijail initialization failed: no valid executable found for OCI runtime ocijail: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Configured OCI runtime krun initialization failed: no valid executable found for OCI runtime krun: invalid argument"
time="2023-11-25T13:48:43+05:30" level=debug msg="Using OCI runtime \"/usr/bin/crun\""
time="2023-11-25T13:48:43+05:30" level=info msg="Setting parallel job count to 37"
time="2023-11-25T13:48:43+05:30" level=debug msg="Successfully loaded 1 networks"
time="2023-11-25T13:48:43+05:30" level=debug msg="Pulling image fedora-toolbox:39 (policy: missing)"
time="2023-11-25T13:48:43+05:30" level=debug msg="Looking up image \"fedora-toolbox:39\" in local containers storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Normalized platform linux/amd64 to {amd64 linux  [] }"
time="2023-11-25T13:48:43+05:30" level=debug msg="Loading registries configuration \"/etc/containers/registries.conf\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Loading registries configuration \"/etc/containers/registries.conf.d/000-shortnames.conf\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Trying \"registry.fedoraproject.org/fedora-toolbox:39\" ..."
time="2023-11-25T13:48:43+05:30" level=debug msg="parsed reference into \"[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Found image \"fedora-toolbox:39\" as \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Found image \"fedora-toolbox:39\" as \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9)"
time="2023-11-25T13:48:43+05:30" level=debug msg="exporting opaque data as blob \"sha256:35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Looking up image \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Normalized platform linux/amd64 to {amd64 linux  [] }"
time="2023-11-25T13:48:43+05:30" level=debug msg="Trying \"registry.fedoraproject.org/fedora-toolbox:39\" ..."
time="2023-11-25T13:48:43+05:30" level=debug msg="parsed reference into \"[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Found image \"registry.fedoraproject.org/fedora-toolbox:39\" as \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Found image \"registry.fedoraproject.org/fedora-toolbox:39\" as \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9)"
time="2023-11-25T13:48:43+05:30" level=debug msg="exporting opaque data as blob \"sha256:35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /:/run/host options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /dev:/dev options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /sys:/sys options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /tmp:/tmp options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /usr/bin/distrobox-init:/usr/bin/entrypoint options [ro]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /usr/bin/distrobox-export:/usr/bin/distrobox-export options [ro]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /usr/bin/distrobox-host-exec:/usr/bin/distrobox-host-exec options [ro]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /home/{user}:/home/{user} options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount :/sys/fs/selinux options []"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount :/var/log/journal options []"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /var/home/{user}/.test2:/var/home/{user}/.test2 options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /var/home/{user}:/var/home/{user} options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="User mount /run/user/1000:/run/user/1000 options [rslave]"
time="2023-11-25T13:48:43+05:30" level=debug msg="Looking up image \"fedora-toolbox:39\" in local containers storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Normalized platform linux/amd64 to {amd64 linux  [] }"
time="2023-11-25T13:48:43+05:30" level=debug msg="Trying \"registry.fedoraproject.org/fedora-toolbox:39\" ..."
time="2023-11-25T13:48:43+05:30" level=debug msg="parsed reference into \"[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Found image \"fedora-toolbox:39\" as \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage"
time="2023-11-25T13:48:43+05:30" level=debug msg="Found image \"fedora-toolbox:39\" as \"registry.fedoraproject.org/fedora-toolbox:39\" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9)"
time="2023-11-25T13:48:43+05:30" level=debug msg="exporting opaque data as blob \"sha256:35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Inspecting image 35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9"
time="2023-11-25T13:48:43+05:30" level=debug msg="exporting opaque data as blob \"sha256:35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="exporting opaque data as blob \"sha256:35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Inspecting image 35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9"
time="2023-11-25T13:48:43+05:30" level=debug msg="Inspecting image 35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9"
time="2023-11-25T13:48:43+05:30" level=debug msg="using systemd mode: true"
time="2023-11-25T13:48:43+05:30" level=debug msg="setting container name testfedora"
time="2023-11-25T13:48:43+05:30" level=debug msg="Loading seccomp profile from \"/usr/share/containers/seccomp.json\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Adding mount /proc"
time="2023-11-25T13:48:43+05:30" level=debug msg="Adding mount /sys/fs/cgroup"
time="2023-11-25T13:48:43+05:30" level=debug msg="Allocated lock 20 for container e69b4da3e676e1c536596b7f0db027e7ef471af5709cf9293d1bafde71b5521e"
time="2023-11-25T13:48:43+05:30" level=debug msg="parsed reference into \"[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="exporting opaque data as blob \"sha256:35f981983e47752167419556bab2e571fbaa831e75793b2cbc7fd3822cf248e9\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Cached value indicated that idmapped mounts for overlay are supported"
time="2023-11-25T13:48:43+05:30" level=debug msg="Created container \"e69b4da3e676e1c536596b7f0db027e7ef471af5709cf9293d1bafde71b5521e\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Container \"e69b4da3e676e1c536596b7f0db027e7ef471af5709cf9293d1bafde71b5521e\" has work directory \"/var/lib/containers/storage/overlay-containers/e69b4da3e676e1c536596b7f0db027e7ef471af5709cf9293d1bafde71b5521e/userdata\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Container \"e69b4da3e676e1c536596b7f0db027e7ef471af5709cf9293d1bafde71b5521e\" has run directory \"/run/containers/storage/overlay-containers/e69b4da3e676e1c536596b7f0db027e7ef471af5709cf9293d1bafde71b5521e/userdata\""
time="2023-11-25T13:48:43+05:30" level=debug msg="Creating new volume 53c285cfabc7bd024cd00832cda559e8aad571be75c2f7f3724c1a4ad3be68c0 for container"
time="2023-11-25T13:48:43+05:30" level=debug msg="Validating options for local driver"
time="2023-11-25T13:48:43+05:30" level=debug msg="Creating new volume 3e02e68faebc0caee1c77f360c55e74740c4c221ddf6971895fc6800f34e6f45 for container"
time="2023-11-25T13:48:43+05:30" level=debug msg="Validating options for local driver"
time="2023-11-25T13:48:43+05:30" level=debug msg="Called create.PersistentPostRunE(podman --log-level debug create --hostname testfedora.{My-Hostname} --name testfedora --privileged --security-opt label=disable --user root:root --ipc host --label manager=distrobox --env SHELL=/bin/bash --env HOME=/home/{user} --volume /:/run/host:rslave --volume /dev:/dev:rslave --volume /sys:/sys:rslave --volume /tmp:/tmp:rslave --volume /usr/bin/distrobox-init:/usr/bin/entrypoint:ro --volume /usr/bin/distrobox-export:/usr/bin/distrobox-export:ro --volume /usr/bin/distrobox-host-exec:/usr/bin/distrobox-host-exec:ro --volume /home/{user}:/home/{user}:rslave --volume /sys/fs/selinux --volume /var/log/journal --env HOME=/var/home/{user}/.test2 --env DISTROBOX_HOST_HOME=/home/{user} --volume /var/home/{user}/.test2:/var/home/{user}/.test2:rslave --volume /var/home/{user}:/var/home/{user}:rslave --volume /run/user/1000:/run/user/1000:rslave --ulimit host --annotation run.oci.keep_original_groups=1 --mount type=devpts,destination=/dev/pts --systemd=always --entrypoint /usr/bin/entrypoint fedora-toolbox:39 --verbose --name {user} --user 1000 --group 1000 --home /var/home/{user}/.test2 --init 1 --nvidia 0 --pre-init-hooks  --additional-packages  -- )"
time="2023-11-25T13:48:43+05:30" level=debug msg="Shutting down engines"
+ printf '\033[32m [ OK ]\n\033[0mDistrobox '\''%s'\'' successfully created.\n' testfedora
�[32m [ OK ]
�[0mDistrobox 'testfedora' successfully created.
+ printf 'To enter, run:\n\n'
To enter, run:

+ '[' 1 -eq 1 ']'
+ '[' 1000 -ne 0 ']'
+ printf 'distrobox enter --root %s\n\n' testfedora
distrobox enter --root testfedora

+ '[' 1 -eq 0 ']'
+ exit 0

Attach also the output of podman logs or docker logs, possibly with --latest flag
See attached files

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod?
podman
  • Which version or podman, docker or lilipod?
$ podman --version
podman version 4.7.2
  • Which version of distrobox?
$ distrobox version
distrobox: 1.5.0.2
  • Which host distribution?
Fedora Kinoite 39
  • How did you install distrobox?
rpm-ostree install distrobox

Additional context
On Host

cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#

# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
search bbrouter

In Container

$ cat /etc/resolv.conf

search bbrouter
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1

podmanlatest.txt

@kisame217 kisame217 added the bug Something isn't working label Nov 25, 2023
@kisame217
Copy link
Author

Tried again with version [1.6.0.1]. Same result.

@kisame217
Copy link
Author

kisame217 commented Nov 25, 2023

Setting dns using below can be a temporary fix.

sudo resolvectl dns eth0 8.8.8.8

@pavinjosdev
Copy link
Contributor

It seems you might be missing systemd as it's not preinstalled on most OCI images as they cater to app containers and not system containers.

Change the distrobox create command to:

distrobox create --image quay.io/toolbx-images/fedora-toolbox:39 --init  --additional-packages "systemd" --unshare-netns --root --home /var/home/{user}/.test2 --name fedora-tb

Docs:
https://github.com/89luca89/distrobox/blob/main/docs/useful_tips.md#using-init-system-inside-a-distrobox

@kisame217
Copy link
Author

The image I'm using already has systemd installed.
Systemd is clearly installed as I can query the status of e.g systemd-resolved.

@pavinjosdev
Copy link
Contributor

FWIW, I wasn't able to reproduce the issue on distrobox v1.6.0.1 with PR #1069 applied and the following commands:

sudo mkdir /home/fedora
distrobox create --image quay.io/toolbx-images/fedora-toolbox:39 --init  --additional-packages "systemd" --unshare-netns --root --home /home/fedora --name fedora-tb

@kisame217
Copy link
Author

Ok this bug can be closed now. Seems like it was a problem with the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants