VMware Communities
YancenBob
Contributor
Contributor

How does the system installed in VMware Workstation get the system time?

Hi, guys.

I have a question about how the system installed in VMware Workstation gets the system time?

The background is that I do some test with a USB camera in the Ubuntu 16.04 and it is installed in the VMware Workstation. My computer is a ThinkPad with Win10. I need to use the system function just like ftime() or gettimeofday() to get the time stamp when I catch the images. But I meet a problem when I get the images it will cut the data and does't catch the images.

I use the SDK (from the camera company) to get the image raw data. When this error comes, It gives me a tips that please do not use the virtual machine. But before I add the time stamp getting functions, it never comes with this error.

I wander whether it is about the system time getting. Besides, I want to learn how it get the system time.

Thank you

Reply
0 Kudos
4 Replies
TomHowarth
Leadership
Leadership

system time for a virtual machine can be obtained from a number of places:

  • Taken from the system time of the host system via VMtools
  • Taken from a NTP server added to the relevant section in the guest operating system
  • Taken from a Domain Controller in the same why that all other AD Members obtain their time.

The important thing to note is that if you have not set up a valid time source, a guest machine's time can drift from system or true due to the variances of the Hypervisor scheduler.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
YancenBob
Contributor
Contributor

Thanks for your answers!

As you said, I have something else to ask about the three places you list:

About 1, if I do not install the VMtools, how can it get the system time? or it can not get the time in this situation?

About 2, if I am not conect the Internet, you know that there is a situation that I need to collect the data outside and the net environment can not be sured, in this way the time can only be got by the first method?

Reply
0 Kudos
TomHowarth
Leadership
Leadership

if you do not install vmtools you will miss out on a lot more then just a stable time source,  however in this case, time will be synced from the host machine on poweron of the virtual machine,  what will happen then is that time will drift unless you point the guest to an alternative stable time source.

Unless your machine is heavily over utilized, the time drift will be slow, and if you are regularly rebooting the guest machine you may not even notice the difference.

if you do not have internet or access to a NTP server then time has to be obtained from the Guest. 

It is highly recommended to install VMtools and set the obtain time from host setting on the guest.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
YancenBob
Contributor
Contributor

Well, I have installed the VMtools. It is a very nice tool.

That is to say, if the system in the VMware Workstaion and it also has the VMtools, the time getting from the system will be not drift, or in another way, the time will be often synced and the large drift can be avoided.

Reply
0 Kudos