Controlling Time Synchronization in VMware with RTC Configuration
August 14th, 2024 11:08 AM Mr. Q Categories: Virtual Machine
Preface
In VMware virtual machines, managing time synchronization between the host and the guest operating system is crucial for certain applications and scenarios. The Real-Time Clock (RTC) and VMware Tools provide mechanisms to keep the VM’s time in sync with the host, but there are situations where you might want to disable this synchronization to maintain a specific time or behavior within the guest. This article covers how to configure the virtual machine settings to control time synchronization using specific .vmx
configuration file parameters.
Configuration Parameters
To disable time synchronization and control the VM’s start time, you can add the following parameters to your virtual machine’s .vmx
file:
rtc.startTime = "1420779920"
This setting forces the virtual machine to start at a specific time represented by a Unix timestamp (1420779920
corresponds to a specific date and time). The guest OS will see this time as the system’s RTC time at startup.tools.syncTime = "FALSE"
Disables time synchronization between the host and guest operating system via VMware Tools.time.synchronize.tools.startup = "FALSE"
Prevents time synchronization when VMware Tools starts.time.synchronize.continue = "FALSE"
Stops the guest OS from synchronizing its time with the host during normal operation.time.synchronize.restore = "FALSE"
Disables time synchronization when a snapshot is restored.time.synchronize.resume.disk = "FALSE"
Prevents time synchronization when the virtual machine is resumed from a suspended state.time.synchronize.shrink = "FALSE"
Disables time synchronization when a virtual disk is shrunk.
Implementation Example
To apply these settings, follow these steps:
- Locate the
.vmx
File:
- Find the virtual machine’s configuration file (
.vmx
) on your datastore. This file contains all the settings for the VM.
- Edit the
.vmx
File:
- Open the
.vmx
file with a text editor that supports Unix line endings (e.g.,vi
,nano
on Linux, or Notepad++ on Windows). - Add the following lines to the file:
rtc.startTime = "1420779920"
tools.syncTime = "FALSE"
time.synchronize.tools.startup = "FALSE"
time.synchronize.continue = "FALSE"
time.synchronize.restore = "FALSE"
time.synchronize.resume.disk = "FALSE"
time.synchronize.shrink = "FALSE"
- Save and Close the File:
- Save the changes and close the text editor.
- Power On the VM:
- Start the virtual machine. It will now operate with the specified RTC start time and without syncing its clock with the host at any stage.
Summary
By modifying the virtual machine’s .vmx
configuration file, you can effectively control the time synchronization behavior of your VM. This is particularly useful when running applications that require a static time reference or when performing tests that rely on specific time conditions. The parameters outlined in this article ensure that the VM operates independently of the host’s time, with full control over the initial RTC time.
This failed on VMware player, but works well with VMware pro
C:\Users\%USERNAME%\Documents\Virtual Machines