vagrant - 使用 VirtualBox + Vagrant + Homestead 的时间不同步

标签 vagrant virtualbox homestead

每当我的计算机休眠时,Homestead 环境中的时间就会不同步。时间不会在它醒来时更新,它只是从计算机开始 sleep 时开始继续。这迫使我摧毁,然后上升 Vagrant。

版本:

  • 家园 5.0.1
  • Vagrant 2.0.1
  • VirtualBox 5.2.4

  • 我已将此添加到 Vagrantfile:
    Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
        config.vm.provider 'virtualbox' do |vb|
           vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000 ]
        end
    
        config.vm.provider "virtualbox" do |vb|
           vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
        end
    
        // More code...
    

    如何让 Homestead 环境同步时间?

    最佳答案

    我在 going out of sync with s3 时遇到了这个解决方案.

    编辑 ntp.conf
    sudo vim /etc/ntp.conf
    将服务器更改为:

    server 0.amazon.pool.ntp.org iburst
    server 1.amazon.pool.ntp.org iburst
    server 2.amazon.pool.ntp.org iburst
    server 3.amazon.pool.ntp.org iburst
    

    重启ntp服务
    sudo service ntp restart
    

    你就完成了。

    关于vagrant - 使用 VirtualBox + Vagrant + Homestead 的时间不同步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48249066/

    相关文章:

    laravel - Sqlsrv pdo 驱动程序扩展适用于修补程序,但不适用于 Web 应用程序

    php - 不能将 openssl 扩展用于 SSL/TLS 保护

    laravel - Homestead 和 NGINX 错误 : emerg] invalid number of arguments in "proxy_set_header"

    build - 有没有办法以编程方式生成可用于在启动时启动 iso 镜像的 ovf 文件?

    Vagrant :无法使NFS工作

    git - 无法推送到新的 gitlab 安装

    vagrant - Vagrant 中的单独的可配置资源手册

    VirtualBox:VERR_VM_DRIVER_NOT_INSTALLED

    vagrant - 仅当源文件存在时,如何才能使 puppet 复制文件?

    python - 在 Vagrant 中运行 Python 脚本