{"id":195,"date":"2019-05-23T10:19:20","date_gmt":"2019-05-23T10:19:20","guid":{"rendered":"http:\/\/www.djblond.cz\/?p=195"},"modified":"2019-05-23T10:19:20","modified_gmt":"2019-05-23T10:19:20","slug":"unwanted-synchronization-of-time","status":"publish","type":"post","link":"https:\/\/www.djblond.cz\/index.php\/2019\/05\/23\/unwanted-synchronization-of-time\/","title":{"rendered":"Unwanted synchronization of time"},"content":{"rendered":"<p>Imagine following situation. You have virtual machine on VMware and clock are from time to time automaticaly sync, but not with NTP source you have, but from different source. First thing which will come to your mind is, lets check checkbox on Vmware which is enabling or disabling synchronization with host. But you will find out, that checkbox is unchecked.<\/p>\n<p>So lets start the troubleshooting.<\/p>\n<p>Open event viewer, go to system events and filter <code>event ID 1, source Kernel-General<\/code><br \/>\nYou will see something like this<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-201\" src=\"http:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/eventid1.jpg\" alt=\"\" width=\"571\" height=\"67\" srcset=\"https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/eventid1.jpg 571w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/eventid1-300x35.jpg 300w\" sizes=\"(max-width: 571px) 100vw, 571px\" \/><\/p>\n<p>You see the prove, that &#8222;something&#8220; is changing time. So lets review setting of NTP client<br \/>\nOpen CMD and run follwoing command<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/status<\/pre>\n<p>Result is something like this:<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-206\" src=\"http:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/win32tm.jpg\" alt=\"\" width=\"422\" height=\"135\" srcset=\"https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/win32tm.jpg 422w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/win32tm-300x96.jpg 300w\" sizes=\"(max-width: 422px) 100vw, 422px\" \/><\/p>\n<p>You see, that IP and source are correct and in case of domain joined computer, you will see probably IP and FQDN of your domain controller.<\/p>\n<p>Ok, now we know that NTP server is set correctly, but our computer still getting the time from different source.<\/p>\n<p>To be able to find, what process is calling time change, you will need to enable\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/previous-versions\/windows\/it-pro\/windows-server-2003\/cc784501(v=ws.10)\">Audit privilege use<\/a> and then search for <strong>event ID 4616<\/strong><\/p>\n<p>Run the <code>Local Security Policy<\/code> (secpol.msc), and go to<code>\u00a0Local Policies\\Audit Policy,<\/code> open <code>Audit privilege<\/code> use and check Success checkbox.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-204\" src=\"http:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/auditprivilege.jpg\" alt=\"\" width=\"434\" height=\"235\" srcset=\"https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/auditprivilege.jpg 434w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/auditprivilege-300x162.jpg 300w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/p>\n<p>Once the auditing will be enabled, we have to wait untli time change will occure. Then search in Security log <code>event id 4616.<\/code><\/p>\n<p><strong>BOOOM!<\/strong> we found the root cause! vmtoolsd.exe alias VMware<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-203\" src=\"http:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/4616.jpg\" alt=\"\" width=\"470\" height=\"266\" srcset=\"https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/4616.jpg 470w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/05\/4616-300x170.jpg 300w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/p>\n<p>Ok, now its comming question, how is possible, that time is change by VMware even if I have this setting disabled?<\/p>\n<p>I found <a href=\"https:\/\/kb.vmware.com\/s\/article\/1189\">article<\/a> on VMware, that this can sometimes happen. Especially time is resynchronized when you migrate the virtual machine using vMotion, take a snapshot, restore to a snapshot, shrink the virtual disk, or restart the VMware Tools service in the virtual machine (including rebooting the virtual machine).<\/p>\n<p>To completly disable time synchronization, we need to do change on VMware VM. More infomration <a href=\"https:\/\/kb.vmware.com\/s\/article\/1189\">here<\/a>.<\/p>\n<ol data-aura-rendered-by=\"23:82;a\">\n<li>Select the virtual machine in the vSphere Web Client inventory and power it off.<\/li>\n<li>Right click the virtual machine and choose\u00a0<b>Edit Settings<\/b>&#8230;<\/li>\n<li>Click the\u00a0<b>VM Options<\/b>\u00a0tab.<\/li>\n<li>Expand the Advanced option.<\/li>\n<li>Under\u00a0<b>Configuration Parameters<\/b>\u00a0click\u00a0<b>Edit Configuration<\/b>.<\/li>\n<li>Click\u00a0<b>Add Row<\/b>\u00a0and add this information<\/li>\n<\/ol>\n<table style=\"width: 380px;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\"><strong>Name<\/strong><\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><strong>Value<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">tools.syncTime<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.continue<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.restore<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.resume.disk<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.shrink<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.tools.startup<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.tools.enable<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 289px;\" colspan=\"1\" rowspan=\"1\">time.synchronize.resume.host<\/td>\n<td style=\"width: 68px;\" colspan=\"1\" rowspan=\"1\"><span style=\"font-family: monospace;\">False<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong data-aura-rendered-by=\"23:82;a\">Note<\/strong>: When adding\u00a0<code data-aura-rendered-by=\"23:82;a\">tools.syncTime<\/code>\u00a0via the\u00a0<strong data-aura-rendered-by=\"23:82;a\">Configuration Parameters<\/strong>\u00a0in vSphere 5.x, it is not displayed again after the entry has been accepted and closed. When you view the\u00a0<code data-aura-rendered-by=\"23:82;a\"><em>vm_name<\/em>.vmx<\/code>\u00a0file, you see the parameter inserted as\u00a0<code data-aura-rendered-by=\"23:82;a\">tools.syncTime = \"FALSE\"<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine following situation. You have virtual machine on VMware and clock are from time to time automaticaly sync, but not with NTP source you have, but from different source. First&#8230; <a href=\"https:\/\/www.djblond.cz\/index.php\/2019\/05\/23\/unwanted-synchronization-of-time\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts\/195"}],"collection":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/comments?post=195"}],"version-history":[{"count":9,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":209,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts\/195\/revisions\/209"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/media\/206"}],"wp:attachment":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/media?parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/categories?post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/tags?post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}