search

Friday, October 28, 2016

How to set custom time and date on virtual machine

If your virtual machine is managed by VirtualBox, there are 2 services which synchronize date and time. The first step is to stop them from restoring the time:
sudo service systemd-timesyncd stop
sudo service vboxadd-service stop
After that you can set time with date command, for example:
sudo date +%T -s "00:12:00"
or
date -s "27 OCT 2016 00:12:00"
or
date +%Y%m%d -s "20161027"

No comments:

Post a Comment