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

Time sync is wrong #186

Closed
viktorbenei opened this issue May 29, 2015 · 12 comments · Fixed by #215
Closed

Time sync is wrong #186

viktorbenei opened this issue May 29, 2015 · 12 comments · Fixed by #215
Assignees

Comments

@viktorbenei
Copy link

Time sync only syncs the time but not the timezone. At the moment I'm in London, date prints Fri May 29 17:24:13 BST 2015 on my Mac, when I run date in the vagrant managed Parallels Desktop VM I get the same time but with UTC timezone Fri May 29 17:24:13 UTC 2015. FYI BST is UTC+1 at the moment - and this timezone issue cases problems with communicating Amazon services.

The only solution so far is to turn time sync off. edit turning the time sync off in Parallels Desktop is only a very short term fix as PD10 probably does some CPU frequency optimization which messes up Ubuntu's own time sync and keeps adding an hour to the current time about every minute!

So the actual solution what worked is to set the timezone manually inside the VM (ubuntu: sudo timedatectl set-timezone Europe/London) and turn Parallels time sync on for the VM.

Tech info

  • OS X: 10.10.3
  • Vagrant 1.7.2
  • vagrant-parallels (1.3.12)
  • Parallels Desktop: 10.2.0 (28956), 10.2.1 (29006) - tested with both
  • Ubuntu 14.04 VM
@legal90 legal90 self-assigned this May 29, 2015
@legal90
Copy link
Collaborator

legal90 commented Jun 1, 2015

@viktorbenei Thank you for report!
I've reproduced this issue and forwarded it to the responsible people in Parallels Desktop. I will let you know about any updates on this.

@viktorbenei
Copy link
Author

Thanks!

@fredericgaus
Copy link

Any news on this topic? Setting the timezone is not working for me because of daylight saving adjustments :-(

@viktorbenei
Copy link
Author

@fredericgaus as a temporary solution you could use sudo timedatectl set-timezone Europe/London, this should take care of daylight saving AFAIK

@fredericgaus
Copy link

@viktorbenei thanks for your answer. On Debian timedatectl is not available. This is why I used dpkg-reconfigure tzdataas well as ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime but both don't do the trick :(.

For some reasons the synchronized time also seems to be wrong or not UTC as expected by Debian as I get the following:

Current default time zone: 'Europe/Berlin'
Local time is now:      Fri Jun 19 10:56:16 CEST 2015.
Universal Time is now:  Fri Jun 19 08:56:16 UTC 2015.

But the current UTC time is 7:56:16. So the synchronized UTC time is already wrong.

In my Ubuntu, when I do sudo timedatectl set-timezone Europe/Berlin the clock is set correctly but is reseted to the wrong value as it was before about a minute later. Any ideas?

@viktorbenei
Copy link
Author

@fredericgaus what worked for me was to enable the Parallels time sync feature for the Ubuntu VM, then SSH into the VM and call sudo timedatectl set-timezone Europe/London. With the versions I listed in the Tech Info section it worked for me, timedatectl sets the time zone and after that Parallel's built in time sync works correctly as it does not modify the timezone, only the time is synced from the host machine (at least in my case).

EDIT: for this to work I think you have to use the timezone in the VM which you use on your host.

@fredericgaus
Copy link

@viktorbenei thanks you reply. Sadly the Parallels time sync in my case do adjust the timezone to EET which is wrong. (My host runs on CEST).

So this is not working for me :(

@legal90
Copy link
Collaborator

legal90 commented Jun 22, 2015

@fredericgaus Unfortunately, the only tip I can get you now is to disable Time Sync feature and synchronize time on the VM side with ntpd.
How to disable Time Sync (works on Parallels Desktop >= 10.1.2):

config.vm.provider "parallels" do |prl|
  prl.customize ["set", :id, "--time-sync", "off"]
end

@fredericgaus
Copy link

@legal90 thanks for the tip. As explained in the original issue report this does not work either. If I do, every minute the hours increase too. Doing an ntpd update every minute is not reliable enough then. Doing it every second is too much. I fear the only option I got currently is to get along with the much slower VirtualBox 👎

@smurfy
Copy link

smurfy commented Jun 26, 2015

I have the same problem, (CEST timezone) Now switched my Mac "Closest City" to UTC - United Kingdom showing the Time Zone in the dialog as GMT and in terminal as UTC.

Parallels seams to sync the Time and Timezone correctly and i now have UTC zone and the same time as my mac. just need to remember that i need to add 2 hours to my time :)

@viktorbenei
Copy link
Author

FYI at the moment we use this solution :

We don't install the Parallels Tools, but rather we do a manual time sync after rolling back to a snapshot state, sending a sudo date through ssh.

You can find the code here, if that helps: https://github.com/bitrise-io/bitrise-machine/blob/dc80e95c61df322c27b8738287b69d69eb3cca89/cli/setup.go#L67

The point is, to not to mess with the timezone settings inside the VM you have to pass the time with the timezone information included.

@legal90
Copy link
Collaborator

legal90 commented Sep 29, 2015

Fixed in v1.5.0
For Parallels Desktop 10 the timesync feature is disabled by default:

--time-sync off

For Parallels Desktop 11+ it's enabled, but timezones are not affected:

--time-sync on
--disable-timezone-sync on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants