Emulated clock in bhyve is local time?

melar

Cadet
Joined
Nov 30, 2017
Messages
5
What are the available clocksources ?
cat /sys/devices/system/clocksource/clocksource0/available_clocksource

I would try:
echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource
 

dmshimself

Dabbler
Joined
Mar 20, 2017
Messages
41
Cheers Patrick - rancheros as the docker host included with freenas runs a thing they called system containers and one of these runs NTP to keep the date/time correct on the racheros host. However as I've found in the comment above, as the clock drifts, it tries to set the time when it drifts but never seems to actually achieve this and tries again, and again ... When I stop this system container and run an ntpd manually on the docker host, it works fine, the date is synched up and all the containers then get the correct date/time. This isn't a solution, but a decent enough workaround in a dev environment.
 

dmshimself

Dabbler
Joined
Mar 20, 2017
Messages
41
What are the available clocksources ?
cat /sys/devices/system/clocksource/clocksource0/available_clocksource

On the rancheros docker host
refined-jiffies jiffies and tsc


I would try:
echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource

I'm going to continue looking at the NTP issue I seem to have found, but I'll try this other idea later on. If it worked, it wouldn't be preserved through updates I'm guess. Dunno.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

dmshimself

Dabbler
Joined
Mar 20, 2017
Messages
41
Excellent catch Patrick, yes I would say that is identical and fixed in the next rancheros release.
 

JohnB

Cadet
Joined
Dec 9, 2018
Messages
5
I've thought about the following, but didn't test it. (I'm still using iohyve)

bhyve is located under /usr/sbin/
rename bhyve to bhyve-renamed
add a new script named bhyve
Code:
#!/bin/sh
/usr/sbin/bhyve-renamed -u $*

chown root:wheel bhyve
chmod 555 bhyve

This adds the option -u to every use of bhyve. I think this shouldn't be a problem.
Maybe someone could test this.

A belated "thank you" for this, as I found this post a few weeks ago and have been using it successfully. Then last night I saw that FreeNAS 11.3-RELEASE was available, and I noticed in the documentation that they added the ability to select LOCAL or UTC clock in the configuration for virtual machines. (Note that the upgrade to FreeNAS 11.3-RELEASE overwrites the /usr/sbin/bhyve script used in your workaround.) I upgraded to 11.3-RELEASE, reconfigured the virtual machines in the GUI for UTC clock, and they are now working as expected.
 
Top