Wrong local time on ubuntu ova after timezone change

Hi

I have a Graylog 3.2 running on an ova virtual deployment Ubuntu running on Oracle VM Virtual box.

The timezone was set to UTC. I did changed it to Europe/Tirana - my environment.

This caused the time to go (wrongly) + 2 hours forward.

I did set the right time by timedatectl - but it does NOT persist after restart.

How can this be fixed?

best regards
Altin

  1. Timedactl should definitely setup permanent timezone on Ubuntu OVA:
    sudo timedactl set-timezone Europe/Tirana

  2. Virtualbox can have sometimes problem with time, if can’t sync with NTP, check that your OVA have connection to NTP server for sync.

I do not have a problem with setting the timezone.
I have a problem with the wrong clock - because I changed the timezone.

Can you advise about that?

thanks

And how do you ingest messages? Syslog, GELF, beats?

Do messages have timezone in timestamp?

didn’t try at all to ingest logs - wrong hour on the server.

How can I fix the hour on the server - it goes wrong on every restart - this is the question

  1. By default ubuntu uses ntpd daemon, check your NTP settings in /etc/ntp.conf
  2. Default NTP servers are 0-3.ubuntu.pool.ntp.org and falback ntp.ubuntu.com
  3. Check if your firewall don’t block it, or if you want to use local NTP server, comment all lines pool 0-3.ubuntu.pool.ntp.org and pool ntp.ubuntu.com with replace your own ntp.
  4. I have better experience with chrony NTP daemon than ntpd, it can fix time rapidly. You can replace ntpd with chrony by installing chrony (sudo apt install chrony) and setup /etc/chrony/chrony.conf file

Can you be more specific on how to fix this?
I have no orientation at all from what you said above

thanks
Altin

  1. First check that ubuntu OVA has internet connection
  2. If yes, check that your firewall don’t block NTP connection to internet, UDP port 123

No internet connection.
And this way it should be. The Live environment will have no internet connection.

And I am not looking for any sync (NTP). Just to fix the right time - manually

NTP sync is recommended by graylog docs:
Important: All systems running Graylog must have synchronised system time. We strongly recommend to use NTP or similar mechanisms on all machines of your Graylog infrastructure.

Anyway, it’s a problem of VirtualBox and not graylog at all. So check this:

  1. Edit VM settings in VirtualBox and check System - Motherboard - Hardware clock in UTC Time
  2. Or install VirtualBox guest addition to time sync guest OS with host without NTP
1 Like

So the root_timezone at server.conf should be left default (commented) UTC.
The OS timezone and datetime must be set according to local settings
The user’s (<>admin) timezone must be set must be set according to local settings
When on Oracle VM - check `Hardware clock in UTC Time

thank you very much @shoothub

altin

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.