Created
August 15, 2019 17:28
-
-
Save rogersguedes/787f6a4c661ba920d283668d82d79c6d to your computer and use it in GitHub Desktop.
Sets the date in a VirtualBox VM given a time offset in seconds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#thanks to https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/ | |
if [[ -z ${1} || -z ${2} ]] | |
then | |
echo ${0} " Usage:" | |
echo " ${0} <vm-name> <time-offset>" | |
echo " Example: ${0} projectVM -36000000" | |
exit | |
fi | |
VBoxManage setextradata "${1}" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1 | |
VBoxManage modifyvm "${1}" --biossystemtimeoffset "${2}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/rogersguedes/1775de65ee549ea9766ca873cafd6ffe