Hi all,
I'm pretty new to Virtualbox and right now I'm trying to get time synchronization to work from host to guest. I'm running a Windows7 VM on a Win10 host. Time synchronization is not working. I have tried using vboxmanage "vm" vboxinternal/devices/vmmdev/0/config/gethosttimedisabled 0, however, when I start up the VM time sync is not working, i.e. in my case guest time is one year behind host time. Simultaneously (when the VM is starting) the vm.vbox is modified where "gethosttimedisabled" is reset to "1".
Anyone have any great ideas why gethosttimedisabled 0 is not preserved?
Regards,
Per
Guest time sync with host
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Guest time sync with host
- Do not mess with time. Why did you start messing with it? I've never had a guest that needed manual "massaging" of its time. And I have plenty of guests...
- Right-click on the VM in the VirtualBox Manager. Select "Show in Finder/Explorer/Whatever". ZIP the selected ".vbox" file and attach it to your response.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Re: Guest time sync with host
Hi,
I didn't mess with time... VM is inherited from another user.
Thanks for swift reply!
//Per
I didn't mess with time... VM is inherited from another user.
Thanks for swift reply!
//Per
- Attachments
-
- MFGDEV_Environment.zip
- (2.38 KiB) Downloaded 160 times
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Guest time sync with host
- Quit VirtualBox and wait for 1 minute, or even better, restart your host computer.
- Make a backup of the .vbox file, in case you mess it up.
- Open the .vbox file with a file editor that can understand all different line endings. I would suggest Notepad++.
- Delete lines 28, 29 and 30, save and close the .vbox file:
<ExtraDataItem name="VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" value="1"/> <ExtraDataItem name="ôVBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabledö" value="ô1ö"/> <ExtraDataItem name="“VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled”" value="“1”"/>
- Start VirtualBox, start your VM, go to the Time settings and set the time. If the time is way off, things might get crazy.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Re: Guest time sync with host
Hi,
I've tried this before, i.e. removed the three lines from .vbox. However, as soon as I start up VM the values are written back to .vbox file.
One more thing that I notice is that if I manually try and set date and time the "Apply" button is greyed out. If I click Ok the date and time changes, but only for a few seconds - then they switch back to the original values.
*EDIT*
Another thing, if I disable VirtualBox Guest Additions and then set date and time it works! However, when I start the VirtualBox Guest Additions service again the date and time are changed to an incorrect value.
I've tried this before, i.e. removed the three lines from .vbox. However, as soon as I start up VM the values are written back to .vbox file.
One more thing that I notice is that if I manually try and set date and time the "Apply" button is greyed out. If I click Ok the date and time changes, but only for a few seconds - then they switch back to the original values.
*EDIT*
Another thing, if I disable VirtualBox Guest Additions and then set date and time it works! However, when I start the VirtualBox Guest Additions service again the date and time are changed to an incorrect value.
Re: Guest time sync with host
Did you find a solution?
-
- Posts: 126
- Joined: 2. Apr 2014, 04:11
- Primary OS: Ubuntu 12.04
- VBox Version: OSE Debian
- Guest OSses: Ubuntu Trusty
- Location: Austin, TX
- Contact:
Re: Guest time sync with host
You cannot update the dot vbox file directly for a registered VM. It is best practice not to and to use the VBoxManage commands. But in case you want to, then unregister the VM first, update and re-register. On all my VMs I use the standard time sync settings below:
If this is a Ubuntu VM also do the below once. I know this is for Windows VM, but you will have to figure out the equivalent.
Of course you will have to make sure the Guest Additions is working correctly. Run these commands on guest to validate: (again, unsure how this is to be done in Windows - perhaps it's a service?)
And lastly make sure extension packs (of preferably the same version of the guest additions) are installed on the host.
I realized that my post is backwards - check host extpacks first, then VM guest additions, set the guest property and lastly set the hwclock / date on guest.
Code: Select all
# Synchronize the time with the host every 60 seconds (Default 10 seconds)
VBoxManage guestproperty set "${VB_VM_NAME}" "/VirtualBox/GuestAdd/VBoxService/--timesync-interval" 60000
# Adjust in drift increments of 1 second (Default 100 milliseconds)
VBoxManage guestproperty set "${VB_VM_NAME}" "/VirtualBox/GuestAdd/VBoxService/--timesync-min-adjust" 1000
# Adjust if out of sync by more than 30 seconds (Default 20 minutes!)
VBoxManage guestproperty set "${VB_VM_NAME}" "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold" 30000
Code: Select all
date --set "25 Jan 2020 10:21 AM"
hwclock -w
Code: Select all
lsmod | grep -i vboxguest
modinfo vboxguest
Code: Select all
VBoxManage list extpacks