VMware vSphere

 View Only
Expand all | Collapse all

Time on newly created VM

Myretyr

MyretyrSep 22, 2012 08:39 PM

  • 1.  Time on newly created VM

    Posted Mar 29, 2012 05:49 PM

    Is it possible to change time on a VM during creation? Or when booting the first time?

    Is the BIOS setting the only way to adjust time on a VM before an OS has been installed?

    Need to have correct time in order to get my installation of the guest os to work.



  • 2.  RE: Time on newly created VM

    Posted Mar 29, 2012 05:55 PM

    The VM's BIOS time is set to the host's time when the VM is powered on.

    So, if your host has the correct time (make this sure by configuring NTP on the host) then the VM should also have the correct time.

    - Andreas



  • 3.  RE: Time on newly created VM

    Posted Mar 29, 2012 06:17 PM

    The host has the correct time. And the VM has UTC time.

    But as I am installing Windows the guest os want to have the local timezone...



  • 4.  RE: Time on newly created VM

    Posted Mar 29, 2012 06:32 PM

    Hmm, yes, I guess you are right. The ESXi host's time is always in UTC, so a newly created VM's BIOS time will also be in UTC.

    However, Windows expects the BIOS time to be local. This is generally only a problem at the first boot, because once you have the correct time in Windows then Windows will correctly set the BIOS time.

    However, there is a hack to let Windows interpret the BIOS time as UTC. See here: http://weblogs.asp.net/dfindley/archive/2006/06/20/Set-hardware-clock-to-UTC-on-Windows-_2800_or-how-to-make-the-clock-work-on-a-Mac-Book-Pro_2900_.aspx

    Maybe this works for you.

    - Andreas



  • 5.  RE: Time on newly created VM

    Posted Mar 30, 2012 08:08 AM

    Peetz: Microsoft doesn't recommend to use their own solution...

    http://support.microsoft.com/kb/2687252



  • 6.  RE: Time on newly created VM

    Posted Mar 30, 2012 08:15 AM

    Great stuff ... :smileyshocked:

    Okay, you could set this key only for the installation and remove it again when Windows is completely installed and established another time sync method (through VMwareTools, AD, NTP, etc.) ... And avoid installations on DST change days :smileywink:

    Bad hacks, but I can't think of another way right now.



  • 7.  RE: Time on newly created VM

    Posted Mar 29, 2012 06:38 PM

    Have you tried turning off the Time Synch under VMTools Options. Edit Settings on the VM - Options - VMware Tools. Let me know if that works!



  • 8.  RE: Time on newly created VM

    Posted Mar 30, 2012 08:10 AM

    Bradstaenglen:

    Either you didn't read my post entirely or you don't know how VMware Tools work. When I boot my VM there are no VMware tools running until you have:

    1 Guest OS installed

    2 VMware tools installed

    It is in order to get the guest OS installation running I have to have the right (local) time on my VM.



  • 9.  RE: Time on newly created VM

    Posted Mar 30, 2012 08:53 AM

    By the way, how do you install Windows? Is it some kind of PXE boot environment or via bootable CD?



  • 10.  RE: Time on newly created VM

    Posted Mar 30, 2012 04:33 PM

    I don't know why I didn't see the big part about no OS being installed! Must learn to read closer, sorry about that Myretyr



  • 11.  RE: Time on newly created VM

    Posted Mar 30, 2012 07:01 PM

    Interesting question. I thought about this too lately.

    Although I can understand that the time zone configuration has been removed from the hosts (this was possible on ESX) I'm missing a "VM Time Zone" setting (e.g. under options) for the virtual machine, which takes affect when cold booting the system or even for the time sync events which currently have to be disabled manually (http://kb.vmware.com/kb/1189). This would make it a lot easier and secure to even run DCs in the virtual environment without experiencing Kerberos issues.

    For now you need to run a time sync manually (e.g. using net timeor w32tm) during installation before adding a system to a domain.

    André



  • 12.  RE: Time on newly created VM

    Posted Aug 13, 2012 11:09 AM

    Not sure if it's best to reply to this or start my own new question but I essentially have the same issue.

    I have ESXi 5.0 Ent + and I'm running a BSD operating system as the VM/Guest. The Host machine is sync'd to NTP servers and working fine. Every other VM on this host (Windows, Linux and BSD) is working fine and VMware tools works properly to sync the guest with the host.

    For some reason, no matter how many times I change the time in the BIOS of this BSD x64 VM it always defaults back to four hours ahead of EST. I've deleted and rebuilt this VM about five times and it's still happening but this does not happen with any other guest OS.

    How do I manually sync the BIOS time with the Host's time and force it to stay sync'd? I am using the same NTP servers for the host as I am on the BSD Guest OS and that's fine but I can't sync with Active Directory if the BIOS and the OS time are off by several hours like this.

    Thanks for any help.



  • 13.  RE: Time on newly created VM

    Posted Aug 16, 2012 10:34 PM

    Anyone??

    There are KB articles on Linux flavors but nothing for BSD operating systems.

    How do you force a time zone on the BIOS in ESXi 5.0? Is there a tutorial or knowledge base article on this?



  • 14.  RE: Time on newly created VM
    Best Answer

    Posted Sep 22, 2012 08:28 PM

    Quote from the "Time keeping in VMware virtual machines" information guide:

    You can force the CMOS TOD clock’s offset to be initialized to a specific value at power on. To do so, set the option rtc.diffFromUTC in the virtual machine’s .vmx configuration file to a value in seconds. For example, setting rtc.diffFromUTC = 0 sets the clock to UTC at power on, while setting rtc.diffFromUTC = -25200 sets it to Pacific Daylight Time, seven hours earlier than UTC. The guest operating system can still change the offset value after power on by writing a new time to the CMOS TOD clock

    With Powershell it's pretty easy to figure out what time zone you're in, so if you're using PowerCLI you can configure this when you create the vm, and take into account DST.



  • 15.  RE: Time on newly created VM

    Posted Sep 22, 2012 08:39 PM

    :smileysilly:

    Thanks! Will try that!