Skip to content

Instantly share code, notes, and snippets.

@unfulvio
Last active June 30, 2022 16:33
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save unfulvio/1f921b3f356c25414b36e2423f5052da to your computer and use it in GitHub Desktop.
Save unfulvio/1f921b3f356c25414b36e2423f5052da to your computer and use it in GitHub Desktop.
How to change server time on a Vagrant box on Virtualbox
#!/bin/bash
# Log in into the box
vagrant ssh
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first
sudo service vboxadd-service stop
# Now you can set any date and time
sudo date -s "2020-10-01 10:25:00"
# Want to sync again with host? Restart Guest Additions
# Anyway on the next Vagrant up it will sync again regardless
sudo service vboxadd-service start
@wseyler
Copy link

wseyler commented Apr 9, 2019

Thanks... Was a lifesaver for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment