This is probably my last post about Oracle VirtualBox as we are slowly moving towards using Docker on our projects but still wanted to share this gem.
I was working on a web portal for one of our clients and had a user story to implement showing times based on Daylight Saving / Summer time zone. For this scenario, I had to change date of my VM to the past one. When I did that, in couple of seconds, it reverted back to current date.
I was digging on various forums trying to solve this problem with various solutions but none helped. Then I found out that the issue is with one of the OOTB settings of Oracle VirtualBox. This setting is getting / syncing the time from host so eventually reverting back to your laptop time/date.
To disable this setting, just follow below steps while VM is shutdown.
- Open Command Prompt and navigate to folder where you have installed Oracle Virtual Box. For me it was “C:\Program Files\Oracle\VirtualBox”
- Run this command:
VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
- “VM name” is the VM name in Oracle VM VirtualBox Manager
- Now run your VM and profit 😉
Happy virtualization and let’s move to Docker!