How do I manually set the system time in VirtualBox?
I have found a solution. Read the following material: link
Basically if you have Windows host and Ubuntu guest, do the following:
- Find a name of your VM (Virtual Machine) - run VB (VirtualBox), select your VM, open settings, in 'General' tab check the name, e.g. in my case
Ubuntu 12.04 32bit
- In Windows, start a command line interpreter, go to
C:\Program Files\Oracle
folder and clickVirtualBox
to select, then holding left shift key, do a mouse right-button click and select "Open command window here" menu, the interpreter has to be running now Paste the following command (change the VM name to your name!):
VBoxManage setextradata "Ubuntu 12.04 32bit" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
Finally, start your Ubuntu guest and set the time and date manually.
Undo
If required, to get the guest to sync time with the host again, repeat the above steps but change the final 1
to 0
.
As mentioned in another answer, if you are running Ubuntu as a Guest under VirtualBox then you should be aware that the system time is automatically kept in sync by the Guest Additions (i.e., not through an option in the motherboard settings).
Your solution in that case is to disable the Guest Additions, which can be achieved by executing
sudo service vboxadd-service stop
or
sudo /etc/init.d/vboxadd-service stop
You can then set the time as desired (from command line using date --set
or using the system settings applet)
The VirtualBox service will be restarted at next reboot, or you can do it manually.
The only way is to set the time in the Virtualbox motherboard using the command line:
VBoxManage modifyvm <name> --biossystemtimeoffset <msec>
For example, to set back the date 1 year:
VBoxManage modifyvm <name> --biossystemtimeoffset -31536000000