VirtualBox is my virtualization software of choice. It is free and feature-rich, so all my virtual machines are created in VirtualBox. In this article, we will see how to set the BIOS date for a VirtualBox VM.
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:
- Turn off your VM.
- Open the command prompt. If you are using Windows, open it in the following folder:
C:\Program Files\Oracle\VirtualBox
If you are using Linux, just open the terminal app.
- Type the following command:
VBoxManage setextradata "My Virtual Machine" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
Replace the "My Virtual Machine" string with the actual name of the virtual machine you are using.
- 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 2003-06-06.
In Windows, open the PowerShell console and type the following command:([datetime]"06/06/2003" - [datetime]::Now)
Note the TotalMilliseconds value from the output.In Linux, the following script can be used:
#!/bin/bash secs=$(date --date "2003-06-06" +%s) let secs-=$(date +%s) msecs=$(( $secs * 1000 )) echo $msecs
- Using the milliseconds value you calculated, execute the following command:
VBoxManage modifyvm "My Virtual Machine" --biossystemtimeoffset <your milliseconds value>
Now you can start your VM. Its BIOS date will be 2003-06-06 and will not be set from the host OS any more.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
Thanks. Very useful.
Does not work. Copied and pasted directly from here, replacing what is needed, but the syntax of the command is wrong.
Which command exactly has wrong syntax?
I used everything written above weekly. All commands are correct.
C:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm “My Virtual Machine” –biossystemtimeoffset This is mine that does it
On biossystemtimeoffset is — not –
## Inicia a VM sempre na data 30/12/2016
$tempo = “”+([datetime]”12/30/2016” – [datetime]::Now).TotalMilliseconds
$tempo = “”+[math]::Round($tempo)
$nome = “nomeVM”
& ${env:ProgramFiles}\Oracle\VirtualBox\VBoxManage setextradata $nome “VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled” 1
& ${env:ProgramFiles}\Oracle\VirtualBox\VBoxManage modifyvm $nome –biossystemtimeoffset $tempo
& ${env:ProgramFiles}\Oracle\VirtualBox\VBoxManage startvm $nome
Just a thank you for these instructions.
After numerous Googles and many failed attempts (over several years), your guidelines work flawlessly.
Thank you again.
Thank you, step 3 is all what i need
Hello.. And what is necessary to do to set the current time?
Hello
I require my MV to start on January 2017
My virtual machine is called: W81
————————————————– —————————–
cd c: / Program Files / Oracle / VirtualBox
VBoxManage setextradata W81 “VBoxInternal / Devices / VMMDev / 0 / Config / GetHostTimeDisabled” 1
c: \ Program Files \ Oracle \ VirtualBox> VBoxManage modifyvm W81 – biossystemtimeoffset -25477064201
————————————————– ——————————–
After all the procedure, I start my MV but it is dated 2019.
please help
how did you get the offset value?
Is it possible to set a fixed date that no longer changes.
skip
thanks for this tip and the comments above. been looking for this for so long and the other sites were not as helpful as this.
i had to confront this finally after almost a year and good thing i found this page. this one hit the sweetspot.
Thank you finally I can install Windows Whistler
Thank you. Very helpful and working perfectly.
([datetime]”06/06/2003″ – [datetime]::Now) now working in Win7 PowerShell.
#!/bin/sh
secs=$(date –date “2003-06-06” +%s)
let secs-=$(date +%s)
msecs=$(( $secs * 1000 ))
echo $msecs
Not working on linux. Error “3: let: not found”
Let is a built-in function of the bash shell.
I guess you (and me) need to change the first line of the script from #!/bin/sh to #!/bin/bash
Please try to modify and re-run it.
I got the messgage :
At line:1 char:54
+ VBoxManage modifyvm “WINDA_7” –biossystemtimeoffset
+ ~
The ‘<' operator is reserved for future use.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported
OK – got it
Solution:
1. Don’t use ” typing your machine name
2. Don’t use typing your offset time in miliseconds
3. Typing whole command I had to use .\ before typing rest of the command so it looked like this:
.\VBoxManage modifyvm WINDA_7 –biossystemtimeoffset -2046034122
It works – thank you!
i did everything right but the time doesnt go back. im testing this in windows 10 VM with linux host. thescript and commands are all correct but time acn only move forwards the minus before the miliseconds doesnt do anything.
I have an error when doing so that says:
VBoxManage : The term ‘VBoxManage’ is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ VBoxManage modifyvm “Windows 8 Developer Preview (Build 8102 – offici …
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (VBoxManage:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Can you help me figure out how to solve this?
vboxmanage is the executable file in C:\Program Files\Oracle\VirtualBox