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

[Error] timezone not copied from OpenSuSE Tumbleweed host to Ubuntu 20.04.6 LTS guest when using --init #1544

Closed
GentleHumour opened this issue Sep 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@GentleHumour
Copy link

GentleHumour commented Sep 2, 2024

Describe the bug

Using distrobox 1.7.2.1 on an OpenSuSE Tumbleweed 20240830 host, the host timezone doesn't get copied to an Ubuntu 20.04.6 LTS container when it is created with --additional-packages systemd --init. Omitting those distrobox create flags results in a correct timezone in the guest, but the timezone cannot be changed with sudo timedatectl set-timezone Australia/Adelaide due to timedatectl being dependent on systemd.

Edited to add:
I think that distrobox is setting up /etc/timezone and /etc/localtime before systemd starts whatever service is responsible for populating them when I do --init.

To Reproduce

Create and enter:

$ distrobox create -i ubuntu:20.04 --name test --hostname test --root \
     --volume /:/media/root:rw --additional-packages systemd --init
$ distrobox enter --root test

Guest time and zone:

$ date
Mon  2 Sep 13:22:24 UTC 2024

Host time and zone:

$ date
Mon  2 Sep 22:52:26 ACST 2024

$ ls -la /etc/localtime /etc/timezone
lrwxrwxrwx 1 root root 38 Oct 25  2022 /etc/localtime -> /usr/share/zoneinfo/Australia/Adelaide

/etc/timezone:
total 0
drwxr-xr-x 1 root root    0 Dec 20  2022 ./
drwxr-xr-x 1 root root 5666 Sep  2 19:25 ../

Note that /etc/timezone is a directory on Tumbleweed.

Expected behavior

Same time and timezone in the guest as on the host.

Logs

create-logs.txt
enter-logs.txt
podman-logs.txt

Desktop (please complete the following information):

$ podman --version
podman version 5.2.2
$ distrobox --version
distrobox: 1.7.2.1
$ cat /etc/issue.net
Welcome to openSUSE Tumbleweed 20240830 - Kernel %r (%t).
$ uname -a
Linux ahostname 6.10.5-1-default #1 SMP PREEMPT_DYNAMIC Fri Aug 16 11:15:41 UTC 2024 (30fd964) x86_64 x86_64 x86_64 GNU/Linux
  • How did you install distrobox? OS package distrobox.
@GentleHumour GentleHumour added the bug Something isn't working label Sep 2, 2024
@89luca89
Copy link
Owner

Timezone is not copied when using --init as shown here:

if [ -f /etc/localtime ]; then

It is an intended behaviour, as --init should act more like a separate system
Use timedatectl to set it

@89luca89 89luca89 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2024
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