VM: Set guest hardware time for qemu from libvirt


T65

Recommended Posts

Dear community,

I have a virtual machine with windows 10 installed. I tried to set the guest hardware time for qemu from libvirt to a specific value:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<qemu:commandline>
  <qemu:arg value='-rtc'/>
  <qemu:arg value='base=1970-01-01T00:00:00'/>
</qemu:commandline>

But that doesn't work. I also tried to change the clock tag to something like:

<clock offset='variable' adjustment='-500000' basis='utc'>
  <timer name='hypervclock' present='yes'/>
  <timer name='hpet' present='no'/>
</clock>

Here is the problem that the date / time is printed correctly in the Log "-rtc base=2019-09-23T14:25:47 \" but not set up corrently in operating system and I have to change these value in the *.xml all the time. I figured out, if I start the virtual machine and click on "Edit" the value changed to another value. In my case to -500001 or different.

 

My plan is, an external hardware (arduino + dcf77 modul) and the corresponding software receives the current time via dcf77 longwave time signal and updates the time of the operating system over the air.

 

Does someone of you tried this? Can someone help me out or can give me some useful tips or links?

That would be great!

 

Thanks a lot,

T65

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.