pfuhli
Enthusiast
Enthusiast

How to enable VMware Tools time synch?

Hi there,

is there a possibility to activate time synchronisation via VMware Tools in a bunch of VMs without loggin in to every machine and manually doing the switch?

Regards,

daniel

0 Kudos
15 Replies
jonathanp
Expert
Expert

maybe if you had made your VM from a template already configured...

else I don't see how...

Jon

0 Kudos
sbeaver
Leadership
Leadership

Look in the vmx file and change the line

tools.syncTime = "FALSE" to tools.syncTime = "TRUE"

Steve Beaver

VMTN Forum Moderator

*Virtualization is a journey, not a project.*

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
pfuhli
Enthusiast
Enthusiast

Do you know when this will be recognized by the VM?

Do I have to reboot?

0 Kudos
sbeaver
Leadership
Leadership

I do not know for certain but it used to be the vmx file was only read during when the VM powers on. I want to say things have changed but do not have any concrete information on that.

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
jonathanp
Expert
Expert

Cool I did not think this was stored in vmx..

so you can make a script using the sed command to replace the False with True.... or vice-versa. on every vmx file

Jon

0 Kudos
sbeaver
Leadership
Leadership

Yes just not sure when the config file would be re-read. You will need to do some testing to confirm

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
oreeh
Immortal
Immortal

When manually editing a VMX file you usually have to remove the VM from inventory first and re-add it afterwards.

0 Kudos
jonathanp
Expert
Expert

is using this command :

vmware-cmd -s register <config_file_path>

vmware-cmd -s unregister <config_file_path>

would do the same thing as remove and re-add?

so this could be a part of his script?

Regards

Jon.

0 Kudos
oreeh
Immortal
Immortal

would do the same thing as remove and re-add?

Yes, if you change the order

so this could be a part of his script?

Yes

0 Kudos
sbeaver
Leadership
Leadership

Yes that does the same

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
pfuhli
Enthusiast
Enthusiast

Hey guys,

thanks for the quick and detailed response. Unfortunately I'm not a scripting guru 😕 But I will try ...

0 Kudos
jonathanp
Expert
Expert

Here is the command:

for vmx in `find /vmfs -name '*.vmx'`;do `perl -pi -e 's/tools.syncTime = "FALSE"/tools.syncTime = "TRUE"/g' $vmx` ;done

then you can use the same and replace the perl command by the vmware-cmd -s to register vm"

Regards

Jon

jhanekom
Virtuoso
Virtuoso

I always thought "vmware-cmd /vmfs/volumes/datastore/vm/vm.vmx setconfig tools.syncTime true" was more "appropriate" than manually hacking the vmx file. Not sure whether there's any benefit in terms of getting the value applied sooner, though.

0 Kudos
jonathanp
Expert
Expert

I was not aware of this command Smiley Wink

The command I posted is to do the same but in a different way and it is for doing multiple vms in one time.

I know that you could script the other command to do the same things but you'll have to get the path to the vmx for each vm as a changing variable in your command...

Jon

0 Kudos
jhanekom
Virtuoso
Virtuoso

I'm a "copy and paste" Linux shell scripter so I'm borrowing from a "for" loop I had someone at work help me with for a different purpose (backing up vmx files every once in a while):

find /vmfs/volumes -type f -name *.vmx -print | while read filen; do vmware-cmd "$filen" setconfig tools.syncTime true; done;

Haven't tested it yet. And it's not as elegant as yours, as it takes a shotgun approach - it doesn't only modify those machines that need modification.

0 Kudos