Professional Documents
Culture Documents
You might have a number of reasons to set a custom date for a VirtualBox VM. For example, when
you want to try some outdated Windows build or some time-limited trial software. By default,
VirtualBox uses the host machine's time and date and synchronizes it when you open your VM.
To set a custom date, you need to perform these steps:
1. Disable the clock’s “Automatic sync with a Time server” inside the OS
2. Turn off your VM.
3. Open the command prompt as Administrator. If you are using Windows, open it in the
following folder:
C:\Program Files\Oracle\VirtualBox
Replace the "My Virtual Machine" string with the actual name of the virtual machine you
are using.
5. Now, you need to calculate the offset between the current date and the desired BIOS date
for the VM, in milliseconds.
For example, let's set it to 2019-01-01.
In Windows, open the PowerShell console and type the following command:
([datetime]"01/01/2019" - [datetime]::Now)
Note the TotalMilliseconds value from the output, and keep the integer part with the sign.
In our example “-174190590“
https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/
In Linux, the following script can be used:
#!/bin/sh
secs=$(date --date "2019-01-01" +%s)
let secs-=$(date +%s)
msecs=$(( $secs * 1000 ))
echo $msecs
6. Using the milliseconds value you calculated, execute the following command:
Now you can start your VM. Its BIOS date will be 2019-01-01 and will not be set from the host OS
any more.
https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/