Monday, October 13, 2014

Adjusting the system time in a VirtualBox Guest

This is only useful in a couple situations, but very handy if you need it. The guest OS must be unlocked, so you'll need to shut it down before you do this.
#/bin/bash

# First get the name of the vm you need to adjust:
VBoxManage list vms

# Then, adjust the time in milliseconds (neg nums go back in time):
VBoxManage modifyvm $MY_VM --biossystemtimeoffset -32000000000  # about a year

# To get it back on current time, just set it to zero:
VBoxManage modifyvm $MY_VM --biossystemtimeoffset 0

No comments :