我有一个安装了Guest Additions的Centos 6.5的VirtualBox虚拟机,我需要能够在客户机内随时禁用和启用时间同步。默认情况下,客户机每10秒钟与宿主机同步其时间[1],这是内置于Guest Additions的功能。
有一些方法可以禁用时间同步,但对我的需求不足:
在VM启动时禁用时间同步:
VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
在VM运行时从VM中禁用Guest Additions:
sudo service vboxadd-service stop
它们对我不起作用的原因是:
- 第一种选项只在启动时起作用-我需要能够在运行时执行此操作
- 第二个选项会停止我需要的来自Guest Additions的其他功能
当我运行sudo VBoxControl guestproperty enumerate
时,我看不到任何与时间同步有关的内容。
所以……请提供一种方法,在不禁用vboxadd-service
服务的情况下,在VirtualBox VM内禁用和启用时间同步:)
[1]https://www.virtualbox.org/manual/ch09.html#disabletimesync第9.13.4节