How to sync time on host wake-up within VirtualBox?

后端 未结 6 1489
独厮守ぢ
独厮守ぢ 2020-12-23 09:22

I am running an Ubuntu 12.04-based box inside of Vagrant using VirtualBox. So far, everything is fine - except for one thing:

Let\'s assume that the VM is running. T

6条回答
  •  囚心锁ツ
    2020-12-23 09:36

    I found a solution:

    1. install ntpdate
    2. add "s" permission for ntpdate, this allows non-root users to run ntpdate as root: sudo chmod u+s /usr/sbin/ntpdate
    3. add one line in ~/.bashrc: ntpdate -u ntp.ubuntu.com

    After that, each time you login to the linux system, the time will be sync once.

提交回复
热议问题