I recently got a question about enabling and disabling the quest time synchronization for virtual machines. The customer asked about a solution to change the settings from within the operating system instead of the VMware vSphere Client or vSphere Web Client. Normally you would change the virtual machine time synchronization settings by hand with the vSphere Client/Web Client/HTML5 or with a PowerCLI script, but after some searching, it appears, there is a solution provided by VMware.
VMware Tools configuration utility:
The solution is provided by the following utility the “vmware-toolbox-cmd” or also known as the VMware Tools configuration utility. So what is the purpose of the vmware-toolbox-cmd command on Linux machines? Based on a VMware source the following:
The VMware Tools configuration utility is a command-line interface that you can use in the guest operating system to modify VMware Tools settings, shrink virtual disks, and connect and disconnect virtual devices.
The utility becomes available when VMware Tools is installed on a Linux operating system. I have tested it with Open-VM-Tools and the official VMware Tools and in both cases, it works without any problems. After changing the setting, the checkbox “Synchronize guest time with host” is enabled or disabled after a couple of seconds.
[bash title=”Commands on Linux Based virtual machines”]
### Step 01: Open a SSH session or connect to the console of a Linux Virtual Machine.
### Step 02: Login with root credentials or a account that can be elevated with sudo.
### Step 03: Show current time synchronization status
vmware-toolbox-cmd timesync status
### Step 04A: Disable virtual machine time synchronization
vmware-toolbox-cmd timesync disable
### Step 04B: Enable virtual machine time synchronization
vmware-toolbox-cmd timesync enable
### Step 05: Verify the result in the VMware vSphere Client.
Here are some important URLs related to the VMware Tools configuration utility that are available on the internet: