FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-03-2012, 05:29 PM
William Thompson
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

I have a Win 2008 R2 guest running under KVM controlled by libvirt. The
guest is loosing time. I have the clock open on the guest and the seconds
change once every 2-5 seconds. The guest was started at 11:45:58. As of
13:10:30 the guest's time is 12:03:46.

I have tried various things that I found on google. Unfortunately, the
sites I found do not work for me.

I've tried setting the machine type to pc-0.13 (default pc-1.1), -no-hpet,
-no-kvm-pit-reinjection, -rtc clock=host, -rtc driftfix=slew, different CPU
options and combinations of those.

Here is the KVM line that libvirt used:
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.13 -cpu core2duo
-enable-kvm -m 2048 -smp 1,sockets=1,cores=1,threads=1 -name tcc2008
-uuid b8c797af-8b7e-4d54-cf0a-c21eea23f5c7 -nodefconfig -nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/tcc2008.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control
-rtc base=localtime,clock=host -no-hpet -no-kvm-pit-reinjection -no-shutdown
-boot order=cdn,menu=on
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-drive file=/vm/tcc2008/tcc2008.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0
-drive if=none,id=drive-ide0-1-0,readonly=on,format=raw,cache=none
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
-netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=25
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f4:f2:ec, bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0
-device usb-tablet,id=input0
-vnc 0.0.0.0:1,password -vga std
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

NOTE: The command above was split at options to make readability easier.

qemu-kvm: 1.1.0+dfsg-1 64-bit
Kernel is vanilla 3.4.2


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120803172921.GZ14578@electro-mechanical.com">http://lists.debian.org/20120803172921.GZ14578@electro-mechanical.com
 
Old 08-04-2012, 08:49 PM
Camaleón
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

On Fri, 03 Aug 2012 13:29:21 -0400, William Thompson wrote:

> I have a Win 2008 R2 guest running under KVM controlled by libvirt. The
> guest is loosing time. I have the clock open on the guest and the
> seconds change once every 2-5 seconds. The guest was started at
> 11:45:58. As of 13:10:30 the guest's time is 12:03:46.
>
> I have tried various things that I found on google. Unfortunately, the
> sites I found do not work for me.

(...)

Surely you've already read the wiki tips about time drifts in the guests
but in the event you missed, here it is:

http://www.linux-kvm.org/page/FAQ#I.27m_experiencing_timer_drift_issues_in_my_VM _guests.2C_what_to_do.3F

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/jvk1ti$dtf$9@dough.gmane.org
 
Old 08-06-2012, 01:11 PM
William Thompson
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

Keep me in CC, I'm not on the list

>> I have a Win 2008 R2 guest running under KVM controlled by libvirt. The
>> guest is loosing time. I have the clock open on the guest and the
>> seconds change once every 2-5 seconds. The guest was started at
>> 11:45:58. As of 13:10:30 the guest's time is 12:03:46.
>>
>> I have tried various things that I found on google. Unfortunately, the
>> sites I found do not work for me.
>
>(...)
>
>Surely you've already read the wiki tips about time drifts in the guests
>but in the event you missed, here it is:
>
>http://www.linux-kvm.org/page/FAQ#I.27m_experiencing_timer_drift_issues_in_my_VM _guests.2C_what_to_do.3F

That talks about linux guests, not windows guests. Either way, it didn't
help.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120806131110.GB1760@electro-mechanical.com">http://lists.debian.org/20120806131110.GB1760@electro-mechanical.com
 
Old 08-06-2012, 02:59 PM
Stan Hoeppner
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

On 8/6/2012 8:11 AM, William Thompson wrote:
> Keep me in CC, I'm not on the list
>
>>> I have a Win 2008 R2 guest running under KVM controlled by libvirt. The
>>> guest is loosing time. I have the clock open on the guest and the
>>> seconds change once every 2-5 seconds. The guest was started at
>>> 11:45:58. As of 13:10:30 the guest's time is 12:03:46.
>>>
>>> I have tried various things that I found on google. Unfortunately, the
>>> sites I found do not work for me.
>>
>> (...)
>>
>> Surely you've already read the wiki tips about time drifts in the guests
>> but in the event you missed, here it is:
>>
>> http://www.linux-kvm.org/page/FAQ#I.27m_experiencing_timer_drift_issues_in_my_VM _guests.2C_what_to_do.3F
>
> That talks about linux guests, not windows guests. Either way, it didn't
> help.

You need to be looking at this from the Windows side as well. VMware's
vmtools has been shipping for over 7 years. It includes a client that
runs on Windows guests and keeps the time sync'd to the hypervisor. I
know of no equivalent Windows client for any Linux hypervisors. Which
means you need to tweak the Windows kernel to keep time to less than 5
minutes of drift per hour, setup ntpd on the hypervisor host, and point
the Windows guest to that time source IP.

This would be much simpler if the Windows scheduler had more
granularity. You can only schedule per day or greater. AFAIK you can't
schedule events every X minutes as with cron. Maybe there's a cron for
Windows. I don't have time to look. If you could do every X minutes,
you'd simply run ntpd in the host, and run a batch file every 5 minutes
containing

w32tm /resync /nowait

to run every 5 minutes, after doing a

c:> net time /setsntp:host_ip_addr

to tell Windows what ntp server to use.

Find a way to schedule every 5 mins in Windows and your problem is
pretty much solved.

This is exactly how I fixed this problem with Linux guests running on
ESX 2.5/3.0 about 7 years ago. I tweaked the kernel command lines of
the guests with noapic noacpi clock=pit etc to get the clocks down to
less than 5 minutes of drift per hour, then cron'd ntpdate every 10
minutes. Eventually I got the guest kernels tuned to less than 3
minutes drift per day and cron'd ntpdate once a day at midnight.

--
Stan


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 501FDBC5.10306@hardwarefreak.com">http://lists.debian.org/501FDBC5.10306@hardwarefreak.com
 
Old 08-06-2012, 03:17 PM
Camaleón
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

On Mon, 06 Aug 2012 09:11:10 -0400, William Thompson wrote:

> Keep me in CC, I'm not on the list

Sorry, I can't (can't define an additional To:/CC: from my newsreaders) :-
(

>>> I have a Win 2008 R2 guest running under KVM controlled by libvirt.
>>> The guest is loosing time. I have the clock open on the guest and the
>>> seconds change once every 2-5 seconds. The guest was started at
>>> 11:45:58. As of 13:10:30 the guest's time is 12:03:46.
>>>
>>> I have tried various things that I found on google. Unfortunately,
>>> the sites I found do not work for me.
>>
>>(...)
>>
>>Surely you've already read the wiki tips about time drifts in the guests
>>but in the event you missed, here it is:
>>
>>http://www.linux-kvm.org/page/FAQ#I.27m_experiencing_timer_drift_issues_in_my_VM _guests.2C_what_to_do.3F
>
> That talks about linux guests, not windows guests. Either way, it
> didn't help.

It talks "generally" about time syncing problems within VM "clients"
without going further on the client OS that us used. In fact, time drift
problems are very common on different kind of virtual machines not just KVM.

So, setting up the guest to use the host as NTP server from where to sync
did not help?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/jvon5o$qkd$10@dough.gmane.org
 
Old 08-06-2012, 07:46 PM
Chris Davies
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

Stan Hoeppner <stan@hardwarefreak.com> wrote:
> This would be much simpler if the Windows scheduler had more
> granularity. You can only schedule per day or greater. AFAIK you can't
> schedule events every X minutes as with cron.

In the Advanced settings there's an option to repeat the job every N
hours or minutes.

Chris


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jhj5f9x3bt.ln2@news.roaima.co.uk">http://lists.debian.org/jhj5f9x3bt.ln2@news.roaima.co.uk
 
Old 08-06-2012, 08:37 PM
Stan Hoeppner
 
Default Help with KVM/libvirt/win2008r2. Guest loosing time.

On 8/6/2012 2:46 PM, Chris Davies wrote:
> Stan Hoeppner <stan@hardwarefreak.com> wrote:
>> This would be much simpler if the Windows scheduler had more
>> granularity. You can only schedule per day or greater. AFAIK you can't
>> schedule events every X minutes as with cron.
>
> In the Advanced settings there's an option to repeat the job every N
> hours or minutes.

Just one more reason to hate Windows. I haven't managed any for quite a
while. When I did, I did most of my adminning from the DOS prompt. The
"at" scheduler command that's been around since NT 3.1, and which was
equivalent to the GUI scheduler back then, up to W2K IIRC, has
apparently not been updated to keep pace with the new GUI options.
Either that or the command line help simply hasn't been updated.

So the option I described for the OP is viable. Setup ntpd in the host
and schedule a batch file containing "w32tm /resync /nowait" to run
every 5-10 minutes, given his W2008 guest is drifting an hour each hour
IIRC from his post.

--
Stan


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 50202AF1.20904@hardwarefreak.com">http://lists.debian.org/50202AF1.20904@hardwarefreak.com
 

Thread Tools




All times are GMT. The time now is 03:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org