VMWare how to prevent a virtual machine from updat

2019-05-10 01:00发布

问题:

I want to know how virtual machines (VMWare) updates their date and time and how to disable this; because i noticed that even if i suspend/shutdown a virtual machine for a year when i'll turn it on again, it will have the right time and date.

For physical machines i know there is a little battery inside the Central Unit fixed on the Motherboard that helps to keep date when the computer is turned off and disconnected from powersupply. But what about virtual machines how do they keep their time ? and how can I forbid that ?

回答1:

You also need to tell the virtual machine to disable clock synchronization. Brian Keller has a blog post on how to do this with Microsoft Virtual PC. However, I needed to figure it out on VMWare Fusion. Luckily the following PDF from VMWare came to my rescue (http://www.vmware.com/pdf/vmware_timekeeping.pdf). The document is a little painful to read through, but basically all you need to do is open up the .vmx file in TextEdit and add the following entries:

tools.syncTime = "FALSE"
time.synchronize.continue = FALSE
time.synchronize.restore = FALSE
time.synchronize.resume.disk = FALSE
time.synchronize.shrink = FALSE
time.synchronize.tools.startup = FALSE

Two of these caused me problems, first tool.syncTime was already set to false (likely because the Virtual PC image I converted already had time sync disabled). Next was “time.synchronize.tools.startup = FALSE”. This stops the VMWare tools from setting the guest OS time on OS startup and was missing from all the other posts I saw online about dealing with this issue.



回答2:

Virtual Machines do piggy back on the Host OS by default.

Here are 2 documents from VMWare that I have found very helpful. It's not easy to summurize it here though: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427 and http://www.vmware.com/files/pdf/techpaper/Timekeeping-In-VirtualMachines.pdf

That being said, "Stopping the clock" might not be what you meant, since when the VM is running, the guest OS must have a working clock at the very least.