VirtualBox 时间同步

rag*_*era 7 osx oracle-database virtualbox

我在 Mac OSX 上使用 Oracle Virtualbox 4.2.18 作为来宾 Linux 环境,因此我可以使用它来托管 Oracle DB (11G R2)。

我遇到的问题是,每天在不同时间点,虚拟盒子实例的系统时间与实际时间不同步。通常它会落后 10 分钟,一段时间后它会自行纠正。这是一个特别的烦恼,因为这意味着我的 Oracle 数据库系统时间也不正确,这会影响某些事务的处理。

所以我的问题是,有什么办法可以纠正这个问题吗?

小智 7

VirtualBox 来宾添加将安装/usr/sbin/VBoxService,您可以使用它来强制立即时间同步。

$ sudo /usr/sbin/VBoxService --timesync-set-start
Run Code Online (Sandbox Code Playgroud)

VirtualBox的手册中部分规定:

The VirtualBox Guest Additions ensure that the guest's system time 
is synchronized with the host time. 
Run Code Online (Sandbox Code Playgroud)

这篇博文中更详细地描述了时间同步:使用 VirtualBox 来宾添加更好的时间同步

我不会在 VM 来宾上运行 ntpd。来宾应该从主机而不是通过网络获取时间数据。

这个问题也已经在superuser.stackexchange.com和其他 SE 站点上提出和回答。